repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
javier3407/Plugin.Video.ElJavi.tv | refs/heads/master | resources/lib/common.py | 17 | import urllib, urllib2, os, io, xbmc, xbmcaddon, xbmcgui, json, re
AddonID = 'plugin.video.playlistLoader'
Addon = xbmcaddon.Addon(AddonID)
icon = Addon.getAddonInfo('icon')
AddonName = Addon.getAddonInfo("name")
def OpenURL(url, headers={}, user_data={}, justCookie=False):
if user_data:
user_data = urllib.urlenco... |
gnagel/backtrader | refs/heads/master | backtrader/indicators/cci.py | 4 | #!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pub... |
OctavianLee/thriftpy | refs/heads/develop | tests/test_protocol_binary.py | 10 | # -*- coding: utf-8 -*-
from io import BytesIO
from thriftpy._compat import u
from thriftpy.thrift import TType, TPayload
from thriftpy.utils import hexlify
from thriftpy.protocol import binary as proto
class TItem(TPayload):
thrift_spec = {
1: (TType.I32, "id", False),
2: (TType.LIST, "phones",... |
defrex/django-bootstrap-paginator | refs/heads/master | tests/testlist/models.py | 2 |
from django.db import models
class TestModel(models.Model):
pass
|
Comunitea/CMNT_004_15 | refs/heads/11.0 | project-addons/payment_mode_supplier/models/payment_mode_supplier.py | 1 | from odoo import models, fields
class PaymentModeSuppliers(models.Model):
_name = 'payment.mode.supplier'
name = fields.Char(required=True,String="Name") |
xydinesh/xydinesh.com | refs/heads/master | ptvs_virtualenv_proxy.py | 6 | # ############################################################################
#
# Copyright (c) Microsoft Corporation.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of this distribution. If ... |
FreekingDean/home-assistant | refs/heads/dev | homeassistant/components/light/tellstick.py | 3 | """
Support for Tellstick lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.tellstick/
"""
import voluptuous as vol
from homeassistant.components.light import (ATTR_BRIGHTNESS,
SUPPORT_BRIGHTNESS, L... |
jaimemaretoli/Arduino | refs/heads/master | arduino-core/src/processing/app/i18n/python/requests/hooks.py | 1891 | # -*- coding: utf-8 -*-
"""
requests.hooks
~~~~~~~~~~~~~~
This module provides the capabilities for the Requests hooks system.
Available hooks:
``response``:
The response generated from a Request.
"""
HOOKS = ['response']
def default_hooks():
hooks = {}
for event in HOOKS:
hooks[event] = []... |
CyanogenMod/android_external_chromium_org | refs/heads/cm-12.0 | tools/telemetry/telemetry/value/histogram_unittest.py | 10 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import unittest
from telemetry import value
from telemetry.page import page_set
from telemetry.value import histogram as histogram_module
class Te... |
FTwO-O/pyShadowsocks | refs/heads/master | pyshadowsocks/protocol/socks5/socks5_server.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: booopooob@gmail.com
#
# Info: asyncio - Stream <https://docs.python.org/3/library/asyncio-stream.html#asyncio-tcp-echo-server-streams>
# - Transport <https://docs.python.org/3/library/asyncio-protocol.html>
# - relay in data_receiv... |
psas/commander | refs/heads/master | psas_cmdr/commands.py | 1 | """ PSAS Command definitions.
"""
import socket
class TCP_Command(object):
def __init__(self, ip, port):
self.ip = ip
self.port = port
def send(self, cmd):
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(('', 0))
sock.settime... |
lichong012245/django-lfs-0.7.8 | refs/heads/master | lfs/caching/__init__.py | 11 | from listeners import *
|
biddyweb/androguard | refs/heads/master | androsim.py | 38 | #!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation,... |
yinquan529/platform-external-chromium_org | refs/heads/master | tools/telemetry/telemetry/page/record_wpr.py | 23 | #!/usr/bin/env python
# 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.
import json
import logging
import os
import sys
import tempfile
import time
import urlparse
from telemetry import test
from telemet... |
quinox/velib_python | refs/heads/master | dbusitem.py | 1 | ## IMPORTANT NOTE - MVA 2015-2-5
# This file is deprecated. Use the classes in vedbus.py from now on. If you are
# working on some project, please change it, and make it work with the classes
# in vedbus.py
import dbus
# Python imports
from dbus import String
from lxml.etree import XML
# Local imports
import tracin... |
CGATOxford/bioconda-recipes | refs/heads/master | scripts/ucsc/create-ucsc-packages.py | 41 | #!/usr/bin/env python3
import os
import re
import sys
import yaml
from textwrap import dedent
import tarfile
import urllib.request
# e.g., "======== addCols ===================================="
re_header = re.compile(r'^=+\s+(?P<program>\w+)\s+=+$')
# e.g.,# "addCols - Sum columns in a text file."
re_summary = r... |
lyager/rpcz | refs/heads/master | python/rpcz/__init__.py | 12 | #!/usr/bin/env python
import sys
from rpcz.pywraprpcz import Application, Server
from rpcz.rpc import RPC, RpcError, RpcApplicationError, RpcDeadlineExceeded
|
johnowhitaker/bobibabber | refs/heads/master | sklearn/preprocessing/tests/test_imputation.py | 1 | import numpy as np
from scipy import sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_true
from sklearn.preprocessing.imputa... |
luotao1/Paddle | refs/heads/develop | python/paddle/distributed/fleet/meta_optimizers/sharding/offload_helper.py | 1 | # Copyright (c) 2020 PaddlePaddle 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 appli... |
aisipos/django | refs/heads/master | tests/template_tests/syntax_tests/test_builtins.py | 521 | from django.test import SimpleTestCase
from ..utils import setup
class BuiltinsTests(SimpleTestCase):
@setup({'builtins01': '{{ True }}'})
def test_builtins01(self):
output = self.engine.render_to_string('builtins01')
self.assertEqual(output, 'True')
@setup({'builtins02': '{{ False }}'}... |
gwq5210/litlib | refs/heads/master | thirdparty/sources/boost_1_60_0/tools/build/src/tools/message.py | 11 | # Status: ported.
# Base revision: 64488.
#
# Copyright 2008, 2010 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Defines main target type 'message', that prints a message when built for the
# first time.
i... |
unnikrishnankgs/va | refs/heads/master | venv/lib/python3.5/site-packages/IPython/sphinxext/ipython_directive.py | 2 | # -*- coding: utf-8 -*-
"""
Sphinx directive to support embedded IPython code.
This directive allows pasting of entire interactive IPython sessions, prompts
and all, and their code will actually get re-executed at doc build time, with
all prompts renumbered sequentially. It also allows you to input code as a pure
pyth... |
vipul-sharma20/oh-mainline | refs/heads/master | vendor/packages/scrapy/scrapy/tests/test_spidermiddleware_referer.py | 29 | from unittest import TestCase
from scrapy.http import Response, Request
from scrapy.spider import BaseSpider
from scrapy.contrib.spidermiddleware.referer import RefererMiddleware
class TestRefererMiddleware(TestCase):
def setUp(self):
self.spider = BaseSpider('foo')
self.mw = RefererMiddleware()... |
NvanAdrichem/networkx | refs/heads/master | networkx/readwrite/tests/test_gml.py | 10 | #!/usr/bin/env python
# encoding: utf-8
from ast import literal_eval
import codecs
import io
from nose.tools import *
from nose import SkipTest
import networkx as nx
from networkx.readwrite.gml import literal_stringizer, literal_destringizer
import os
import tempfile
try:
unicode
except NameError:
unicode = s... |
ovresko/erpnext | refs/heads/master | erpnext/hr/doctype/employment_type/__init__.py | 37694 | from __future__ import unicode_literals
|
Jusedawg/SickRage | refs/heads/develop | lib/hachoir_core/field/generic_field_set.py | 58 | from hachoir_core.field import (MissingField, BasicFieldSet, Field, ParserError,
createRawField, createNullField, createPaddingField, FakeArray)
from hachoir_core.dict import Dict, UniqKeyError
from hachoir_core.error import HACHOIR_ERRORS
from hachoir_core.tools import lowerBound, makeUnicode
import hachoir_core.c... |
bhpayne/domino_tile_floor | refs/heads/master | brute_force_search/scaling.py | 1 | #!/usr/bin/env python3
import matplotlib.pyplot as plt
import numpy
import seaborn as sns
import domino_tiles_brute_force as dtbf
# https://docs.python.org/3/library/copy.html
import copy
import time
from random import randint
if __name__ == "__main__":
# user defined variables
# dimensions of two dimensiona... |
NickTGraham/PythonPack | refs/heads/master | weather.py | 1 | #!/usr/bin/env python
#Remaking my weather script to use forcast.io now that Yahoo weather is gone
import requests
import sys
import datetime
import os
from geopy import geocoders
from pushbullet import Pushbullet
import re
from Dotfile import dotfile
gn = geocoders.Nominatim()
APIKEY = ""
Long, Lat = "",""
PBKEY =... |
Starofall/OEDA | refs/heads/master | Backend/oeda/rtxlib/dataproviders/MQTTListenerDataProvider.py | 1 | from time import sleep
import logging
from colorama import Fore
from flask import json
from paho import mqtt
import paho.mqtt.client as mqtt
from oeda.log import *
from oeda.rtxlib.dataproviders.DataProvider import DataProvider
class MQTTListenerDataProvider(DataProvider):
""" implements data collection throug... |
bluemini/kuma | refs/heads/master | kuma/users/middleware.py | 16 | from django.contrib.auth import logout
from django.shortcuts import render
from .models import UserBan
class BanMiddleware(object):
"""
Middleware implementing bans. HTTP requests from banned users will
be logged out, and shown a message explaining that they are
banned.
"""
def process_reques... |
nkcr/WebIndex | refs/heads/master | app/venv/lib/python3.5/site-packages/nltk/test/probability_fixt.py | 28 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
# probability.doctest uses HMM which requires numpy;
# skip probability.doctest if numpy is not available
def setup_module(module):
from nose import SkipTest
try:
import numpy
except ImportError:
raise SkipTest("probability.doc... |
tornadozou/tensorflow | refs/heads/master | tensorflow/examples/tutorials/input_fn/boston.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 appl... |
thilbern/scikit-learn | refs/heads/master | sklearn/cluster/affinity_propagation_.py | 5 | """ Algorithms for clustering : Meanshift, Affinity propagation and spectral
clustering.
"""
# Author: Alexandre Gramfort alexandre.gramfort@inria.fr
# Gael Varoquaux gael.varoquaux@normalesup.org
# License: BSD 3 clause
import numpy as np
from ..base import BaseEstimator, ClusterMixin
from ..utils import a... |
Matvey-Kuk/cspark-python | refs/heads/master | cspark/MessageResponse.py | 1 | from .Response import Response
class MessageResponse(Response):
def __init__(self, plain_text_message, markdown_message=None):
self.__markdown_message = markdown_message
self.__plain_text_message = plain_text_message
if markdown_message is None:
self.__markdown_message = self.... |
haniehrajabi/ryu | refs/heads/master | ryu/services/protocols/bgp/processor.py | 29 | # Copyright (C) 2014 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... |
19kestier/taiga-back | refs/heads/master | taiga/export_import/permissions.py | 21 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the F... |
Alberto-Beralix/Beralix | refs/heads/master | i386-squashfs-root/usr/share/apport/package-hooks/source_xserver-xorg-video-sis.py | 53 | source_xorg.py |
tiagofrepereira2012/tensorflow | refs/heads/master | tensorflow/python/framework/dtypes_test.py | 16 | # 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... |
jeffmahoney/supybot | refs/heads/urlsnarfer | plugins/Dunno/__init__.py | 15 | ###
# Copyright (c) 2003-2005, Daniel DiPaolo
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of cond... |
dims/nova | refs/heads/master | nova/api/openstack/compute/fping.py | 32 | # Copyright 2011 Grid Dynamics
# 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... |
hwmay/pordb3 | refs/heads/master | pypordb_suche_video.py | 1 | # -*- coding: utf-8 -*-
'''
Copyright 2012-2018 HWM
This file is part of PorDB3.
PorDB3 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 o... |
Nikea/VisTrails | refs/heads/master | vistrails/core/collection/workflow_exec.py | 2 | ###############################################################################
##
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary for... |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/loot/creature_loot/collections/space/engine_mark_05_kse.py | 85615 | import sys
def setup(core, object):
return |
uberamd/NGECore2 | refs/heads/master | scripts/object/draft_schematic/item/gcw_barricade_tool.py | 85615 | import sys
def setup(core, object):
return |
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/gcw/crafting_quest/gcw_tower_tool.py | 85615 | import sys
def setup(core, object):
return |
thozza/unbound | refs/heads/master | pythonmod/examples/calc.py | 24 | # -*- coding: utf-8 -*-
'''
calc.py: DNS-based calculator
Copyright (c) 2009, Zdenek Vasicek (vasicek AT fit.vutbr.cz)
Marek Vavrusa (xvavru00 AT stud.fit.vutbr.cz)
This software is open source.
Redistribution and use in source and binary forms, with or without
modification, are permitte... |
andrewyoung1991/abjad | refs/heads/master | abjad/tools/mathtools/all_are_positive_integers.py | 2 | # -*- encoding: utf-8 -*-
def all_are_positive_integers(expr):
'''Is true when `expr` is a sequence and all elements in `expr`
are positive integers.
::
>>> mathtools.all_are_positive_integers([1, 2, 3, 99])
True
Otherwise false:
::
>>> mathtools.all_are_positive_inte... |
sinhrks/scikit-learn | refs/heads/master | sklearn/decomposition/tests/test_online_lda.py | 5 | import numpy as np
from scipy.linalg import block_diag
from scipy.sparse import csr_matrix
from scipy.special import psi
from sklearn.decomposition import LatentDirichletAllocation
from sklearn.decomposition._online_lda import (_dirichlet_expectation_1d,
_dirichlet_expect... |
googleapis/googleapis-gen | refs/heads/master | google/ads/googleads/v6/googleads-py/google/ads/googleads/v6/enums/types/ad_customizer_placeholder_field.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... |
alexmullins/GoSublime | refs/heads/master | something_borrowed/diff_match_patch/python3/__init__.py | 636 | from .diff_match_patch import diff_match_patch, patch_obj
|
michalliu/OpenWrt-Firefly-Libraries | refs/heads/master | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/test/test_asyncio/test_streams.py | 14 | """Tests for streams.py."""
import gc
import os
import socket
import sys
import unittest
from unittest import mock
try:
import ssl
except ImportError:
ssl = None
import asyncio
from asyncio import test_utils
class StreamReaderTests(test_utils.TestCase):
DATA = b'line1\nline2\nline3\n'
def setUp(se... |
Schwittleymani/ECO | refs/heads/master | src/python/modelbuilder/doc2vec_builder.py | 2 | import gensim
# used for loading or saving
model_file = '/home/ramin/projects/ECO/src/python/modelbuilder/parsed_v3_valid.doc2vec'
# Build sentence list (each sentence needs at least 1 tag)
filename = '/home/marcel/drive/data/eco/NAIL_DATAFIELD_txt/parsed_v3/parsed_v3_valid.txt'
sentences = []
from random import shu... |
TheTypoMaster/chromium-crosswalk | refs/heads/master | build/android/pylib/utils/json_results_generator_unittest.py | 87 | # 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.
#
# Most of this file was ported over from Blink's
# webkitpy/layout_tests/layout_package/json_results_generator_unittest.py
#
import unittest
import json
... |
PainNarrativesLab/TwitterDataAnalysis | refs/heads/master | tests/test_TweetDAOs.py | 1 | __author__ = 'ars62917'
import unittest
import sqlalchemy
import TweetDAOs
class ConnectionMock(TweetDAOs.Connection):
def _make_engine(self):
pass
def __init__(self, credential_file):
self.engine = None
super().__init__(credential_file)
class ConnectionTest(unittest.TestCase):
d... |
DailyActie/Surrogate-Model | refs/heads/master | 01-codes/deap-master/doc/code/benchmarks/h1.py | 1 | import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.colors import LogNorm
from mpl_toolkits.mplot3d import Axes3D
try:
import numpy as np
except:
exit()
from deap import benchmarks
def h1_arg0(sol):
return benchmarks.h1(sol)[0]
fig = plt.figure()
# ax = Axes3D(fig, azim = -29, el... |
mazz/kifu | refs/heads/master | kifu.py | 1 | #!/usr/bin/env python
import os
import sys
import shutil
import subprocess
from optparse import OptionParser
import yaml
import logging
from sys import platform as _platform
k_appname = 'kifu'
logger = logging.getLogger(k_appname)
logger.setLevel(logging.INFO)
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
fo... |
exa-analytics/atomic | refs/heads/master | exatomic/algorithms/pcf.py | 2 | # -*- coding: utf-8 -*-
# Copyright (c) 2015-2020, Exa Analytics Development Team
# Distributed under the terms of the Apache License 2.0
"""
Pair Correlation Functions
############################
"""
import numpy as np
import pandas as pd
from IPython.display import display
from ipywidgets import FloatProgr... |
ccellis/WHACK2016 | refs/heads/master | flask/lib/python2.7/site-packages/sqlalchemy/engine/threadlocal.py | 55 | # engine/threadlocal.py
# Copyright (C) 2005-2016 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
"""Provides a thread-local transactional wrapper around the root Engine class.... |
TOCyna/tabelinha | refs/heads/master | flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py | 216 | '''SSL with SNI_-support for Python 2.
This needs the following packages installed:
* pyOpenSSL (tested with 0.13)
* ndg-httpsclient (tested with 0.3.2)
* pyasn1 (tested with 0.1.6)
To activate it call :func:`~urllib3.contrib.pyopenssl.inject_into_urllib3`.
This can be done in a ``sitecustomize`` module, or at any o... |
fish-ball/wx.easecloud.cn | refs/heads/master | core/migrations/0002_wechatuser_subscribe.py | 1 | # Generated by Django 2.2.1 on 2019-06-13 09:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='wechatuser',
name='subscribe',
... |
dchabot/python-pcaspy | refs/heads/master | pcaspy/driver.py | 4 | import cas
import threading
import time
import sys
import logging
if sys.hexversion >= 0x02070000:
from logging import NullHandler
else:
class NullHandler(logging.Handler):
def emit(self, record):
pass
logging.getLogger('pcaspy').addHandler(NullHandler())
from alarm import Severity, Alarm
... |
ales-erjavec/orange | refs/heads/master | docs/reference/rst/code/outlier1.py | 6 | import Orange
bridges = Orange.data.Table("bridges")
outlierDet = Orange.data.outliers.OutlierDetection()
outlierDet.set_examples(bridges)
print ", ".join("%.8f" % val for val in outlierDet.z_values())
|
reinecke/marty | refs/heads/main | marty/app.py | 1 | from flask import Flask
from flask import abort
from flask import render_template
from flask import session
from flask import request
from flask import redirect
from flask import url_for
from flask import Response
from crossdomain import crossdomain
import json
import requests
import urlparse
import shlex
import conf... |
jart/tensorflow | refs/heads/master | tensorflow/contrib/autograph/converters/lists.py | 5 | # 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... |
waseem18/oh-mainline | refs/heads/master | vendor/packages/PyYaml/lib/yaml/tokens.py | 986 |
class Token(object):
def __init__(self, start_mark, end_mark):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [key for key in self.__dict__
if not key.endswith('_mark')]
attributes.sort()
arguments = ', '.join(['%s=... |
loserxc/huhamhire-hosts | refs/heads/master | gui/hostsutil.py | 24 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# hostsutil.py : Main entrance to GUI module of Hosts Setup Utility.
#
# Copyleft (C) 2014 - huhamhire hosts team <hosts@huhamhire.com>
# =====================================================================
# Licensed under the GNU General Public License, version 3. You... |
kronicz/ecommerce-2 | refs/heads/master | lib/python2.7/site-packages/django/utils/timesince.py | 109 | from __future__ import unicode_literals
import datetime
from django.utils.html import avoid_wrapping
from django.utils.timezone import is_aware, utc
from django.utils.translation import ugettext, ungettext_lazy
TIMESINCE_CHUNKS = (
(60 * 60 * 24 * 365, ungettext_lazy('%d year', '%d years')),
(60 * 60 * 24 * ... |
tiagoprn/experiments | refs/heads/master | flask/api_exposing_database_as_rest_with_jsonapi/app/__init__.py | 1 | from flask import Flask, Response
from flask.ext.sqlalchemy import SQLAlchemy
db = SQLAlchemy()
class MyResponse(Response):
default_mimetype = 'application/json'
# http://flask.pocoo.org/docs/0.10/patterns/appfactories/
def create_app(config_filename):
app = Flask(__name__)
app.config.from_object(confi... |
pitsios-s/PyNaiveBayes | refs/heads/master | src/ClassifierEvaluator.py | 1 | #!/usr/bin/python3
from NaiveBayesClassifier import NaiveBayesClassifier
from os import listdir
class ClassifierEvaluator:
def __init__(self, nbc):
#The naive bayes classifier object.
self.nbc = nbc
self.number_of_messages_tested = 0
self.true_positives = 0
self.true... |
DnBHeaven/django-watermark | refs/heads/master | setup.py | 10 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import watermarker
setup(
name='django-watermark',
version=watermarker.version(),
description="Quick and efficient way to apply watermarks to images in Django.",
long_description=open('README.rst', 'r').read(),
... |
yhe39/crosswalk-test-suite | refs/heads/master | webapi/tct-webaudio-w3c-tests/inst.apk.py | 1996 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
ADB_CMD = "adb"
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool... |
satra/NiPypeold | refs/heads/master | examples/fsl_resting.py | 1 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
A pipeline example that uses intergrates several interfaces to
perform a first and second level analysis on a two-subject data
set.
"""
"""
1. Tell python where to find the appropriate functi... |
henn/haas | refs/heads/master | haas/model.py | 2 | # Copyright 2013-2015 Massachusetts Open Cloud Contributors
#
# 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... |
aouerfelli/SuperDD-Python | refs/heads/master | Levels.py | 1 | from res import RoomRegular, Door, MovingBlock, Spear#, Crate
class LevelOne(RoomRegular):
def __init__(self):
super().__init__("./assets/images/Room/", (700, 500))
self.edgePadding = 50
self.setBackdrop()
# Hero falls from ceiling for first level
self.init... |
hehongliang/tensorflow | refs/heads/master | tensorflow/python/keras/optimizer_v2/adagrad_test.py | 1 | # 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... |
ddcc/binaryen | refs/heads/master | scripts/storage.py | 2 | #! /usr/bin/env python
# Copyright 2016 WebAssembly Community Group participants
#
# 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
... |
achang97/YouTunes | refs/heads/master | lib/python2.7/site-packages/youtube_dl/extractor/rentv.py | 37 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
class RENTVIE(InfoExtractor):
_VALID_URL = r'(?:rentv:|https?://(?:www\.)?ren\.tv/(?:player|video/epizod)/)(?P<id>\d+)'
_TESTS = [{
'url': 'http://ren.tv/video/epizod/118577',
... |
azumimuo/family-xbmc-addon | refs/heads/master | plugin.video.wolfpack/resources/lib/sources/ddls_tv.py | 6 | # -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 l... |
dvitme/odoo-addons | refs/heads/8.0 | account_tax_settlement_withholding/models/__init__.py | 7 | # -*- coding: utf-8 -*-
import account_voucher_withholding
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
mhils/readthedocs.org | refs/heads/master | readthedocs/core/management/commands/symlink.py | 27 | import logging
from django.core.management.base import BaseCommand
from django.conf import settings
from readthedocs.projects import tasks, utils
import redis
log = logging.getLogger(__name__)
class Command(BaseCommand):
def handle(self, *args, **options):
if len(args):
if args[0] == "cnam... |
mzszym/oedes | refs/heads/master | oedes/optical/spectra/astmg173.py | 1 | # -*- coding: utf-8; -*-
#
# oedes - organic electronic device simulator
# Copyright (C) 2017-2018 Marek Zdzislaw Szymanski (marek@marekszymanski.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License, version 3,
# as published by the ... |
socaa/kubernetes | refs/heads/master | cluster/juju/charms/trusty/kubernetes-master/hooks/hooks.py | 52 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... |
elkingtonmcb/django | refs/heads/master | django/conf/locale/ko/formats.py | 404 | # -*- 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 = 'Y년 n월 j일'
TIME_FORMAT = 'A g:i'
D... |
pioneers/forseti2 | refs/heads/2017 | src/firmata_test.py | 2 | # -*- coding: utf-8 -*-
import time
from pyfirmata import ArduinoMega, util
import pyfirmata
board = ArduinoMega('/dev/ttyUSB0')
RED=0
ORANGE=1
GREEN=2
SERVO=3
combinations = []
combinations.append((22, 23, 24, 2))
combinations.append((25, 26, 27, 3))
combinations.append((28, 29, 30, 4))
combinations.append((31, 32... |
BrainIntensive/OnlineBrainIntensive | refs/heads/master | resources/HCP/hcp_corr/hcp_corr/corr_faster.py | 1 | import warnings
import numpy as np
from scipy.linalg import get_blas_funcs
from csv import reader as csv_reader
def corrcoef_upper(X):
"""
.....numpy.corrcoef 1.9.1 adapted for mem-usage optimization....
X : numpy 2D array, MxN
Correlation coefficients of a given matris is row-wise calcul... |
daltonmatos/wsgid | refs/heads/develop | wsgid/core/message.py | 1 | #encoding: utf-8
import json
HEADER_UPLOAD_START = 'x-mongrel2-upload-start'
HEADER_UPLOAD_DONE = 'x-mongrel2-upload-done'
class Message(object):
"""
Represents a mongrel2 raw message
Here we have:
* server_id: The ID of the server that sent us this message
* client_id: The id of the ... |
ndp-systemes/odoo-addons | refs/heads/8.0 | purchase_procurement_just_in_time/models/wizard.py | 1 | # -*- coding: utf8 -*-
#
# Copyright (C) 2016 NDP Systèmes (<http://www.ndp-systemes.fr>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# Licen... |
Dapid/scipy | refs/heads/master | scipy/weave/tests/test_standard_array_spec.py | 96 | from __future__ import absolute_import, print_function
from numpy import arange
from numpy.testing import TestCase, assert_, run_module_suite
from scipy.weave import standard_array_spec
class TestArrayConverter(TestCase):
def test_type_match_string(self):
s = standard_array_spec.array_converter()
... |
boundarydevices/android_external_chromium_org | refs/heads/cm-12.0 | build/android/pylib/device_settings.py | 8 | # 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 logging
from pylib import content_settings
def ConfigureContentSettingsDict(device, desired_settings):
"""Configures device content setings from ... |
shsingh/ansible | refs/heads/devel | lib/ansible/modules/network/aci/mso_schema_site_anp_epg_staticleaf.py | 13 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Dag Wieers (@dagwieers) <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_ve... |
MichaelNedzelsky/intellij-community | refs/heads/master | python/testData/refactoring/move/starImportWithUsages/after/src/a.py | 83 | from c import f
print(f()) |
8l/beri | refs/heads/master | cheritest/trunk/tests/mem/test_lldscd.py | 2 | #-
# Copyright (c) 2011 Robert N. M. Watson
# All rights reserved.
#
# This software was developed by SRI International and the University of
# Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
# ("CTSRD"), as part of the DARPA CRASH research programme.
#
# @BERI_LICENSE_HEADER_START@
#
# License... |
ltilve/ChromiumGStreamerBackend | refs/heads/master | chrome/common/extensions/docs/server2/content_providers.py | 36 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import traceback
from chroot_file_system import ChrootFileSystem
from content_provider import ContentProvider
import environment
fr... |
dims/neutron | refs/heads/master | neutron/db/migration/alembic_migrations/versions/mitaka/expand/dce3ec7a25c9_router_az.py | 11 | #
# 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
# ... |
Nick-OpusVL/odoo | refs/heads/8.0 | addons/mrp_operations/__init__.py | 443 | # -*- 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... |
hsnlab/escape | refs/heads/master | pox/pox/openflow/libopenflow_01.py | 4 | # Copyright 2011,2012 James McCauley
#
# 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 ... |
eickenberg/scikit-learn | refs/heads/master | sklearn/tree/setup.py | 175 | import os
import numpy
from numpy.distutils.misc_util import Configuration
def configuration(parent_package="", top_path=None):
config = Configuration("tree", parent_package, top_path)
libraries = []
if os.name == 'posix':
libraries.append('m')
config.add_extension("_tree",
... |
devs1991/test_edx_docmode | refs/heads/master | venv/lib/python2.7/site-packages/Crypto/SelfTest/PublicKey/test_DSA.py | 118 | # -*- coding: utf-8 -*-
#
# SelfTest/PublicKey/test_DSA.py: Self-test for the DSA primitive
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedic... |
Nic30/hwtLib | refs/heads/master | hwtLib/amba/sim/__init__.py | 1 | """
This package is dedicated for simulation utilities for AMBA interfaces.
""" |
bobsilverberg/moztrap | refs/heads/master | moztrap/deploy/wsgi.py | 5 | """WSGI entry-point for MozTrap."""
import os
import sys
base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, base_dir)
# Set default settings and instantiate application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "moztrap.settings.default")
from django.core.handlers.wsgi ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.