repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
jessstrap/servotk | refs/heads/master | tests/wpt/web-platform-tests/tools/py/py/_path/common.py | 171 | """
"""
import os, sys, posixpath
import py
# Moved from local.py.
iswin32 = sys.platform == "win32" or (getattr(os, '_name', False) == 'nt')
class Checkers:
_depend_on_existence = 'exists', 'link', 'dir', 'file'
def __init__(self, path):
self.path = path
def dir(self):
raise NotImplemen... |
Dandandan/wikiprogramming | refs/heads/master | jsrepl/build/extern/python/reloop-closured/lib/python2.7/new.py | 233 | """Create new objects of various types. Deprecated.
This module is no longer required except for backward compatibility.
Objects of most types can now be created by calling the type object.
"""
from warnings import warnpy3k
warnpy3k("The 'new' module has been removed in Python 3.0; use the 'types' "
"modu... |
rallylee/gem5 | refs/heads/master | src/arch/sparc/SparcNativeTrace.py | 42 | # Copyright (c) 2009 The Regents of The University of Michigan
# 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 ... |
CMLL/taiga-back | refs/heads/master | taiga/projects/mixins/__init__.py | 12133432 | |
ACJTeam/enigma2 | refs/heads/master | lib/python/Plugins/Extensions/CutListEditor/__init__.py | 12133432 | |
rohitwaghchaure/frappe | refs/heads/develop | frappe/website/doctype/web_form_field/__init__.py | 12133432 | |
dangra/scrapy | refs/heads/master | scrapy/templates/project/module/__init__.py | 12133432 | |
andrewschaaf/pyxc-pj | refs/heads/master | pyxc/__init__.py | 12133432 | |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-2.4/Lib/idlelib/Debugger.py | 9 | import os
import bdb
import types
from Tkinter import *
from WindowList import ListedToplevel
from ScrolledList import ScrolledList
class Idb(bdb.Bdb):
def __init__(self, gui):
self.gui = gui
bdb.Bdb.__init__(self)
def user_line(self, frame):
if self.in_rpc_code(frame):
s... |
Pablo126/SSBW | refs/heads/master | Entrega1/lib/python3.5/site-packages/django/template/loader_tags.py | 44 | import logging
import posixpath
import warnings
from collections import defaultdict
from django.utils import six
from django.utils.deprecation import RemovedInDjango21Warning
from django.utils.safestring import mark_safe
from .base import (
Node, Template, TemplateSyntaxError, TextNode, Variable, token_kwargs,
)
... |
mgunyho/pyspread | refs/heads/master | pyspread/src/lib/parsers.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright Martin Manns
# Distributed under the terms of the GNU General Public License
# --------------------------------------------------------------------
# pyspread is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publi... |
jhancock93/autorest | refs/heads/master | src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/models/product.py | 14 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
cyberworm/ircbot | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
from distutils.core import setup
setup(name='ircbot',
version='0.1',
description='A small IRC bot framework for Python',
author='Cyberworm',
author_email='cybaworm@gmail.com',
url='https://github.com/cyberworm/ircbot',
packages=['ircbot'],
)
|
andela-ifageyinbo/django | refs/heads/master | tests/check_framework/test_urls.py | 84 | from django.core.checks.urls import check_url_config
from django.test import SimpleTestCase
from django.test.utils import override_settings
class CheckUrlsTest(SimpleTestCase):
@override_settings(ROOT_URLCONF='check_framework.urls.no_warnings')
def test_no_warnings(self):
result = check_url_config(Non... |
Iotic-Labs/py-ubjson | refs/heads/dev-contrib | test/__init__.py | 12133432 | |
Adamwinwho/ttbug | refs/heads/master | ttbug/blocks/__init__.py | 12133432 | |
1modm/mesc | refs/heads/master | thirdparty/__init__.py | 12133432 | |
v-legoff/pa-poc2 | refs/heads/master | bundles/chat/websockets/__init__.py | 12133432 | |
CingHu/neutron-ustack | refs/heads/master | neutron/tests/unit/vmware/extensions/__init__.py | 12133432 | |
amisrs/one-eighty | refs/heads/master | angular_flask/lib/python2.7/site-packages/websocket/_http.py | 15 | """
websocket - WebSocket client library for Python
Copyright (C) 2010 Hiroki Ohtani(liris)
This library 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; either
version 2.1 of the License, ... |
pklimai/py-junos-eznc | refs/heads/master | lib/jnpr/junos/resources/autosys.py | 3 | """
Pythonifier for AutoSys Table/View
"""
from jnpr.junos.factory import loadyaml
from os.path import splitext
_YAML_ = splitext(__file__)[0] + '.yml'
globals().update(loadyaml(_YAML_))
|
atalax/libsigrokdecode | refs/heads/qi | decoders/i2cdemux/pd.py | 13 | ##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de>
##
## 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 Li... |
Eveler/libs | refs/heads/splited_document_engine | __Python__/ufms_blanks/test_PythonReports.py | 1 | #!/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Savenko'
def run():
# make some dummy data
_data = [{
"item": _ii,
"sub": [{"item": _jj} for _jj in xrange(_ii * 10, _ii * 10 + 10)]
} for _ii in xrange(10)]
# create report builder
from PythonR... |
aliceriot/zulip | refs/heads/master | tools/show-profile-results.py | 115 | #!/usr/bin/env python
import sys
import pstats
'''
This is a helper script to make it easy to show profile
results after using a Python decorator. It's meant to be
a simple example that you can hack on, or better yet, you
can find more advanced tools for showing profiler results.
'''
try:
fn = sys.argv[1]
except... |
mahim97/zulip | refs/heads/master | zerver/management/commands/logout_all_users.py | 15 |
from argparse import ArgumentParser
from typing import Any
from zerver.lib.management import ZulipBaseCommand
from zerver.lib.sessions import delete_all_deactivated_user_sessions, \
delete_all_user_sessions, delete_realm_user_sessions
class Command(ZulipBaseCommand):
help = "Log out all users."
def add_... |
mgireesh05/dev-util | refs/heads/master | autoupdate_lib.py | 2 | # Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module containing common autoupdate utilities and protocol dictionaries."""
import datetime
import os
import time
from xml.dom import minidom
AP... |
tlangerak/Multi-Agent-Systems | refs/heads/master | ag/googlesearch/googlesearch.py | 3 | '''
Created on May 5, 2017
@author: anthony
'''
import urllib2
import math
import re
from bs4 import BeautifulSoup
from pprint import pprint
from threading import Thread
from collections import deque
from time import sleep
class GoogleSearch:
USER_AGENT = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/5... |
BellScurry/gem5-fault-injection | refs/heads/master | tests/configs/pc-simple-timing-ruby.py | 11 | # Copyright (c) 2012 Mark D. Hill and David A. Wood
# 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 conditio... |
jessstrap/servotk | refs/heads/master | tests/wpt/css-tests/tools/pytest/doc/en/example/assertion/failure_demo.py | 179 | from pytest import raises
import _pytest._code
import py
def otherfunc(a,b):
assert a==b
def somefunc(x,y):
otherfunc(x,y)
def otherfunc_multi(a,b):
assert (a ==
b)
def test_generative(param1, param2):
assert param1 * 2 < param2
def pytest_generate_tests(metafunc):
if 'param1' in me... |
juicer/juicer | refs/heads/master | juicer/common/RPM.py | 2 | # -*- coding: utf-8 -*-
# Juicer - Administer Pulp and Release Carts
# Copyright © 2012,2013, Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
... |
hugobowne/scikit-learn | refs/heads/master | examples/feature_selection/plot_permutation_test_for_classification.py | 94 | """
=================================================================
Test with permutations the significance of a classification score
=================================================================
In order to test if a classification score is significative a technique
in repeating the classification procedure aft... |
Crystalnix/house-of-life-chromium | refs/heads/master | chrome/test/functional/codesign.py | 3 | #!/usr/bin/python
# Copyright (c) 2010 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 commands
import glob
import logging
import os
import sys
import unittest
import pyauto_functional # Must import before pyauto
i... |
pcaro/jurko-suds | refs/heads/master | tests/test_cache.py | 7 | # -*- coding: utf-8 -*-
# This program is free software; you can redistribute it and/or modify it under
# the terms of the (LGPL) GNU Lesser General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
#
# This program is distri... |
pchauncey/ansible | refs/heads/devel | lib/ansible/modules/system/lvol.py | 23 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Jeroen Hoekx <jeroen.hoekx@dsquare.be>, Alexander Bulimov <lazywolf0@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
ANS... |
fenner/mibbinator | refs/heads/master | mibbinator/mib/models.py | 1 | from django.db import models
class Restriction(models.Model):
name = models.CharField(maxlength=30)
description = models.CharField(maxlength=255, blank=True)
public = models.BooleanField()
notes = models.TextField(blank=True)
def __str__(self):
return self.name
class Admin:
pass
class Module... |
OCA/carrier-delivery | refs/heads/10.0 | delivery_optional_invoice_line/delivery.py | 5 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Agile Business Group sagl
# (<http://www.agilebg.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public ... |
Split-Screen/android_kernel_motorola_titan | refs/heads/pac-5.0 | scripts/rt-tester/rt-tester.py | 11005 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... |
john-parton/django-oscar | refs/heads/master | src/oscar/apps/catalogue/admin.py | 14 | from django.contrib import admin
from treebeard.admin import TreeAdmin
from treebeard.forms import movenodeform_factory
from oscar.core.loading import get_model
AttributeOption = get_model('catalogue', 'AttributeOption')
AttributeOptionGroup = get_model('catalogue', 'AttributeOptionGroup')
Category = get_model('catal... |
samuelshaner/openmc | refs/heads/develop | openmc/data/correlated.py | 2 | from collections import Iterable
from numbers import Real, Integral
from warnings import warn
import numpy as np
import openmc.checkvalue as cv
from openmc.stats import Tabular, Univariate, Discrete, Mixture, \
Uniform, Legendre
from .function import INTERPOLATION_SCHEME
from .angle_energy import AngleEnergy
from... |
sio2project/oioioi | refs/heads/master | oioioi/oi/__init__.py | 12133432 | |
psiq/gdsfactory | refs/heads/master | gdsdiff/__init__.py | 12133432 | |
diox/olympia | refs/heads/master | docs/extensions/__init__.py | 12133432 | |
liorvh/beeswithmachineguns | refs/heads/master | beeswithmachineguns/__init__.py | 12133432 | |
EDUlib/edx-ora2 | refs/heads/master | openassessment/assessment/worker/__init__.py | 12133432 | |
siutanwong/scikit-learn | refs/heads/master | sklearn/gaussian_process/tests/__init__.py | 12133432 | |
kuleshov/deep-learning-models | refs/heads/master | util/__init__.py | 12133432 | |
frishberg/django | refs/heads/master | tests/modeladmin/models.py | 37 | # -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Band(models.Model):
name = models.CharField(max_length=100)
bio = models.TextField()
sign_date = models.DateFiel... |
Sorsly/subtle | refs/heads/master | google-cloud-sdk/platform/gsutil/third_party/boto/boto/ec2/cloudwatch/alarm.py | 134 | # Copyright (c) 2010 Reza Lotun http://reza.lotun.name
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, m... |
Hoekz/hackness-monster | refs/heads/master | venv/lib/python2.7/site-packages/click/_compat.py | 66 | import re
import io
import os
import sys
import codecs
from weakref import WeakKeyDictionary
PY2 = sys.version_info[0] == 2
WIN = sys.platform.startswith('win')
DEFAULT_COLUMNS = 80
_ansi_re = re.compile('\033\[((?:\d|;)*)([a-zA-Z])')
def get_filesystem_encoding():
return sys.getfilesystemencoding() or sys.ge... |
aaniket/LP | refs/heads/master | test/test.py | 2 | from src.trumpscript.compiler import Compiler
from src.trumpscript.tokenizer import Tokenizer
__author__ = 'github.com/samshadwell'
def test_tokenize_file(filename, expected):
"""
Parse the file and verify that the types are what we expect
:param expected: the expected sequence of type codes coming from ... |
rackerlabs/arborlabs_client | refs/heads/master | solumclient/openstack/common/__init__.py | 233 | #
# 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
# ... |
tdr130/zulip | refs/heads/master | analytics/management/commands/active_user_stats.py | 116 | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zerver.models import UserPresence, UserActivity
from zerver.lib.utils import statsd, statsd_key
from datetime import datetime, timedelta
from collections import defaultdict
class Command(BaseCommand):
help = """Sends... |
timlinux/inasafe | refs/heads/develop | safe/metadata/metadata_db_io.py | 2 | # coding=utf-8
"""Metadata DB IO implementation."""
import logging
import os
import sqlite3 as sqlite
from sqlite3 import OperationalError
# noinspection PyPackageRequirements
from PyQt4.QtCore import QObject
from safe.common.exceptions import (
HashNotFoundError, UnsupportedProviderError)
from safe.definitions.... |
CUCWD/edx-platform | refs/heads/master | openedx/core/djangoapps/oauth_dispatch/views.py | 8 | """
Views that dispatch processing of OAuth requests to django-oauth2-provider or
django-oauth-toolkit as appropriate.
"""
from __future__ import unicode_literals
import hashlib
import json
from Cryptodome.PublicKey import RSA
from django.conf import settings
from django.urls import reverse
from django.http import J... |
hubert667/AIR | refs/heads/master | build/celery/build/lib.linux-i686-2.7/celery/tests/contrib/test_rdb.py | 2 | from __future__ import absolute_import
import errno
import socket
from celery.contrib.rdb import (
Rdb,
debugger,
set_trace,
)
from celery.tests.case import Case, Mock, WhateverIO, patch, skip_if_pypy
class SockErr(socket.error):
errno = None
class test_Rdb(Case):
@patch('celery.contrib.rdb.R... |
mkieszek/odoo | refs/heads/master | addons/website_membership/controllers/__init__.py | 7372 | import main
|
jejimenez/django | refs/heads/master | tests/migrations/models.py | 386 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps.registry import Apps
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
class CustomModelBase(models.base.ModelBase):
pass
class ModelWithCustomBase(six.with_met... |
hip-odoo/odoo | refs/heads/10.0 | addons/website_slides/models/res_config.py | 24 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class website_config_settings(models.TransientModel):
_inherit = "website.config.settings"
website_slide_google_app_key = fields.Char(string='Google Doc Key')
@api.mo... |
theiviaxx/Frog | refs/heads/master | frog/views/badge.py | 1 | ##################################################################################################
# Copyright (c) 2020 Brett Dixon
#
# 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 r... |
dpiers/coderang-meteor | refs/heads/master | public/jsrepl/extern/python/reloop-closured/lib/python2.7/antigravity.py | 235 |
import webbrowser
webbrowser.open("http://xkcd.com/353/")
|
rogerthat-platform/gae-plugin-framework | refs/heads/master | src/framework/server/framework/wsgi.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2017 GIG Technology NV
#
# 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... |
saknis/upelis | refs/heads/master | siteoff2.py | 1 | #!/usr/bin/env python
#
import os
import datetime
from google.appengine.api import users
from google.appengine.ext import db
from google.appengine.api import datastore
from google.appengine.api import datastore_types
class DinCode(db.Model):
user = db.UserProperty()
time = db.DateTimeProperty(auto_now_a... |
klusark/android_external_chromium_org | refs/heads/cm-11.0 | tools/telemetry/unittest_data/discoverable_classes/dummy_profile_creator.py | 29 | # 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.
from telemetry.core import profile_creator
class DummyProfileCreator(profile_creator.ProfileCreator):
def CreateProfile(self):
pass
|
comicxmz001/LeetCode | refs/heads/master | Python/74_Search2DMatrix.py | 1 | class Solution(object):
def searchMatrix(self, matrix, target):
"""
:type matrix: List[List[int]]
:type target: int
:rtype: bool
"""
if len(matrix) == 0:
return False
if len(matrix[0]) == 0:
return False
row = 0
col = len(matr... |
alessandrod/txloadbalancer | refs/heads/master | txlb/test/__init__.py | 12133432 | |
shubhdev/openedx | refs/heads/master | common/djangoapps/external_auth/__init__.py | 12133432 | |
tbeadle/django | refs/heads/master | tests/backends/__init__.py | 12133432 | |
ivan-fedorov/intellij-community | refs/heads/master | python/testData/formatter/beforeTopLevelClass.py | 83 | from unittest import TestCase
class MyTest(TestCase):
def test_pass(self):
self.assertEqual(1 + 1, 2) |
shridharmishra4/rename | refs/heads/master | newdesign/new.py | 1 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'new.ui'
#
# Created: Tue Sep 24 04:55:01 2013
# by: PyQt4 UI code generator 4.10
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeErr... |
xiandiancloud/edxplaltfom-xusong | refs/heads/master | lms/djangoapps/courseware/features/certificates.py | 20 | # pylint: disable=C0111
# pylint: disable=W0621
from lettuce import world, step
from lettuce.django import django_url
from course_modes.models import CourseMode
from nose.tools import assert_equal
UPSELL_LINK_CSS = '.message-upsell a.action-upgrade[href*="edx/999/Certificates"]'
def create_cert_course():
world.... |
duqiao/django | refs/heads/master | django/core/management/commands/dbshell.py | 467 | from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections
class Command(BaseCommand):
help = ("Runs the command-line client for specified database, or the "
"default database if none is provided.")
requires_system_checks = False
def add... |
madmack/i747_kernel_ics | refs/heads/modified_dhd | scripts/rt-tester/rt-tester.py | 11005 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... |
vizual54/MissionPlanner | refs/heads/master | Lib/site-packages/scipy/optimize/_minpack.py | 53 |
import sys
if sys.platform == 'cli':
import clr
clr.AddReference('optimize')
from scipy__optimize___minpack import _lmdif, _chkder, _hybrd, _hybrj, _lmder
from scipy__optimize___minpack import *
|
atplanet/ansible-modules-extras | refs/heads/devel | cloud/lxc/__init__.py | 12133432 | |
MohammedWasim/scikit-learn | refs/heads/master | sklearn/tree/tests/__init__.py | 12133432 | |
Regner/will | refs/heads/master | will/storage/__init__.py | 12133432 | |
mrrookes/arbitools | refs/heads/master | build/lib/arbitools/__init__.py | 12133432 | |
xujun10110/golismero | refs/heads/master | thirdparty_libs/django/conf/locale/lt/__init__.py | 12133432 | |
atul-bhouraskar/django | refs/heads/master | tests/reverse_lookup/models.py | 282 | """
Reverse lookups
This demonstrates the reverse lookup features of the database API.
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class User(models.Model):
name = models.CharField(max_length=200)
def __str__(self):
ret... |
akionakamura/scikit-learn | refs/heads/master | benchmarks/bench_multilabel_metrics.py | 86 | #!/usr/bin/env python
"""
A comparison of multilabel target formats and metrics over them
"""
from __future__ import division
from __future__ import print_function
from timeit import timeit
from functools import partial
import itertools
import argparse
import sys
import matplotlib.pyplot as plt
import scipy.sparse as... |
CLOUGH/info3180-project-3 | refs/heads/master | server/lib/werkzeug/contrib/lint.py | 318 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.lint
~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 0.5
This module provides a middleware that performs sanity checks of the WSGI
application. It checks that :pep:`333` is properly implemented and warns
on some common HTTP errors such as non-empty respons... |
AeroNotix/algostructure | refs/heads/master | Python/btree.py | 1 | import random
import sys
sys.setrecursionlimit(2000000)
class BinaryTree(object):
def __init__(self):
self.value = None
self.left = None
self.right = None
def add(self, element):
if not self.value:
self.left = BinaryTree()
self.right = BinaryTree()
... |
StrikeForceZero/PJSip-CSharp | refs/heads/master | tests/pjsua/scripts-call/150_srtp_2_3.py | 57 | # $Id: 150_srtp_2_3.py 3334 2010-10-05 16:32:04Z nanang $
#
from inc_cfg import *
test_param = TestParam(
"Callee=mandatory SRTP, caller=optional (with duplicated offer) SRTP",
[
InstanceParam("callee", "--null-audio --use-srtp=2 --srtp-secure=0 --max-calls=1"),
InstanceParam("caller", "--null-audio --use-sr... |
atvcaptain/enigma2 | refs/heads/6.5 | lib/python/Components/PluginComponent.py | 1 | from __future__ import print_function
import os
from shutil import rmtree
from bisect import insort
from Tools.Directories import fileExists, resolveFilename, SCOPE_PLUGINS
from Tools.Import import my_import
from Tools.Profile import profile
from Plugins.Plugin import PluginDescriptor
import keymapparser
class PluginC... |
marcsans/cnn-physics-perception | refs/heads/master | phy/lib/python2.7/site-packages/theano/tensor/slinalg.py | 6 | import logging
import warnings
from six.moves import xrange
import numpy
try:
import scipy.linalg
imported_scipy = True
except ImportError:
# some ops (e.g. Cholesky, Solve, A_Xinv_b) won't work
imported_scipy = False
from theano import tensor
import theano.tensor
from theano.tensor import as_tensor_... |
crunchmail/munch-core | refs/heads/master | src/munch/urls.py | 1 | from django.contrib import admin
from django.conf.urls import url
from django.conf.urls import include
from django.conf.urls.i18n import i18n_patterns
import rest_framework.urls
from rest_framework_jwt.views import refresh_jwt_token
import munch.apps.abuse.urls
import munch.apps.users.urls
import munch.apps.hosted.ur... |
Partoo/scrapy | refs/heads/master | scrapy/interfaces.py | 15 | from zope.interface import Interface
class ISpiderManager(Interface):
def from_settings(settings):
"""Returns an instance of the class for the given settings"""
def load(spider_name):
"""Returns the Spider class for the given spider name. If the spider
name is not found, it must raise... |
whiteclover/white | refs/heads/master | white/lang/en_GB/page.py | 4 | t = {
'page': 'Pages',
'create_page': 'Create a new page',
'nopages_desc': 'You don\'t have any pages.',
'redirect': 'Redirect',
# form fields
'redirect_url': 'Redirect Url',
'redirect_missing': 'Please enter a valid url',
'title': 'Page title',
'title_explain': '',
'title_mi... |
yohanko88/gem5-DC | refs/heads/master | src/mem/ruby/network/BasicRouter.py | 53 | # Copyright (c) 2011 Advanced Micro Devices, Inc.
# 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 conditions... |
heathy/ProjectEuler | refs/heads/master | projecteuler/tests/__init__.py | 12133432 | |
omwomotieno/tunza_v3 | refs/heads/work_branch | reports/migrations/__init__.py | 12133432 | |
Khushmeet/mlsite | refs/heads/master | app/load.py | 2 | import numpy as np
from keras.models import load_model
from keras.preprocessing.sequence import pad_sequences
import tensorflow as tf
from collections import Counter
import tweepy
import boto3.session
import _pickle
import h5py
import gc
session = boto3.session.Session(region_name='ap-south-1')
s3client = session.cli... |
ramaganapathy1/AMuDA-Ir-back-end | refs/heads/master | vEnv/lib/python2.7/site-packages/werkzeug/routing.py | 87 | # -*- coding: utf-8 -*-
"""
werkzeug.routing
~~~~~~~~~~~~~~~~
When it comes to combining multiple controller or view functions (however
you want to call them) you need a dispatcher. A simple way would be
applying regular expression tests on the ``PATH_INFO`` and calling
registered callback fun... |
tigersirvine/occtigerscricket | refs/heads/master | django/contrib/localflavor/ro/forms.py | 85 | # -*- coding: utf-8 -*-
"""
Romanian specific form helpers.
"""
from __future__ import absolute_import
from django.contrib.localflavor.ro.ro_counties import COUNTIES_CHOICES
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError, Field, RegexField, Select
from django.utils.translation... |
bepatient-fr/ikaaro | refs/heads/0.78 | ikaaro/datatypes.py | 3 | # -*- coding: UTF-8 -*-
# Copyright (C) 2008 Juan David Ibáñez Palomar <jdavid@itaapy.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option... |
LaboratoireMecaniqueLille/crappy | refs/heads/master | crappy/tool/gpucorrel.py | 1 | # coding:utf-8
import warnings
from math import ceil
import numpy as np
from .._global import OptionalModule
try:
import cv2
except (ModuleNotFoundError, ImportError):
cv2 = OptionalModule("opencv-python")
from .fields import get_field
from .._global import OptionalModule
try:
import pycuda.driver as cuda
fr... |
photoninger/ansible | refs/heads/devel | lib/ansible/modules/system/ping.py | 65 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016, Toshio Kuratomi <tkuratomi@ansible.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_... |
edunham/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_handshake.py | 452 | #!/usr/bin/env python
#
# Copyright 2012, Google Inc.
# 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... |
partofthething/home-assistant | refs/heads/dev | tests/components/mazda/test_sensor.py | 2 | """The sensor tests for the Mazda Connected Services integration."""
from homeassistant.components.mazda.const import DOMAIN
from homeassistant.const import (
ATTR_FRIENDLY_NAME,
ATTR_ICON,
ATTR_UNIT_OF_MEASUREMENT,
LENGTH_KILOMETERS,
LENGTH_MILES,
PERCENTAGE,
PRESSURE_PSI,
)
from homeassis... |
shliujing/v2ex | refs/heads/master | html5lib/tests/test_stream.py | 74 | import support
import unittest, codecs
from html5lib.inputstream import HTMLInputStream
class HTMLInputStreamShortChunk(HTMLInputStream):
_defaultChunkSize = 2
class HTMLInputStreamTest(unittest.TestCase):
def test_char_ascii(self):
stream = HTMLInputStream("'", encoding='ascii')
self.assert... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.