text
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
231
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
score
float64
0
0.34
import os import shutil import unittest import pytest from pyontutils import obo_io as oio from .common import temp_path obo_test_string = """format-version: 1.2 ontology: uberon/core subsetdef: cumbo "CUMBO" treat-xrefs-as-has-subclass: EV import: http://purl.obolibrary.org/obo/uberon/chebi_import.owl treat-xrefs-as-...
tgbugs/pyontutils
test/test_oboio.py
Python
mit
6,002
0.002832
#!/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. """Script for a testing an existing SDK. This script is normally run immediately after build_sdk.py. """ import argparse import o...
heke123/chromium-crosswalk
native_client_sdk/src/build_tools/test_sdk.py
Python
bsd-3-clause
8,061
0.009924
class dstat_plugin(dstat): def __init__(self): self.name = 'snooze' self.vars = ('snooze',) self.type = 's' self.width = 6 self.scale = 0 self.before = time.time() def extract(self): now = time.time() if loop != 0: self.val['snooze'] =...
dongyoungy/dbseer_middleware
rs-sysmon2/plugins/dstat_snooze.py
Python
apache-2.0
737
0
""" 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, ...
gw-sd-2016/Codir
codirSublime/SocketIO/websocket/_core.py
Python
gpl-2.0
16,014
0.000812
import cherrypy from cherrypy.test import helper script_names = ["", "/path/to/myapp"] class ProxyTest(helper.CPWebCase): def setup_server(): # Set up site cherrypy.config.update({ 'tools.proxy.on': True, 'tools.proxy.base': 'www.mydomain.test', }) # Set...
xpavlus/parabaramba
venv/lib/python2.7/site-packages/cherrypy/test/test_proxy.py
Python
gpl-3.0
5,136
0.000195
import os import sys import django def main(): """ Standalone django model test with a 'memory-only-django-installation'. You can play with a django model without a complete django app installation. http://www.djangosnippets.org/snippets/1044/ """ sys.path.append(os.path.abspath(os.path.dirnam...
hirokiky/django-websettings
runtest.py
Python
mit
1,437
0.001392
#! /usr/bin/env python # --*-- coding:utf-8 --*-- import os import sys sys.path.append(os.path.split(os.path.split(os.path.abspath(sys.path[0]))[0])[0]) from CountMan.monitor.util import * from CountMan.monitor.setting import * class Queryer(object): def __init__(self): self.dao = DatabaseInterface() ...
YFFY/Supervisor
CountMan/monitor/queryer.py
Python
gpl-2.0
854
0.005855
# Copyright (c) 2015, Lars Tingelstad # All rights reserved. # # 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 # l...
tingelst/pyversor
pyversor/c3d/directions.py
Python
bsd-3-clause
1,721
0.000581
from django.conf.urls import include, url from . import views urlpatterns = [ url(r'^$', views.post_list), #URL para lista de todos los post url(r'^post/(?P<pk>[0-9]+)/$', views.post_detail), #URL para ver los detalles del post url(r'^post/new/$', views.post_new, name='post_new'), #URL ...
chrisRubiano/djangoblog
blog/urls.py
Python
mit
500
0.018
# SPDX-License-Identifier: Apache-2.0 # Copyright Contributors to the Rez Project ''' Bundle a context and its packages into a relocatable dir. ''' from __future__ import print_function import os import os.path import sys def setup_parser(parser, completions=False): group = parser.add_mutually_exclusive_group(...
instinct-vfx/rez
src/rez/cli/bundle.py
Python
apache-2.0
1,729
0.001157
# -*- 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...
crmccreary/openerp_server
openerp/addons/account/report/account_central_journal.py
Python
agpl-3.0
5,320
0.004511
from io import StringIO import re import httpretty from django.core.management import call_command from oppia.test import OppiaTestCase from settings import constants from settings.models import SettingProperties from tests.utils import get_file_contents class CartoDBUpdateTest(OppiaTestCase): fixtures = ['test...
DigitalCampus/django-oppia
tests/viz/management/commands/test_cartodb_update.py
Python
gpl-3.0
2,062
0
# Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2011 Nick Hall # Copyright (C) 2011 Tim G L Lyons # # 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 th...
arunkgupta/gramps
gramps/plugins/gramplet/backlinks.py
Python
gpl-2.0
7,865
0.002924
""" Mapping functions """ # pylint: disable=invalid-name, missing-docstring, no-member from __future__ import print_function import pandas from mpl_toolkits.basemap import Basemap def create_map(lon, lat): """ Create a map projection. """ lon_center = lon[0] lat_center = lat[0] return Basem...
dronecrew/px4tools
px4tools/mapping.py
Python
bsd-3-clause
952
0
# My files from handlers import MainPage from handlers import WelcomePage from handlers import SignUpPage from handlers import SignIn from handlers import SignOut from handlers import NewPost from handlers import EditPost from handlers import DeletePost from handlers import SinglePost from handlers import LikePost from...
joepettigrew/multi-blog
main.py
Python
mit
890
0
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import, division from alchemist import management from flask import Flask class TestManager: def setup(self): self.app = Flask('alchemist') self.app.config['COMPONENTS'] = ['alchemist'] def test_discover_commands(self)...
concordusapps/alchemist
alchemist/tests/test_management.py
Python
mit
489
0
#!/bin/env python # -*- coding: utf-8; -*- # # (c) 2016 FABtotum, http://www.fabtotum.com # # This file is part of FABUI. # # FABUI 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 Licen...
infinity0n3/fabtotum-experiments
fabtotum/fabui/database.py
Python
gpl-3.0
825
0
#!/usr/bin/env python # -*- coding: utf-8 -*- from rcr.robots.dagucar.DaguCar import DaguCar def main(): car = DaguCar( "/dev/rfcomm1", 500 ) car.MoveForward( 15 ) car.Pause( 1000 ) car.MoveBackward( 15 ) car.Pause( 1000 ) car.MoveLeft( 15 ) car.Pause( 1000 ) car.MoveRight( 15 ) ca...
titos-carrasco/DaguCar
Python/TestDaguCar.py
Python
mit
591
0.060914
import sys from mailpile.app import Main def main(): Main(sys.argv[1:]) if __name__ == "__main__": main()
laborautonomo/Mailpile
mailpile/__main__.py
Python
apache-2.0
118
0
import os from tito.builder import UpstreamBuilder from tito.common import debug, run_command class DistributionBuilder(UpstreamBuilder): """ This class is used for building packages for distributions. Parent class UpstreamBuilder build one big patch from upstream and create e.g.: Patch0: foo-1.2.13-1-t...
xsuchy/tito
src/tito/distributionbuilder.py
Python
gpl-2.0
2,016
0.008433
# -*- coding: UTF-8 -*- from django.conf import settings as dsettings from django.contrib.syndication.views import Feed, FeedDoesNotExist from django.core.urlresolvers import reverse from microblog import models from microblog import settings import os.path class FeedsDict(dict): """ dict custom che solleva ...
malemburg/epcon
microblog/feeds.py
Python
bsd-2-clause
2,027
0.00296
"""Test modile for API.""" from django.contrib.auth.models import User from django.core.files.uploadedfile import SimpleUploadedFile from django.urls import reverse import factory from imager_images.models import Album from imager_images.models import Photo from imagersite.settings import MEDIA_ROOT import os from rest...
carloscadena/django-imager
imagersite/imager_api/tests.py
Python
mit
2,994
0
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.python.monkey}. """ from __future__ import division, absolute_import from twisted.trial import unittest from twisted.python.monkey import MonkeyPatcher class TestObj: def __init__(self): self.foo = 'foo valu...
Architektor/PySnip
venv/lib/python2.7/site-packages/twisted/test/test_monkey.py
Python
gpl-3.0
5,637
0.001951
from eisoil.core.exception import CoreException class ScheduleException(CoreException): def __init__(self, desc): self._desc = desc def __str__(self): return "Schedule: %s" % (self._desc,) class ScheduleOverbookingError(ScheduleException): def __init__(self, schedule_subject, resou...
EICT/C-BAS
src/vendor/schedule/scheduleexceptions.py
Python
bsd-3-clause
857
0.009335
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
alxgu/ansible
lib/ansible/module_utils/storage/emc/emc_vnx.py
Python
gpl-3.0
1,915
0.005744
from __future__ import absolute_import import weakref import threading import asyncore import socket from walky.objects import * from walky.port import * from walky.engine import * class Client(object): engine = None settings = None connection = None port = None engine_class = Engine object...
amimoto/walky
walky/client/common.py
Python
mit
1,360
0.011029
# -*- coding: utf-8 -*- import os import codecs import random # this is the path of the folder that will contain the tweet files tweets_folder = os.path.join("D:", os.sep, "Documents", "PycharmProjects", "easy_group_classifier", "text_files") # checks if previous path exists, ...
jluukvg/text-classifier
python/randomize_tweet_order.py
Python
mit
957
0
# generated from catkin/cmake/template/cfg-extras.context.py.in DEVELSPACE = 'FALSE' == 'TRUE' INSTALLSPACE = 'TRUE' == 'TRUE' CATKIN_DEVEL_PREFIX = '/home/pi/Documents/desenvolvimentoRos/devel' CATKIN_GLOBAL_BIN_DESTINATION = 'bin' CATKIN_GLOBAL_ETC_DESTINATION = 'etc' CATKIN_GLOBAL_INCLUDE_DESTINATION = 'include' C...
UnbDroid/robomagellan
Codigos/Raspberry/desenvolvimentoRos/build/rosserial/rosserial_arduino/catkin_generated/rosserial_arduino-extras.cmake.installspace.context.cmake.py
Python
gpl-3.0
1,578
0.003169
#!/usr/bin/python # -*- coding: utf-8 -*- ### # Copyright (2016-2019) Hewlett Packard Enterprise Development LP # # 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/licen...
HewlettPackard/oneview-ansible
test/test_oneview_ethernet_network_facts.py
Python
apache-2.0
4,198
0.001906
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
illicitonion/givabit
lib/sdks/google_appengine_1.7.1/google_appengine/google/appengine/ext/appstats/datamodel_pb.py
Python
apache-2.0
81,798
0.01879
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from lazagne.config.module_info import ModuleInfo try: from ConfigParser import RawConfigParser # Python 2.7 except ImportError: from configparser import RawConfigParser # Python 3 from collections import OrderedDict class Wifi(ModuleInfo): d...
AlessandroZ/LaZagne
Linux/lazagne/softwares/wifi/wifi.py
Python
lgpl-3.0
1,246
0.001605
import sys import os.path import subprocess PY3 = sys.version >= '3' from setuptools import setup, find_packages # http://blogs.nopcode.org/brainstorm/2013/05/20/pragmatic-python-versioning-via-setuptools-and-git-tags/ # Fetch version from git tags, and write to version.py. # Also, when git is not available (PyPi pa...
richli/dame
setup.py
Python
mit
1,201
0.001665
from distutils import log import distutils.command.sdist as orig import os import sys import io import contextlib from setuptools.extern import six, ordered_set from .py36compat import sdist_add_defaults import pkg_resources _default_revctrl = list def walk_revctrl(dirname=''): """Find all files under revisio...
sserrot/champion_relationships
venv/Lib/site-packages/setuptools/command/sdist.py
Python
mit
8,092
0.000124
# 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 may ...
Azure/azure-sdk-for-python
sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_images_operations.py
Python
mit
21,016
0.00452
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Techies' Stasis Trap :copyright: (c) 2014 Runzhou Li (Leo) :license: The MIT License (MIT), see LICENSE for details. """ import sys from logging import Handler, NOTSET _ref_atributes = [ '%(levelname)s', '%(name)s', '%(pathname)s', '%(module)s', ...
woozyking/techies
techies/stasistrap.py
Python
mit
1,129
0.000886
# Copyright 2016 Google Inc. 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 applicable law or agre...
amyxchen/openhtf
test/phase_info_test.py
Python
apache-2.0
2,220
0.013964
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import platform import sys import pytest import spack from spack.main import SpackCommand python = SpackCommand('python...
LLNL/spack
lib/spack/spack/test/cmd/python.py
Python
lgpl-2.1
1,190
0
import sys import argparse import logging import importlib from .server import Server, build_endpoint_description_strings from .access import AccessLogGenerator logger = logging.getLogger(__name__) DEFAULT_HOST = '127.0.0.1' DEFAULT_PORT = 8000 class CommandLineInterface(object): """ Acts as the main CLI en...
maikhoepfel/daphne
daphne/cli.py
Python
bsd-3-clause
7,303
0.001917
class Solution: """ @param A : a list of integers @param target : an integer to be searched @return : a list of length 2, [index1, index2] """ def searchRange(self, A, target): # write your code here res = [] l, r = 0, len(A) - 1 while l <= r: m = (l ...
cc13ny/Allin
jiuzhang/Nine Chapters/2 Binary Search & Sorted Array/py/SearchforaRange.py
Python
mit
719
0.006954
from ajenti.api import * @interface class UserSyncProvider (BasePlugin): allows_renaming = False syncs_root = False def test(self): return False def check_password(self, username, password): return False def sync(self): pass
lupyuen/RaspberryPiImage
usr/share/pyshared/ajenti/usersync/base.py
Python
apache-2.0
277
0.00722
import unittest import requests import responses from mock import patch, MagicMock from MyCapytain.retrievers.cts5 import * class TestEndpointsCts5(unittest.TestCase): """ Test Cts5 Endpoint request making """ def setUp(self): self.cts = HttpCtsRetriever("http://domainname.com/rest/cts") def ...
Capitains/MyCapytain
tests/retrievers/test_cts5.py
Python
mpl-2.0
10,090
0.000892
""" Handlers for sequencing project information. """ import json import string import traceback import tornado.web import dateutil.parser import datetime import requests import re import paramiko import base64 import urllib import os import logging from itertools import ifilter from collections import defaultdict fr...
kate-v-stepanova/genomics-status
status/projects.py
Python
mit
36,140
0.006364
#!/usr/bin/python # -*- coding: utf-8 -*- corto = 10 largo = long(corto) print type(corto) print type(largo)
psicobyte/ejemplos-python
cap5/p62.py
Python
gpl-3.0
112
0
# Copyright 2015 Google Inc. 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 applicable law or a...
ininex/geofire-python
resource/lib/python2.7/site-packages/gcloud/bigtable/test_instance.py
Python
mit
31,982
0
"""Tests for the Awair sensor platform.""" from unittest.mock import patch from homeassistant.components.awair.const import ( API_CO2, API_HUMID, API_LUX, API_PM10, API_PM25, API_SCORE, API_SPL_A, API_TEMP, API_VOC, ATTR_UNIQUE_ID, DOMAIN, SENSOR_TYPES, ) from homeassist...
sander76/home-assistant
tests/components/awair/test_sensor.py
Python
apache-2.0
9,940
0.000101
# -*- coding: utf-8 -*- """ flask.testsuite.basic ~~~~~~~~~~~~~~~~~~~~~ The basic functionality. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import re import uuid import time import flask import pickle import unittest from datetime import datetime from...
5y/flask
flask/testsuite/basic.py
Python
bsd-3-clause
48,486
0.002311
""" WSGI config for project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_MOD...
pannkotsky/groupmate
backend/wsgi.py
Python
mit
384
0
import sys import pygame from pygame.locals import * pygame.init() screen = pygame.display.set_mode((600, 500)) pygame.display.set_caption("Drawing Lines") screen.fill((0, 80, 0)) # draw the line color = 100, 255, 200 width = 8 pygame.draw.line(screen, color, (100, 100), (500, 400), width) pygame.dis...
PoisonBOx/PyGames
2.Pie/drawLine.py
Python
gpl-2.0
453
0.002208
# Part of django-hookbox # Copyright 2011, Duane Griffin <duaneg@dghda.com> from django.conf import settings from django.dispatch import Signal from django.http import HttpResponse from django.template import loader, RequestContext from django.views.decorators.csrf import csrf_exempt import json import logging import...
duaneg/django-hookbox
djhookbox/views.py
Python
bsd-3-clause
5,848
0.007182
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright © 2014 Daniel Tschan <tschan@puzzle.ch> # # This file is part of Weblate <https://weblate.org/> # # 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 Foun...
dontnod/weblate
openshift/wsgi_install.py
Python
gpl-3.0
3,281
0
import bottle @bottle.route('/') def home_page(): mythings = ['apple','orange','banana','peach'] return bottle.template('hello_world', username='Todd',things=mythings) bottle.debug(True) bottle.run(host='localhost', port=8082)
tdoughty1/mongodb_M101P
Week1/Lecture/hello_world/hello_world.py
Python
gpl-2.0
237
0.025316
# -*- coding: utf-8 -*- """ tools ===== Functions that USERS will possibly want access to. """ from __future__ import absolute_import import json import warnings import six import re import os from plotly import exceptions, optional_imports from plotly.files import PLOTLY_DIR DEFAULT_PLOTLY_COLORS = [ "rgb(3...
plotly/python-api
packages/python/plotly/plotly/tools.py
Python
mit
25,137
0.000517
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2009-2012 Zuza Software Foundation # # This file is part of Pootle. # # 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...
ttreeagency/PootleTypo3Org
pootle/apps/pootle_app/views/index/index.py
Python
gpl-2.0
4,828
0.000414
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
zlpmichelle/crackingtensorflow
wide_deep/wide_deep.py
Python
apache-2.0
8,315
0.007216
# Configuration file for ipython-notebook. c = get_config() #------------------------------------------------------------------------------ # NotebookApp configuration #------------------------------------------------------------------------------ # NotebookApp will inherit config from: BaseIPythonApplication, Appli...
tschinz/iPython_Workspace
settings/profile_wpwiki/ipython_notebook_config.py
Python
gpl-2.0
24,145
0.003686
import pygame as pg from i18n import i18n class BaseScene(object): """ Parent class for individual game states to inherit from. """ def __init__(self, helpers=None): self.done = False self.quit = False self.sounds = helpers['sounds'] if helpers else None self.assets = he...
daniellinye/HRINFG3
euromast/components/stateManagment.py
Python
mit
1,431
0.002096
from behave import * import operator from django.db.models import Q use_step_matcher("parse") @given('Exists album at group "{group_name}" by "{username}"') def step_impl(context, group_name, username): from django.contrib.auth.models import User user = User.objects.get(username=username) from musicseaapp...
julio77nz/MusicSea
musicsea/features/steps/register_album.py
Python
gpl-3.0
2,839
0.003875
import glob import sys import string import Bio.PDB def parse_noe(filename): f = open(filename, 'r') noe_pairs = [] for line in f.readlines(): res_a = int(string.split(line)[2]) res_b = int(string.split(line)[7]) noe_pair = [res_a, res_b] if noe_pair n...
andersx/cs-proteins
scripts/visualize_noe.py
Python
unlicense
1,599
0.003752
#!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of HSPlasma. # # HSPlasma 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...
H-uru/libhsplasma
Python/scripts/prp-checkfiles.py
Python
gpl-3.0
5,456
0.004032
import shlex import textwrap from ert_gui.shell.libshell import autoCompleteList, ShellFunction, ShellProperty, widthAsPercentageOfConsoleWidth, getTerminalSize class ShellCollection(object): command_help_message = "The command: '%s' supports the following keywords:" def __init__(self, name, parent=None, des...
arielalmendral/ert
python/python/ert_gui/shell/libshell/shell_collection.py
Python
gpl-3.0
5,721
0.002972
import os import json import tempfile import webbrowser import designer from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.properties import ObjectProperty, ConfigParser, StringProperty from kivy.uix.settings import Settings, InterfaceWithSidebar, MenuSidebar,\ ContentPanel, SettingsPanel ...
ihidalgo/uip-prog3
Parciales/practicas/kivy-designer-master/designer/buildozer_spec_editor.py
Python
mit
8,139
0.000614
from pyramid.view import view_config from pyramid.config import Configurator @view_config(route_name='text', renderer='string') def text(request): return 'Hello, World!' config = Configurator() config.add_route('text', '/text') config.scan() app = config.make_wsgi_app()
MuhammadAlkarouri/hug
benchmarks/http/pyramid_test.py
Python
mit
281
0
# -*- Python -*- # XXX originally from the python implementation of irken. # See "The Implementation of Functional Programming Languages", # Chapter 5: "Efficient Compilation of Pattern-Matching". # http://research.microsoft.com/en-us/um/people/simonpj/papers/slpj-book-1987/ # # Thanks for the hint, OCaml people! (Xa...
samrushing/caesure
docs/match.py
Python
bsd-2-clause
11,932
0.011314
from twisted.web import server, resource from Tribler.Core.Modules.restapi.util import convert_db_channel_to_json, convert_search_torrent_to_json, \ fix_unicode_dict from Tribler.Core.simpledefs import (NTFY_CHANNELCAST, SIGNAL_CHANNEL, SIGNAL_ON_SEARCH_RESULTS, SIGNAL_TORRENT, ...
Captain-Coder/tribler
Tribler/Core/Modules/restapi/events_endpoint.py
Python
lgpl-3.0
13,739
0.005968
"""Tests for the template tests.""" import unittest from grow.templates import tests class BuiltinTestsTestCase(unittest.TestCase): def test_subset_filter(self): """Provided value is a subset when has all the required values.""" value = ['banana', 'apple'] test_value = ['banana'] ...
grow/pygrow
grow/templates/tests_test.py
Python
mit
2,013
0
import pytest from cfme.containers.provider import ContainersProvider from cfme.markers.env_markers.provider import providers from cfme.utils.appliance.implementations.ui import navigate_to from cfme.utils.providers import ProviderFilter from cfme.utils.wait import wait_for pytestmark = [ pytest.mark.usefixtures...
anurag03/integration_tests
cfme/tests/containers/test_cockpit.py
Python
gpl-2.0
2,473
0.002426
#!/usr/bin/env python import os import sys if __name__ == "__main__": # testing environment os.environ.setdefault("DJANGO_SETTINGS_MODULE", "blastplus.test_settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
michal-stuglik/django-blastplus
manage.py
Python
mit
283
0
""" exec_command Implements exec_command function that is (almost) equivalent to commands.getstatusoutput function but on NT, DOS systems the returned status is actually correct (though, the returned status values may be different by a factor). In addition, exec_command takes keyword arguments for (re-)defining enviro...
mbayon/TFG-MachineLearning
venv/lib/python3.6/site-packages/numpy/distutils/exec_command.py
Python
mit
8,663
0.003925
# -*- coding: utf-8 -*- # # EbookLib documentation build configuration file, created by # sphinx-quickstart on Fri Apr 25 11:49:49 2014. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
eCrowdMedia/ebooklib
docs/conf.py
Python
agpl-3.0
9,313
0.007516
#common sets up the conduit environment from common import * #setup test test = SimpleSyncTest() #Setup the key to sync gconf = test.get_dataprovider("GConfTwoWay") gconf.module.whitelist = ['/apps/metacity/general/num_workspaces'] folder = test.get_dataprovider("TestFolderTwoWay") test.prepare(gconf, folder) test.s...
arsfeld/conduit
test/python-tests/TestSyncGConfFolder.py
Python
gpl-2.0
1,001
0.022977
import re from vogen.voparser import VoParser, VoVariable class AS3VoParser( VoParser ): def parse( self, input_string, verbose ): self.input_string = input_string self.verbose = verbose class_names = re.findall(r"class (\w+)", self.input_string ); #Find the class_...
bendoran/vogen
src/vogen/as3parser.py
Python
mit
2,621
0.021366
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Replace this with more appropriate tests for your application. """ from django.test import TestCase from professor.models import Professor, DiaSemana, DisponibilidadeAula from professor.models import Pro...
dextervip/rpv
GerenDisponibilidade/professor/tests.py
Python
gpl-3.0
810
0.007407
from pikka_bird_collector.parsers.table import Table as Parser from .base_port_command import BasePortCommand, Base class Mysql(BasePortCommand): """ Collector for MySQL (https://www.mysql.com/). The collector is enabled whenever non-empty settings are passed. Multiple instances r...
tiredpixel/pikka-bird-collector-py
pikka_bird_collector/collectors/mysql.py
Python
mit
5,160
0.00814
import itertools import numpy as np import pandas as pd import pytest from numpy.testing import assert_allclose from pvlib import atmosphere from pvlib import solarposition latitude, longitude, tz, altitude = 32.2, -111, 'US/Arizona', 700 times = pd.date_range(start='20140626', end='20140626', freq='6h', tz=tz) e...
uvchik/pvlib-python
pvlib/test/test_atmosphere.py
Python
bsd-3-clause
5,239
0.005535
import matplotlib.pyplot as plt import numpy as np def logHist(X, N=30,fig=None, noclear=False, pdf=False, **kywds): ''' Plot logarithmic histogram or probability density function from sampled data. Args: X (numpy.ndarray): 1-D array of sampled values N (Optional[int]): Number of bins ...
dsavransky/miscpy
miscpy/PlotFun/logHist.py
Python
mit
1,435
0.013937
""" Create quiz TimeSpecialCase for all students in a particular lab/tutorial section. Usage will be like: ./manage.py special_case_tutorial 2020su-cmpt-120-d1 q1 D101 '2021-10-07T09:30' '2021-10-07T10:30' """ import datetime from django.core.management.base import BaseCommand from django.db import transaction from ...
sfu-fas/coursys
quizzes/management/commands/special_case_tutorial.py
Python
gpl-3.0
1,849
0.005408
# -*- coding: utf-8 -*- from django import forms from django.conf import settings from django.utils.safestring import mark_safe from captcha import client class ReCaptcha(forms.widgets.Widget): if getattr(settings, "RECAPTCHA_NOCAPTCHA", False): recaptcha_response_name = 'g-recaptcha-response' re...
Elec/django-recaptcha
captcha/widgets.py
Python
bsd-3-clause
1,285
0
# 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 u...
Huyuwei/tvm
tests/python/relay/test_cpp_build_module.py
Python
apache-2.0
4,614
0.001734
"""Support for Hangouts.""" import logging from hangups.auth import GoogleAuthError import voluptuous as vol from homeassistant import config_entries from homeassistant.components.conversation.util import create_matcher from homeassistant.config_entries import ConfigEntry from homeassistant.const import EVENT_HOMEASS...
mezz64/home-assistant
homeassistant/components/hangouts/__init__.py
Python
apache-2.0
4,741
0.001476
from sys import argv for line in open(argv[1]): tweet_id, hashtags, hashtags_count, user_id, created_at, followers_count, score, text = line.replace('\n', '').split('\t') print ','.join([tweet_id, user_id, created_at, followers_count, score, text])
dsarlis/Cloud-Burst
etl/process.py
Python
apache-2.0
258
0.007752
#!/usr/bin/env python ############################################################################## ## ## This file is part of Sardana ## ## http://www.sardana-controls.org/ ## ## Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain ## ## Sardana is free software: you can redistribute it and/or modify ## it und...
sagiss/sardana
src/sardana/taurus/qt/qtgui/extra_sardana/expdescription.py
Python
lgpl-3.0
19,906
0.00628
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/loot/loot_schematic/shared_geonosian_reinforcement_core_schematic.if...
anhstudios/swganh
data/scripts/templates/object/tangible/loot/loot_schematic/shared_geonosian_reinforcement_core_schematic.py
Python
mit
527
0.043643
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import from .decorators import Vectorize, GUVectorize, vectorize, guvectorize from ._internal import PyUFunc_None, PyUFunc_Zero, PyUFunc_One from . import _internal, array_exprs if hasattr(_internal, 'PyUFunc_ReorderableNone'): PyUFu...
stefanseefeld/numba
numba/npyufunc/__init__.py
Python
bsd-2-clause
809
0.001236
# ext/mutable.py # Copyright (C) 2005-2014 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 """Provide support for tracking of in-place changes to scalar values, which are propa...
ncdesouza/bookworm
env/lib/python2.7/site-packages/sqlalchemy/ext/mutable.py
Python
gpl-3.0
23,156
0.000043
#!/usr/bin/env python import sys, os sys.path.append(os.path.join(os.path.dirname(__file__), '..')) import messagebird # ACCESS_KEY = '' # MESSAGE_ID = '' try: ACCESS_KEY except NameError: print('You need to set an ACCESS_KEY constant in this file') sys.exit(1) try: MESSAGE_ID except NameError: print('Yo...
messagebird/python-rest-api
examples/voice_message.py
Python
bsd-2-clause
1,642
0.017052
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest from nose.tools import * # noqa; PEP8 asserts from webtest_plus import TestApp import mock import httplib as http from flask import Flask from modularodm import Q from werkzeug.wrappers import BaseResponse from framework import auth from framework.auth im...
brandonPurvis/osf.io
tests/test_auth.py
Python
apache-2.0
13,540
0.000517
import json import etcd from tendrl.gluster_bridge.atoms.volume.set import Set class SetVolumeOption(object): def __init__(self, api_job): super(SetVolumeOption, self).__init__() self.api_job = api_job self.atom = SetVolumeOption def start(self): attributes = json.loads(self....
shtripat/gluster_bridge
tendrl/gluster_bridge/flows/set_volume_option.py
Python
lgpl-2.1
705
0
#!/usr/bin/python # # Copyright 2013 Google Inc. 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 b...
caioserra/apiAdwords
examples/adspygoogle/dfp/v201308/get_user_team_association.py
Python
apache-2.0
1,916
0.001566
import re from ert_gui.ide.keywords.definitions import ArgumentDefinition class RangeStringArgument(ArgumentDefinition): NOT_A_VALID_RANGE_STRING = "The input should be of the type: <b><pre>\n\t1,3-5,9,17\n</pre></b>i.e. integer values separated by commas, and dashes to represent ranges." VALUE_NOT_IN_RANGE ...
arielalmendral/ert
python/python/ert_gui/ide/keywords/definitions/range_string_argument.py
Python
gpl-3.0
2,862
0.004892
# Twisted, the Framework of Your Internet # Copyright (C) 2001-2003 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed i...
fxia22/ASM_xf
PythonD/site_python/twisted/im/tocsupport.py
Python
gpl-2.0
8,589
0.014321
#!/usr/bin/env python # -*- coding=utf8 -*- """clear the mysql database yjy_archtecture tables in aa.txt""" import MySQLdb as mdb db_conn = mdb.connect("localhost","root","HEkgDDZZ","yjy_human") cursor = db_conn.cursor() with open("/root/scripts/clear_human_sql.tables") as f: tables = f.readlines() print tables try...
lgh8820/ansible-test
yjy_all_scripts/clear_arch_tables.py
Python
mit
630
0.036508
#!/usr/bin/env python3 # Copyright (c) 2017-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test message sending before handshake completion. Before receiving a VERACK, a node should not send an...
JeremyRubin/bitcoin
test/functional/p2p_leak.py
Python
mit
7,392
0.001894
#!/usr/bin/python -Wall # ================================================================ # John Kerl # kerl.john.r@gmail.com # 2008-02-06 # ================================================================ from __future__ import division # 1/2 = 0.5, not 0. import sys import randc_m # For random complex scalars impo...
johnkerl/scripts-math
pythonlib/randmatc_m.py
Python
bsd-2-clause
1,088
0.02114
from django.db import models from .user import User from .post import Post class Medal(models.Model): rank = models.IntegerField() user = models.ForeignKey(User, related_name='medals') post = models.OneToOneField(Post, on_delete=models.CASCADE, related_name='medal') def __str__(self): ...
frostblooded/kanq
api/models/medal.py
Python
mit
373
0.002681
from __future__ import unicode_literals import fnmatch import glob import io import os import re import sys from itertools import dropwhile import django from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.core.management.utils import ( find...
diego-d5000/MisValesMd
env/lib/python2.7/site-packages/django/core/management/commands/makemessages.py
Python
mit
22,994
0.003305
from steerclear import app from steerclear.forms import RideForm from steerclear.models import * import unittest, flask """ RideFormTestCase ---------------- Test class for the RideForm class """ class RideFormTestCase(unittest.TestCase): """ submit_form ----------- helper method to submit a RideForm ...
beblount/Steer-Clear-Backend
tests/forms_tests.py
Python
mit
3,278
0.00061
''' urlresolver XBMC Addon Copyright (C) 2017 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 later version. This program is distribu...
dbiesecke/dbiesecke.github.io
repo/script.module.urlresolver/lib/urlresolver/plugins/bitporno.py
Python
mit
1,372
0.005831
from django.conf.urls import url from . import views app_name = 'persons' urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^contact/$', views.contact, name='contact'), url(r'^thanks/$', views.thanks, name='thanks'), url(r'^upload/$', views.upload_file, name='upload_file'), url(r'^success...
grodrigo/django_general
persons/urls.py
Python
gpl-3.0
427
0
import cStringIO as StringIO import pytest import time from Connection import ConnectionServer from Connection import Connection from File import FileServer @pytest.mark.usefixtures("resetSettings") @pytest.mark.usefixtures("resetTempSettings") class TestFileRequest: def testGetFile(self, file_server, site): ...
l5h5t7/ZeroNet
src/Test/TestFileRequest.py
Python
gpl-2.0
3,984
0.00251
from gonullu.farm import Farm from gonullu.docker import Docker from gonullu.volunteer import Volunteer from gonullu.log import Log
PisiLinuxNew/gonullu
gonullu/__init__.py
Python
gpl-3.0
132
0