repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
stevehof/CouchPotatoServer | refs/heads/master | libs/synchronousdeluge/transfer.py | 36 | import zlib
import struct
import socket
import ssl
from synchronousdeluge import rencode
__all__ = ["DelugeTransfer"]
class DelugeTransfer(object):
def __init__(self):
self.sock = None
self.conn = None
self.connected = False
def connect(self, hostport):
if self.connected:
... |
jagg81/translate-toolkit | refs/heads/master | translate/misc/test_quote.py | 4 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from translate.misc import quote
def test_find_all():
"""tests the find_all function"""
assert quote.find_all("", "a") == []
assert quote.find_all("a", "b") == []
assert quote.find_all("a", "a") == [0]
assert quote.find_all("aa", "a") == [0, 1]
as... |
oliver-sanders/cylc | refs/heads/master | cylc/flow/scripts/cylc_insert.py | 1 | #!/usr/bin/env python3
# THIS FILE IS PART OF THE CYLC SUITE ENGINE.
# Copyright (C) 2008-2019 NIWA & British Crown (Met Office) & Contributors.
#
# 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... |
MiniSEC/GRR_clone | refs/heads/master | lib/flow_utils_test.py | 1 | #!/usr/bin/env python
# Copyright 2011 Google Inc. All Rights Reserved.
"""Tests for flow utils classes."""
# pylint: disable=unused-import,g-bad-import-order
from grr.lib import server_plugins
# pylint: enable=unused-import,g-bad-import-order
from grr.lib import aff4
from grr.lib import flags
from grr.lib import f... |
s0lst1c3/eaphammer | refs/heads/master | local/hostapd-eaphammer/tests/hwsim/test_wext.py | 1 | # Deprecated WEXT driver interface in wpa_supplicant
# Copyright (c) 2013-2015, Jouni Malinen <[email protected]>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import logging
logger = logging.getLogger()
import os
import hostapd
import hwsim_utils
from wpasupplicant imp... |
consulo/consulo-python | refs/heads/master | plugin/src/test/resources/intentions/beforeTypeInDocstringParameterInCallable.py | 83 | def g(hello=None):
print(he<caret>llo)
|
ovnicraft/openerp-restaurant | refs/heads/master | l10n_ve/__openerp__.py | 119 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
##############################################################################
# Modu... |
FibercorpLabs/FibercorpDevops | refs/heads/master | napalm/tn.py | 1 | from __future__ import print_function
from netmiko import ConnectHandler
import sys
import os
import argparse
import getpass
import time
def main():
parser = argparse.ArgumentParser(description='Configure Loop Protection')
parser.add_argument('-u', '--user', help='User', required=True)
parser.add_argume... |
tempbottle/Rusthon | refs/heads/master | regtests/bench/mandelbrot.py | 9 | """mandelbrot benchmark"""
from time import time
def pprint(arr, w):
x = []
for a in arr:
x.append(a)
if len(x) >= w:
print( [ round(y,2) for y in x] )
x = []
def mandelbrot_numpy(size=512, exit_limit=100):
img_array = numpy.zeros([size, size], int)
for y in range(size):
for x in range(size):
c ... |
ptressel/sahana-eden-madpub | refs/heads/master | modules/pygsm/message/incoming.py | 65 | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import datetime
import pytz
class IncomingMessage(object):
def __init__(self, device, sender, sent, text):
# move the arguments into "private" attrs,
# to try to prevent from from being modified
self._device = device
self._sende... |
tomvanderlee/minesweeper-py | refs/heads/master | minesweeper/cell.py | 1 | from random import randint
class Cell:
def __init__(self, chance):
self._value = None
if randint(0, 99) < chance:
self.is_mine = True
else:
self.is_mine = False
self.covered = True
self.cover = '#'
@property
def value(self):
return... |
LyzardKing/ubuntu-make | refs/heads/master | tests/large/test_rust.py | 6 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2015 Canonical
#
# Authors:
# Didier Roche
# Tin Tvrtković
# Jared Ravetch
#
# 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; version 3.
#
# This p... |
alkyl1978/gnuradio | refs/heads/master | gr-wxgui/python/wxgui/powermate.py | 76 | #!/usr/bin/env python
#
# Copyright 2005 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... |
andreimatei/congratboto | refs/heads/master | app_engine/third_party/bs4/builder/_html5lib.py | 423 | __all__ = [
'HTML5TreeBuilder',
]
import warnings
from bs4.builder import (
PERMISSIVE,
HTML,
HTML_5,
HTMLTreeBuilder,
)
from bs4.element import NamespacedAttribute
import html5lib
from html5lib.constants import namespaces
from bs4.element import (
Comment,
Doctype,
NavigableStr... |
teyrana/annum | refs/heads/master | src/model/resource.py | 1 |
# resource.py
class Resource :
""" defines any Resource"""
id_num
name_str
descr_str
|
VielSoft/odoo | refs/heads/8.0 | addons/website_mail/controllers/main.py | 149 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
inspirehep/invenio | refs/heads/prod | modules/bibformat/lib/elements/bfe_video_sources.py | 28 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio 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
## ... |
willprice/arduino-sphere-project | refs/heads/master | scripts/example_direction_finder/temboo/Library/Google/ComputeEngine/Disks/CreateSnapshot.py | 5 | # -*- coding: utf-8 -*-
###############################################################################
#
# CreateSnapshot
# Creates a snapshot of a specified disk.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use th... |
platinummonkey/TAMULUG-Website | refs/heads/master | tamulug/accounts/forms.py | 1 | from django.forms import *
from django.forms.widgets import *
from models import UserProfile
from django.contrib.auth.models import User
import datetime
|
QWalk/mainline | refs/heads/master | utils/autogen/crystal2qmc.py | 3 | from __future__ import division,print_function
import numpy as np
import sys
def error(message,errortype):
print(message)
exit(errortype)
periodic_table = [
"h","he","li","be","b","c","n","o","f","ne","na","mg","al","si","p","s","cl","ar",
"k","ca","sc","ti","v","cr","mn","fe","co","ni","cu","zn","ga","ge","a... |
palashahuja/myhdl | refs/heads/master | myhdl/test/conversion/toVHDL/test_custom.py | 3 | import os
path = os.path
import random
from random import randrange
random.seed(2)
from myhdl import *
from myhdl import ConversionError
from myhdl.conversion._misc import _error
ACTIVE_LOW, INACTIVE_HIGH = 0, 1
def incRef(count, enable, clock, reset, n):
""" Incrementer with enable.
count -- output
... |
zephyrproject-rtos/zephyr | refs/heads/main | scripts/support/quartus-flash.py | 6 | #!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
import subprocess
import tempfile
import argparse
import os
import string
import sys
quartus_cpf_template = """<?xml version="1.0" encoding="US-ASCII" standalone="yes"?>
<cof>
<output_filename>${OUTPUT_FILENAME}</output_filename>
<n_pages>1</n_pages>
<wi... |
tboyce021/home-assistant | refs/heads/dev | tests/components/deconz/test_scene.py | 6 | """deCONZ scene platform tests."""
from copy import deepcopy
from homeassistant.components.deconz import DOMAIN as DECONZ_DOMAIN
from homeassistant.components.deconz.gateway import get_gateway_from_config_entry
from homeassistant.components.scene import DOMAIN as SCENE_DOMAIN, SERVICE_TURN_ON
from homeassistant.const... |
mateusz-blaszkowski/PerfKitBenchmarker | refs/heads/master | perfkitbenchmarker/providers/digitalocean/__init__.py | 8 | # Copyright 2015 PerfKitBenchmarker 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... |
Big-B702/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/test/test_augassign.py | 169 | # Augmented assignment test.
from test.support import run_unittest
import unittest
class AugAssignTest(unittest.TestCase):
def testBasic(self):
x = 2
x += 1
x *= 2
x **= 2
x -= 8
x //= 5
x %= 3
x &= 2
x |= 5
x ^= 1
x /= 2
... |
greggy/pylessons | refs/heads/master | lesson12.py | 1 | # -*- coding: utf-8 -*-
a = [i ** 2 for i in range(1, 9)]
#print(a)
b = [i for i in range(-9, 9) if i <= 0]
#print(b)
c = [(i, j, k) for i in range(1, 5)
for j in range(1, 5)
for k in range(1, 5)]
#print(c)
def sqr(l):
for i in l:
yield i ** 2
#print(sqr(range(1, 9)))
#print(list(sqr(rang... |
cdcapano/pycbc | refs/heads/master | examples/overlap.py | 4 | from pycbc.waveform import get_td_waveform
from pycbc.filter import match, overlap
from pycbc.psd import aLIGOZeroDetHighPower
# Buffer size in seconds. This is presumed to be
# longer than the longest waveform.
time_buffer = 4
f_low = 30
sample_rate = 4096
# Length of corresponding time series and frequency series
... |
tashaxe/Red-DiscordBot | refs/heads/develop | lib/future/moves/xmlrpc/client.py | 84 | from __future__ import absolute_import
from future.utils import PY3
if PY3:
from xmlrpc.client import *
else:
from xmlrpclib import *
|
Eric-Gaudiello/tensorflow_dev | refs/heads/master | tensorflow_home/tensorflow_venv/lib/python3.4/site-packages/numpy/polynomial/legendre.py | 75 | """
Legendre Series (:mod: `numpy.polynomial.legendre`)
===================================================
.. currentmodule:: numpy.polynomial.polynomial
This module provides a number of objects (mostly functions) useful for
dealing with Legendre series, including a `Legendre` class that
encapsulates the usual arith... |
EDUlib/edx-platform | refs/heads/master | import_shims/studio/contentstore/rest_api/v1/tests/test_views.py | 2 | """Deprecated import support. Auto-generated by import_shims/generate_shims.sh."""
# pylint: disable=redefined-builtin,wrong-import-position,wildcard-import,useless-suppression,line-too-long
from import_shims.warn import warn_deprecated_import
warn_deprecated_import('contentstore.rest_api.v1.tests.test_views', 'cms.d... |
bstroebl/QGIS | refs/heads/master | python/plugins/sextante/parameters/ParameterString.py | 1 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ParameterString.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***********************... |
sogelink/ansible | refs/heads/devel | lib/ansible/cli/__init__.py | 6 | # (c) 2012-2014, Michael DeHaan <[email protected]>
# (c) 2016, Toshio Kuratomi <[email protected]>
#
# 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, eithe... |
gareging/SDN_Framework | refs/heads/master | ryu/tests/unit/packet/test_sctp.py | 27 | # 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 applicab... |
zenoss/ZenPacks.community.DellSNMPTransforms | refs/heads/master | ZenPacks/community/DellSNMPTransforms/migrate/__init__.py | 1165 | # __init__.py
|
samba-team/samba | refs/heads/master | python/samba/gp_parse/__init__.py | 2 | # GPO Parser for generic extensions
#
# Copyright (C) Andrew Bartlett <[email protected]> 2018
# Written by Garming Sam <[email protected]>
#
# 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 Foundatio... |
dreamwalker/hunt | refs/heads/master | hunt/hunt.py | 1 | # -*- coding: utf-8 -*-
"""Main command module for Hunt."""
def main():
"""Main execute function."""
pass
|
AutorestCI/azure-sdk-for-python | refs/heads/master | azure-mgmt-network/azure_bdist_wheel.py | 241 | """
"wheel" copyright (c) 2012-2017 Daniel Holth <[email protected]> and
contributors.
The MIT License
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 limi... |
mcianfrocco/Optimal-cryoEM-imaging-of-Nanogold | refs/heads/master | calculate_intensity_vs_defocus.py | 1 | #!/usr/bin/env python
import optparse
from sys import *
import os,sys,re
from optparse import OptionParser
import glob
import subprocess
from os import system
import linecache
import time
import shutil
#=========================
def setupParserOptions():
parser = optparse.OptionParser()
parser.set_us... |
enclose-io/compiler | refs/heads/master | lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py | 4 | # Copyright (c) 2013 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.
"""cmake output module
This module is under development and should be considered experimental.
This module produces cmake (2.8.8+) input as its output. One CMake... |
hmen89/odoo | refs/heads/master | addons/sale_mrp/__init__.py | 445 | # -*- 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... |
mrquim/repository.mrquim | refs/heads/master | repo/script.extendedinfo/resources/lib/dialogs/DialogMovieInfo.py | 5 | # -*- coding: utf8 -*-
# Copyright (C) 2015 - Philipp Temminghoff <[email protected]>
# This program is Free Software see LICENSE file for details
import threading
import xbmc
import xbmcgui
from resources.lib import TheMovieDB as tmdb
from resources.lib import omdb
from resources.lib.WindowManager import wm
from Dial... |
MIPS/external-chromium_org | refs/heads/dev-mips-jb-kitkat | third_party/protobuf/python/google/protobuf/message.py | 227 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... |
ptkool/spark | refs/heads/master | python/pyspark/mllib/tests/test_algorithms.py | 21 | #
# 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... |
kanagasabapathi/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/sqlite3/test/regression.py | 46 | #-*- coding: ISO-8859-1 -*-
# pysqlite2/test/regression.py: pysqlite regression tests
#
# Copyright (C) 2006-2010 Gerhard Häring <[email protected]>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any dama... |
Carmezim/tensorflow | refs/heads/master | tensorflow/tensorboard/backend/event_processing/directory_watcher_test.py | 31 | # 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... |
matteogrolla/solr_load_test | refs/heads/master | setup.py | 1 | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'Solr Load Test',
'author': 'Matteo Grolla',
'url': 'URL to get it at.',
'download_url': 'Where to download it.',
'author_email': 'My email.',
'version': '0.1',
'install_... |
andresriancho/django-tastypie | refs/heads/master | tastypie/management/commands/backfill_api_keys.py | 20 | from __future__ import print_function
from __future__ import unicode_literals
from django.core.management.base import NoArgsCommand
from tastypie.compat import get_user_model
from tastypie.models import ApiKey
class Command(NoArgsCommand):
help = "Goes through all users and adds API keys for any that don't have o... |
MER-GROUP/intellij-community | refs/heads/master | python/testData/intentions/PyConvertCollectionLiteralIntentionTest/convertSetToList_after.py | 234 | xs = [1, 2] |
feigames/Odoo | refs/heads/master | addons/l10n_fr_rib/__openerp__.py | 425 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Numérigraphe SARL.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Genera... |
Venturi/cms | refs/heads/master | env/lib/python2.7/site-packages/html5lib/treewalkers/genshistream.py | 1730 | from __future__ import absolute_import, division, unicode_literals
from genshi.core import QName
from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT
from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT
from . import _base
from ..constants import voidElements, namespaces
class ... |
allotria/intellij-community | refs/heads/master | python/testData/testRunner/env/pytest/rerun/test_subsystems.py | 15 | from .base_test import BaseTest
class TestFoo(BaseTest):
__test__ = True
def system_under_test(self):
return 'foo'
class TestBar(BaseTest):
__test__ = True
def system_under_test(self):
return 'bar' |
tarzan0820/odoo | refs/heads/8.0 | addons/base_report_designer/plugin/openerp_report_designer/bin/script/compile_all.py | 384 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer [email protected]
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... |
mstriemer/olympia | refs/heads/master | src/olympia/migrations/620-add-mobile-profile.py | 16 | def run():
# Obsolete Marketplace migration that relied on a model since removed.
pass
|
hayderimran7/ec2-api | refs/heads/master | ec2api/api/opts.py | 4 | # 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... |
jabesq/home-assistant | refs/heads/dev | homeassistant/components/lacrosse/sensor.py | 7 | """Support for LaCrosse sensor components."""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.sensor import ENTITY_ID_FORMAT, PLATFORM_SCHEMA
from homeassistant.const import (
CONF_DEVICE, CONF_ID, CONF_NAME, CONF_SENSORS, CONF_TYPE,
EVENT_HOMEASSISTANT_STO... |
b3c/VTK-5.8 | refs/heads/master | Examples/Infovis/Python/labels.py | 8 |
import random
from vtk import *
n = 10000
qinit = vtkQtInitialization()
pd = vtkPolyData()
pts = vtkPoints()
verts = vtkCellArray()
orient = vtkDoubleArray()
orient.SetName('orientation')
label = vtkStringArray()
label.SetName('label')
for i in range(n):
pts.InsertNextPoint(random.random(), random.random(), rando... |
rambo/asylum | refs/heads/master | project/creditor/handlers.py | 4 | # -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
from .models import Transaction
class AbstractTransaction(models.Model):
stamp = models.DateTimeField(_("Datetime"), blank=False)
name = models.CharField(_("Name"), max_length=200, blank=False)
em... |
zakuro9715/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/django/template/loaders/eggs.py | 65 | # Wrapper for loading templates from eggs via pkg_resources.resource_string.
try:
from pkg_resources import resource_string
except ImportError:
resource_string = None
from django.template import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.conf import settings
class Loader(B... |
kangfend/django | refs/heads/master | django/db/models/fields/subclassing.py | 111 | """
Convenience routines for creating non-trivial Field subclasses, as well as
backwards compatibility utilities.
Add SubfieldBase as the metaclass for your Field subclass, implement
to_python() and the other necessary methods and everything will work
seamlessly.
"""
import warnings
from django.utils.deprecation imp... |
bols-blue/ansible | refs/heads/devel | lib/ansible/parsing/yaml/__init__.py | 7690 | # (c) 2012-2014, Michael DeHaan <[email protected]>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
MungoRae/home-assistant | refs/heads/dev | homeassistant/components/sensor/eddystone_temperature.py | 8 | """
Read temperature information from Eddystone beacons.
Your beacons must be configured to transmit UID (for identification) and TLM
(for temperature) frames.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.eddystone_temperature/
"""
import loggi... |
freedesktop-unofficial-mirror/telepathy__telepathy-salut | refs/heads/master | tests/twisted/avahi/caps-self.py | 1 | """
Basic test of SetSelfCapabilities on interface
org.freedesktop.Telepathy.Connection.Interface.ContactCapabilities
"""
from saluttest import exec_test
from avahitest import AvahiAnnouncer, AvahiListener
from avahitest import get_host_name
from avahitest import txt_get_key
import avahi
from xmppstream import setup_... |
yencarnacion/jaikuengine | refs/heads/master | .google_appengine/lib/django-1.3/tests/modeltests/reverse_lookup/tests.py | 92 | from django.test import TestCase
from django.core.exceptions import FieldError
from models import User, Poll, Choice
class ReverseLookupTests(TestCase):
def setUp(self):
john = User.objects.create(name="John Doe")
jim = User.objects.create(name="Jim Bo")
first_poll = Poll.objects.create(
... |
rbrito/pkg-youtube-dl | refs/heads/master | youtube_dl/extractor/izlesene.py | 24 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urllib_parse_unquote,
)
from ..utils import (
determine_ext,
float_or_none,
get_element_by_id,
int_or_none,
parse_iso8601,
str_to_int,
)
class IzleseneIE... |
mwaskom/moss | refs/heads/master | moss/eyelink.py | 1 | from __future__ import division
import os
import re
import subprocess
import tempfile
import shutil
import numpy as np
import pandas as pd
from scipy.ndimage import gaussian_filter1d
class EyeData(object):
def __init__(self, fname):
self.settings = dict(PRESCALER=None,
VPRE... |
BuildingLink/sentry | refs/heads/master | src/sentry/utils/raven.py | 5 | from __future__ import absolute_import, print_function
import copy
import inspect
import logging
import raven
import sentry
from django.conf import settings
from django.db.utils import DatabaseError
from raven.contrib.django.client import DjangoClient
from . import metrics
UNSAFE_FILES = (
'sentry/event_manager... |
mafiagame/CocosBuilder | refs/heads/master | CocosBuilder/libs/nodejs/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py | 2779 | # 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.
"""gypsh output module
gypsh is a GYP shell. It's not really a generator per se. All it does is
fire up an interactive Python session with a few local variables... |
JeyZeta/Dangerous | refs/heads/master | Dangerous/Golismero/thirdparty_libs/nltk/tokenize/simple.py | 17 | # Natural Language Toolkit: Simple Tokenizers
#
# Copyright (C) 2001-2012 NLTK Project
# Author: Edward Loper <[email protected]>
# Steven Bird <[email protected]>
# URL: <http://nltk.sourceforge.net>
# For license information, see LICENSE.TXT
r"""
Simple Tokenizers
These tokenizers divide s... |
sambyers/o365_fmc | refs/heads/master | .venv/lib/python3.6/site-packages/pip/_vendor/requests/packages/chardet/sjisprober.py | 1776 | ######################## 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... |
amirrpp/django-oscar | refs/heads/master | src/oscar/apps/offer/reports.py | 22 | import datetime
from decimal import Decimal as D
from django.utils.translation import ugettext_lazy as _
from oscar.core.loading import get_model, get_class
ReportGenerator = get_class('dashboard.reports.reports', 'ReportGenerator')
ReportCSVFormatter = get_class('dashboard.reports.reports',
... |
ldoktor/autotest | refs/heads/master | client/package.py | 3 | """
Functions to handle software packages. The functions covered here aim to be
generic, with implementations that deal with different package managers, such
as dpkg and rpm.
"""
__author__ = '[email protected] (Lucas Meneghel Rodrigues)'
import os, re, logging
from autotest.client import os_dep, utils
from autotest... |
xenomachina/i3ipc-python | refs/heads/master | setup.py | 1 | from setuptools import setup
from os import path
readme_path = path.join(path.abspath(path.dirname(__file__)), 'README.rst')
long_description = open(readme_path).read()
install_requires = ['enum-compat']
setup(
name='i3ipc',
version='1.2.0',
description='An improved Python library for i3wm extensions',
... |
abhikumar22/MYBLOG | refs/heads/master | blg/Lib/encodings/cp852.py | 272 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP852.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'):
... |
kianxineki/basicevents | refs/heads/master | basicevents.py | 1 | from __future__ import print_function
import threading
import traceback
from time import sleep
from multiprocessing import Queue, Process, cpu_count
import signal
class Events(object):
subs = {}
queue = Queue()
logger = print
@staticmethod
def _run_event(event, *args, **kwargs):
try:
... |
foursquare/pants | refs/heads/master | src/python/pants/init/subprocess.py | 2 | # coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import object
from pants.subsystem.subsystem import Subsystem
class Subp... |
AndrewGrossman/django | refs/heads/master | tests/i18n/contenttypes/tests.py | 367 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase, override_settings
from django.utils import six, translation
from django.utils._os import upath
@override_settings(
USE_I18N=True,
LOCALE_PATH... |
sugarsweetrobotics/wasanbon | refs/heads/master | wasanbon/core/plugins/admin/web_plugin/rpc/nameservice.py | 1 | import os, sys, traceback
import WSB
from plugin import *
class NameServicePlugin(PluginObject):
def __init__(self):
PluginObject.__init__(self, 'nameservice')
def activate_rtc(self, fullpath):
""" Activate RT-component
"""
self.debug('activate_rtc(%s)' % fullpath)
try:... |
parthz/djchat | refs/heads/master | core/models.py | 10644 | from django.db import models
# Create your models here.
|
leiferikb/bitpop | refs/heads/master | src/tools/telemetry/telemetry/core/backends/chrome/inspector_network_unittest.py | 2 | # 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.
from telemetry.core.backends.chrome import inspector_network
from telemetry.core.timeline import recording_options
from telemetry.unittest import tab_test_cas... |
danilito19/django | refs/heads/master | tests/file_uploads/models.py | 691 | from django.db import models
class FileModel(models.Model):
testfile = models.FileField(upload_to='test_upload')
|
DirkHoffmann/indico | refs/heads/master | indico/core/signals/event/registration.py | 3 | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from blinker import Namespace
_signals = Namespace()
registration_personal_data_modified = _signals.sig... |
frontendphil/analyzr | refs/heads/master | parsr/models.py | 1 | import numpy
from datetime import datetime, timedelta
from dateutil import parser
from hashlib import md5
from urllib import urlencode
from fractions import Fraction
from copy import copy
from django.db import models
from django.db.models import Count, Sum, Avg, Min, Max, Q
from django.db.models.signals import post_s... |
ericyue/mooncake_utils | refs/heads/master | mooncake_utils/retry/compat.py | 1 | import functools
import logging
try:
from decorator import decorator
except ImportError:
def decorator(caller):
""" Turns caller into a decorator.
Unlike decorator module, function signature is not preserved.
:param caller: caller(f, *args, **kwargs)
"""
def decor(f):
... |
minhphung171093/GreenERP_V9 | refs/heads/master | openerp/addons/account/tests/test_account_supplier_invoice.py | 32 | from openerp.addons.account.tests.account_test_classes import AccountingTestCase
from openerp.exceptions import Warning
class TestAccountSupplierInvoice(AccountingTestCase):
def test_supplier_invoice(self):
tax = self.env['account.tax'].create({
'name': 'Tax 10.0',
'amount': 10.0,
... |
tima/ansible | refs/heads/devel | lib/ansible/plugins/action/ios_config.py | 13 | #
# (c) 2017, 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... |
nagyistoce/geokey | refs/heads/master | geokey/users/tests/test_templatetags.py | 1 | from django.test import TestCase
from geokey.categories.tests.model_factories import CategoryFactory
from ..templatetags import filter_tags
class TemplateTagsTest(TestCase):
def test_show_restrict(self):
category = CategoryFactory.create()
self.assertEqual(
filter_tags.show_restrict(... |
arabenjamin/scikit-learn | refs/heads/master | sklearn/linear_model/tests/test_sgd.py | 129 | import pickle
import unittest
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing ... |
paulrouget/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/h2/test/test_utility_functions.py | 25 | # -*- coding: utf-8 -*-
"""
test_utility_functions
~~~~~~~~~~~~~~~~~~~~~~
Tests for the various utility functions provided by hyper-h2.
"""
import pytest
import h2.config
import h2.connection
import h2.errors
import h2.events
import h2.exceptions
from h2.utilities import extract_method_header
# These tests require a... |
charbeljc/account-analytic | refs/heads/8.0 | account_analytic_required/__init__.py | 11 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Account analytic required module for OpenERP
# Copyright (C) 2011 Akretion (http://www.akretion.com). All Rights Reserved
# @author Alexis de Lattre <[email protected]>
#
# This program is... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/commands/combat/co_hw_dot_energy_1.py | 4 | import sys
def setup(core, actor, target, command):
command.setDotDuration(15)
command.setDotType('energy')
command.setDotIntensity(50)
return
def run(core, actor, target, commandString):
return
|
sebotic/WikidataIntegrator | refs/heads/main | wikidataintegrator/ref_handlers/test_update_retrieved_if_new.py | 2 |
#### same as before, but with one ref
import copy
from wikidataintegrator import wdi_fastrun, wdi_core
from wikidataintegrator.ref_handlers import update_retrieved_if_new as custom_ref_handler
import pprint
class frc_fake_query_data_paper1(wdi_fastrun.FastRunContainer):
def __init__(self, *args, **kwargs):
... |
deeponion/deeponion | refs/heads/master | contrib/devtools/check-doc.py | 13 | #!/usr/bin/env python
# Copyright (c) 2015-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
This checks if all command line args are documented.
Return value is 0 to indicate no error.
Author: ... |
Lab603/PicEncyclopedias | refs/heads/master | jni-build/jni/include/tensorflow/python/kernel_tests/atrous_conv2d_test.py | 3 | # 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... |
trishnaguha/ansible | refs/heads/devel | lib/ansible/modules/cloud/azure/azure_rm_sqlfirewallrule_facts.py | 22 | #!/usr/bin/python
#
# Copyright (c) 2017 Zim Kalinowski, <[email protected]>
#
# 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',
... |
cristiana214/cristianachavez214-cristianachavez | refs/heads/master | python/src/Lib/idlelib/testcode.py | 312 | import string
def f():
a = 0
b = 1
c = 2
d = 3
e = 4
g()
def g():
h()
def h():
i()
def i():
j()
def j():
k()
def k():
l()
l = lambda: test()
def test():
string.capwords(1)
f()
|
pfmoore/pip | refs/heads/main | tests/data/packages/pep517_wrapper_buildsys/setup.py | 163 | from setuptools import setup
setup()
|
kopringo/GenealogyViewer | refs/heads/master | GenealogyViewer/apps/web/tasks.py | 1 | from celery import shared_task
@shared_task
def add(x, y):
return x + y |
stormi/tsunami | refs/heads/master | src/primaires/objet/types/base.py | 1 | # -*-coding:Utf-8 -*
# Copyright (c) 2010 LE GOFF Vincent
# 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
# lis... |
yunque/librosa | refs/heads/master | librosa/cache.py | 5 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Function caching"""
import os
import sys
from joblib import Memory
class CacheManager(Memory):
'''The librosa cache manager class extends joblib.Memory
with a __call__ attribute, so that it may act as a function.
This allows us to override the librosa.cac... |
vityagi/azure-linux-extensions | refs/heads/master | VMEncryption/main/ConfigUtil.py | 8 | #!/usr/bin/env python
#
# VMEncryption extension
#
# Copyright 2015 Microsoft 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
#
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.