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
# -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2016-10-27 09:40 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('images', '0002_alter_fields'), ] operations = [ migrations.AlterField( ...
fidals/refarm-site
images/migrations/0003_auto_20161027_0940.py
Python
mit
456
0
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsLayoutItemLegend. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. "...
CS-SI/QGIS
tests/src/python/test_qgslayoutlegend.py
Python
gpl-2.0
9,958
0.000402
import unittest from coval.es import * class CodeValidatorEsTestCase(unittest.TestCase): def setUp(self): pass def test_cif(self): self.assertTrue(cif('A58818501')) self.assertTrue(cif('B00000000')) self.assertTrue(cif('C0000000J')) self.assertTrue(cif('D00000000')) ...
jespino/coval
tests/es_tests.py
Python
bsd-3-clause
4,205
0.004518
from django.shortcuts import render from django.http import Http404 def index(request): return render(request, 'map/index.html')
BrendonKing32/Traffic-Assistant
map/views.py
Python
gpl-3.0
135
0
# You will need maestro.py from https://github.com/FRC4564/Maestro # # This is also just a place holder, it has not be tested with an actual # bot. import sys import time try: import hardware/maestro except ImportError: print "You are missing the maestro.py file from the hardware subdirectory." print "Plea...
Nocturnal42/runmyrobot
hardware/maestro-servo.py
Python
apache-2.0
1,417
0.007763
# -*- coding: utf-8 -*- # Copyright 2012-2013 UNED # # 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...
OpenMOOC/moocng
moocng/courses/urls.py
Python
apache-2.0
2,701
0.001481
zone_file = '/etc/bind/zones/db.circulospodemos.info'
Podemos-TICS/Creaci-n-Wordpress
scripts/deploy/Constants.py
Python
gpl-2.0
54
0
# -*- coding: utf-8 -*- """ Display network speed and bandwidth usage. Configuration parameters: cache_timeout: refresh interval for this module (default 2) format: display format for this module *(default '{nic} [\?color=down LAN(Kb): {down}↓ {up}↑] [\?color=total T(Mb): {download}↓ {upload}↑ ...
alexoneill/py3status
py3status/modules/netdata.py
Python
bsd-3-clause
5,963
0.000674
from django.core.management import BaseCommand from newsfeed.models import Entry from premises.models import Contention class Command(BaseCommand): def handle(self, *args, **options): for contention in Contention.objects.all(): Entry.objects.create( object_id=contention.id, ...
beratdogan/arguman.org
web/newsfeed/management/commands/create_initial_newsfeed.py
Python
mit
557
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import mmap import re import collections import math import detectlanguage import codecs detectlanguage.configuration.api_key = "d6ed8c76914a9809b58c2e11904fbaa3" class Analyzer: def __init__(self, passwd): self.evaluation = {} self._passwd = passwd ...
haastt/analisador
src/Analyzer.py
Python
mit
8,325
0.008892
"""Top-level module for releng-sop."""
release-engineering/releng-sop
releng_sop/__init__.py
Python
mit
39
0
""" Created on 16 May 2017 @author: Bruno Beloff (bruno.beloff@southcoastscience.com) Note: time shall always be stored as UTC, then localized on retrieval. """ from scs_core.data.rtc_datetime import RTCDatetime from scs_host.bus.i2c import I2C from scs_host.lock.lock import Lock # -------------------------------...
south-coast-science/scs_dfe_eng
src/scs_dfe/time/ds1338.py
Python
mit
5,825
0.006695
# -*- coding: utf-8 -*- """Module providing views for the site navigation root""" from Acquisition import aq_inner from Products.Five.browser import BrowserView from Products.ZCatalog.interfaces import ICatalogBrain from plone import api from plone.app.contentlisting.interfaces import IContentListing from plone.app.con...
a25kk/dpf
src/dpf.sitecontent/dpf/sitecontent/browser/frontpage.py
Python
mit
3,589
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from PyQt5 import QtWidgets from view.analysis_widget import AnalysisWidget # noinspection PyPep8Naming class TemporalAnalysisWidget(AnalysisWidget): # noinspection PyArgumentList def __init__(self, mplCanvas): """ Construct the Temporal Analys...
yuwen41200/biodiversity-analysis
src/view/temporal_analysis_widget.py
Python
gpl-3.0
1,068
0
from discord.ext import commands import discord.utils def is_owner_check(ctx): author = str(ctx.message.author) owner = ctx.bot.config['master'] return author == owner def is_owner(): return commands.check(is_owner_check) def check_permissions(ctx, perms): #if is_owner_check(ctx): # return...
Jonqora/whiskers
checks.py
Python
gpl-3.0
5,290
0.006994
# -*- coding: utf-8 -*- # libavg - Media Playback Engine. # Copyright (C) 2003-2011 Ulrich von Zadow # # 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 of the License, o...
pararthshah/libavg-vaapi
src/python/ui/scrollarea.py
Python
lgpl-2.1
7,235
0.002626
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
2013Commons/HUE-SHARK
apps/filebrowser/src/filebrowser/settings.py
Python
apache-2.0
946
0
# Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None class Solution(object): def rotateRight(self, head, k): """ :type head: ListNode :type k: int :rtype: ListNode """ if not head: return None p = head listLen = 0 # calculate ...
xiaonanln/myleetcode-python
src/61. Rotate List.py
Python
apache-2.0
732
0.080601
#!/usr/bin/env python # # Copyright 2015-2021 Flavio Garcia # # 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...
piraz/firenado
tests/util/sqlalchemy_util_test.py
Python
apache-2.0
3,289
0
# Lint as: python3 # Copyright 2020 The Bazel 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 requir...
twitter-forks/bazel
tools/ctexplain/types.py
Python
apache-2.0
3,539
0.010455
import logging from .base import SdoBase from .constants import * from .exceptions import * logger = logging.getLogger(__name__) class SdoServer(SdoBase): """Creates an SDO server.""" def __init__(self, rx_cobid, tx_cobid, node): """ :param int rx_cobid: COB-ID that the server r...
christiansandberg/canopen
canopen/sdo/server.py
Python
mit
7,569
0.001057
import wx import eos.db import gui.mainFrame from gui import globalEvents as GE from gui.fitCommands.calc.module.projectedAdd import CalcAddProjectedModuleCommand from gui.fitCommands.helpers import InternalCommandHistory, ModuleInfo from service.fit import Fit class GuiAddProjectedModuleCommand(wx.Command): de...
pyfa-org/Pyfa
gui/fitCommands/gui/projectedModule/add.py
Python
gpl-3.0
1,334
0.002999
# Copyright (c) 2015, Michael Boyle # See LICENSE file for details: <https://github.com/moble/scri/blob/master/LICENSE> import pytest import numpy as np from numpy import * import quaternion import spherical_functions as sf import scri from conftest import linear_waveform, constant_waveform, random_waveform, delta_wa...
moble/scri
tests/test_rotations.py
Python
mit
10,004
0.003898
# -*- coding: utf-8 -*- # Copyright 2017 IBM RESEARCH. 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 requ...
ChristopheVuillot/qiskit-sdk-py
qiskit/qasm/_node/_nodeexception.py
Python
apache-2.0
1,054
0
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import loggi...
nistormihai/superdesk-core
apps/publish/__init__.py
Python
agpl-3.0
2,426
0.004122
# coding=utf-8 # Copyright 2020 The TF-Agents Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
tensorflow/agents
tf_agents/networks/categorical_q_network_test.py
Python
apache-2.0
6,673
0.001049
#coding:utf-8 ''' Timeouts超时设置 requests.get('http://github.com', timeout=2) '''
qiyeboy/SpiderBook
ch03/3.2.3.7.py
Python
mit
91
0.012048
# 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...
mlperf/training_results_v0.6
Fujitsu/benchmarks/resnet/implementations/mxnet/tests/python/gpu/test_kvstore_gpu.py
Python
apache-2.0
6,181
0.003721
# -*- coding: utf-8 -*- """Unit and functional test suite for tg2express.""" from os import getcwd, path from paste.deploy import loadapp from webtest import TestApp from gearbox.commands.setup_app import SetupAppCommand from tg import config from tg.util import Bunch from tg2express import model __all__ = ['setup...
archsh/tg2ext.express
example/tg2express/tests/__init__.py
Python
mit
2,131
0
# -*- coding: utf-8 -*- from __future__ import print_function """ ScriptProcessor processes a script file (generally), loading data using the requested loading routine and printing This is part of Acq4 Paul B. Manis, Ph.D. 2011-2013. Pep8 compliant (via pep8.py) 10/25/2013 Refactoring begun 3/21/2015 """ import ...
pbmanis/acq4
acq4/analysis/tools/ScriptProcessor.py
Python
mit
13,216
0.004994
import requests headers = { 'foo': 'bar', } response = requests.get('http://example.com/', headers=headers)
NickCarneiro/curlconverter
fixtures/python/get_with_single_header.py
Python
mit
114
0
# Generated by Django 2.0 on 2018-02-08 11:45 from django.db import migrations def forwards(apps, schema_editor): """ Change all DancePiece objects into Work objects, and their associated data into WorkRole and WorkSelection models, then delete the DancePiece. """ DancePiece = apps.get_model("spe...
philgyford/django-spectator
spectator/events/migrations/0028_dancepieces_to_works.py
Python
mit
1,326
0
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "social_news_site.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
lewfish/django-social-news
manage.py
Python
mit
259
0.003861
# -*- coding: utf-8 -*- # Copyright 2019 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. """An implementation of the ReplicationConfig proto interface.""" from __future__ import print_function import json import os im...
endlessm/chromium-browser
third_party/chromite/lib/replication_lib.py
Python
bsd-3-clause
5,370
0.007263
import mock from nose.tools import eq_, ok_, assert_raises from funfactory.urlresolvers import reverse from .base import ManageTestCase class TestErrorTrigger(ManageTestCase): def test_trigger_error(self): url = reverse('manage:error_trigger') response = self.client.get(url) assert self...
zofuthan/airmozilla
airmozilla/manage/tests/views/test_errors.py
Python
bsd-3-clause
1,278
0
# -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-03-18 09:59 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('order_reminder', '0001_initial'), ] operations = [ migrations.AddField( ...
forance/django-q
djangoq_demo/order_reminder/migrations/0002_auto_20160318_1759.py
Python
mit
858
0.001166
import sys import os brief = "create a test for controller" def usage(argv0): print("Usage: {} generate test controller CONTROLLER_NAME METHOD [METHOD] [...]".format(argv0)) sys.exit(1) aliases = ['c'] def execute(argv, argv0, engine): import lib, inflection os.environ.setdefault("AIOWEB_SETTINGS...
kreopt/aioweb
wyrm/modules/generate/test/controller.py
Python
mit
1,437
0.004175
'''build RoboFont Extension''' import os from AppKit import NSCommandKeyMask, NSAlternateKeyMask, NSShiftKeyMask from mojo.extensions import ExtensionBundle # get current folder basePath = os.path.dirname(__file__) # source folder for all extension files sourcePath = os.path.join(basePath, 'source') # folder with p...
roboDocs/rf-extension-boilerplate
build.py
Python
mit
2,609
0.000383
#!/usr/bin/python #coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.com> # # This module 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 optio...
adityacs/ansible
lib/ansible/modules/web_infrastructure/ansible_tower/tower_host.py
Python
gpl-3.0
5,874
0.005958
"""Tests for account activation""" import unittest from uuid import uuid4 from django.conf import settings from django.core.urlresolvers import reverse from django.test import TestCase, override_settings from mock import patch from edxmako.shortcuts import render_to_string from openedx.core.djangoapps.site_configurat...
procangroup/edx-platform
common/djangoapps/student/tests/test_activate_account.py
Python
agpl-3.0
8,881
0.002365
#!/usr/bin/env python # This file provided by Facebook is for non-commercial testing and evaluation # purposes only. Facebook reserves all rights not expressly granted. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL...
kaoree/fresco
run_comparison.py
Python
bsd-3-clause
7,775
0.002058
#!/usr/bin/env python ergodoxian = ( ("KEY_DeleteBackspace","1x2"), ("KEY_DeleteForward","1x2"), ('KEY_ReturnEnter', '1x2'), ('KEY_Spacebar', '1x2'), ('SPECIAL_Fn', '1x2'), ('KEY_Shift', '1.5x1'), ('KEY_Shift', '1.5x1'), ("KEY_Dash_Underscore", "1.5x1"), ("KEY_Equal_Plus", "1.5x1"), ('KEY_ReturnEnter', '1.5x1'), ("KEY...
jdeblese/ergovolve
proposals.py
Python
mit
3,554
0.037141
# -*- coding: utf-8 -*- """ @created: Thu Jul 02 10:56:57 2015 Usage: main.py Options: -h --help # Show this screen. --version # Show version. """ ### Imports # Standard Library from __future__ import print_function, division from __future__ import absolute_import ...
dougthor42/TPEdit
tpedit/main.py
Python
gpl-3.0
33,403
0.000419
""" Author : tharindra galahena (inf0_warri0r) Project: l_viewer Blog : http://www.inf0warri0r.blogspot.com Date : 30/04/2013 License: Copyright 2013 Tharindra Galahena l_viewer is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Fr...
inf0-warri0r/l_viewer
display.py
Python
agpl-3.0
9,288
0.002046
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2008 Zsolt Foldvari # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) ...
arunkgupta/gramps
gramps/gen/lib/styledtexttag.py
Python
gpl-2.0
4,127
0.005331
# Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. import time import os.path from collections import OrderedDict, namedtuple import gevent import flask from digits import device_query from digits.task import Task from digits.utils import subclass, override # NOTE: Increment this everytime the pic...
batra-mlp-lab/DIGITS
digits/model/tasks/train.py
Python
bsd-3-clause
19,069
0.002203
#!/usr/bin/env python import unittest import importlib import random from mock import patch vis_map = importlib.import_module('ciftify.bin.cifti_vis_map') class TestUserSettings(unittest.TestCase): temp = '/tmp/fake_temp_dir' palette = 'PALETTE-NAME' def test_snap_set_to_none_when_in_index_mode(self): ...
BrainIntensive/OnlineBrainIntensive
resources/HCP/ciftify/tests/test_cifti_vis_map.py
Python
mit
7,233
0.002627
# -*- coding: utf-8 -*- from odoo import http from odoo.addons.website_sale_delivery.controllers.main import WebsiteSaleDelivery from odoo.http import request class WebsiteSaleCouponDelivery(WebsiteSaleDelivery): @http.route() def update_eshop_carrier(self, **post): Monetary = request.env['ir.qweb.fi...
rven/odoo
addons/website_sale_coupon_delivery/controllers/main.py
Python
agpl-3.0
2,386
0.004191
# 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) class VersionTestDependencyPreferred(AutotoolsPackage): """Dependency of version-test-pkg, which has a multi-valued ...
LLNL/spack
var/spack/repos/builtin.mock/packages/version-test-dependency-preferred/package.py
Python
lgpl-2.1
794
0.001259
import deep_architect.searchers.common as se import numpy as np # NOTE: this searcher does not do any budget adjustment and needs to be # combined with an evaluator that does. class SuccessiveNarrowing(se.Searcher): def __init__(self, search_space_fn, num_initial_samples, reduction_factor, reset...
negrinho/deep_architect
deep_architect/searchers/successive_narrowing.py
Python
mit
3,234
0
import logging import os import ctypes import ctypes.util log = logging.getLogger("lrrbot.systemd") try: libsystemd = ctypes.CDLL(ctypes.util.find_library("systemd")) libsystemd.sd_notify.argtypes = [ctypes.c_int, ctypes.c_char_p] def notify(status): libsystemd.sd_notify(0, status.encode('utf-8')) except OSErr...
andreasots/lrrbot
lrrbot/systemd.py
Python
apache-2.0
992
0.025202
""" Small event module ======================= """ import numpy as np import logging logger = logging.getLogger(__name__) from ...utils.decorators import face_lookup from ...geometry.sheet_geometry import SheetGeometry from ...topology.sheet_topology import cell_division from .actions import ( exchange, r...
CellModels/tyssue
tyssue/behaviors/sheet/basic_events.py
Python
gpl-2.0
6,721
0.001785
# 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...
RobinQuetin/CAIRIS-web
cairis/cairis/RiskScatterPanel.py
Python
apache-2.0
3,503
0.017985
from course import Course from course_offering import CourseOffering from distributive_requirement import DistributiveRequirement from instructor import Instructor from course_median import CourseMedian from review import Review from vote import Vote from student import Student
layuplist/layup-list
apps/web/models/__init__.py
Python
gpl-3.0
279
0
"""Elmax integration common classes and utilities.""" from __future__ import annotations from datetime import timedelta import logging from logging import Logger import async_timeout from elmax_api.exceptions import ( ElmaxApiError, ElmaxBadLoginError, ElmaxBadPinError, ElmaxNetworkError, ) from elmax...
rohitranjan1991/home-assistant
homeassistant/components/elmax/common.py
Python
mit
5,658
0.001414
""" Transform 2019: Integrating Striplog and GemPy ============================================== """ # %% # ! pip install welly striplog # %% # Authors: M. de la Varga, Evan Bianco, Brian Burnham and Dieter Werthmüller # Importing GemPy import gempy as gp # Importing auxiliary libraries import numpy as np import...
cgre-aachen/gempy
examples/integrations/gempy_striplog.py
Python
lgpl-3.0
5,611
0.006595
import time from goose import Goose def load_jezebel(): with open('resources/additional_html/jezebel1.txt') as f: data = f.read() return data def bench(iterations=100): data = load_jezebel() goose = Goose() times = [] for _ in xrange(iterations): t1 = time.time() goose....
scivey/goosepp
scripts/benchmark_python_goose.py
Python
mit
648
0.00463
''' Created on 2014-8-1 @author: xiajie ''' import numpy as np def fmax(a, b): if a >= b: return a else: return b def fmin(a, b): if a <= b: return a else: return b def radia_kernel(x1, x2): return np.transpose(x1).dot(x2) def kernel(x1, x2): d = x1 -...
jayshonzs/ESL
SVM/SMO.py
Python
mit
5,230
0.005354
from ..models import models class RasterModel(models.Model): rast = models.RasterField('A Verbose Raster Name', null=True, srid=4326, spatial_index=True, blank=True) class Meta: required_db_features = ['supports_raster'] def __str__(self): return str(self.id)
DONIKAN/django
tests/gis_tests/rasterapp/models.py
Python
bsd-3-clause
292
0.003425
""" super simple utitities to display tabular data columns is a list of tuples: - name: header name for the column - f: a function which takes one argument *row* and returns the value to display for a cell. the function which be called for each of the rows supplied """ import sys import csv def...
Livefyre/awscensus
ec2/tabular.py
Python
mit
990
0
#!/usr/bin/env python # # Copyright 2011 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) ...
tta/gnuradio-tta
gr-uhd/apps/uhd_rx_cfile.py
Python
gpl-3.0
5,930
0.006071
# # 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 # ...
noironetworks/heat
heat/engine/resources/openstack/heat/random_string.py
Python
apache-2.0
9,442
0
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "vgid.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
Guest007/vgid
manage.py
Python
mit
247
0
# -*- coding: utf-8 -*- """ Test accounts module """ import os from decimal import Decimal from mock import patch from django.core.urlresolvers import reverse from django.http import HttpResponseForbidden from django.test import TestCase from .factories import UserFactory, UserWithAvatarFactory, AdminFactory from .mo...
KlubJagiellonski/Politikon
accounts/tests.py
Python
gpl-2.0
18,113
0.000276
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # 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...
ptisserand/ansible
lib/ansible/plugins/strategy/__init__.py
Python
gpl-3.0
51,787
0.002819
# Licensed under a 3-clause BSD style license - see LICENSE.rst # namedtuple is needed for find_mod_objs so it can have a non-local module from collections import namedtuple from unittest import mock import pytest import yaml from astropy.utils import introspection from astropy.utils.introspection import (find_curre...
pllim/astropy
astropy/utils/tests/test_introspection.py
Python
bsd-3-clause
3,422
0.000292
"""Class for storing shared keys.""" from utils.cryptomath import * from utils.compat import * from mathtls import * from Session import Session from BaseDB import BaseDB class SharedKeyDB(BaseDB): """This class represent an in-memory or on-disk database of shared keys. A SharedKeyDB can be passed to a s...
edisonlz/fruit
web_project/base/site-packages/gdata/tlslite/SharedKeyDB.py
Python
apache-2.0
1,914
0.00209
# -*- coding: utf-8 -*- # # Copyright © 2011 Pierre Raybaut # Licensed under the terms of the MIT License # (see spyderlib/__init__.py for details) """IPython v0.11+ Plugin""" from spyderlib.qt.QtGui import QHBoxLayout # Local imports from spyderlib.widgets.ipython import create_widget from spyderlib.plu...
jromang/retina-old
distinclude/spyderlib/plugins/ipython.py
Python
gpl-3.0
2,012
0.006464
# Orca # # Copyright 2006-2009 Sun Microsystems Inc. # Copyright 2010 Joanmarie Diggs # # 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, or (at your op...
ruibarreira/linuxtrail
usr/lib/python3/dist-packages/orca/scripts/toolkits/J2SE-access-bridge/script.py
Python
gpl-3.0
10,245
0.001659
default_app_config = 'mtr.sync.apps.MtrSyncConfig'
mtrgroup/django-mtr-sync
mtr/sync/__init__.py
Python
mit
51
0
#!/bin/python3 import argparse import code import readline import signal import sys import capstone from load import ELF def SigHandler_SIGINT(signum, frame): print() sys.exit(0) class Argparser(object): def __init__(self): parser = argparse.ArgumentParser() parser.add_argument("--arglist...
bloodstalker/mutator
bfd/codegen.py
Python
gpl-3.0
1,436
0.008357
import vk import json from sentiment_classifiers import SentimentClassifier, binary_dict, files class VkFeatureProvider(object): def __init__(self): self._vk_api = vk.API(vk.Session()) self._vk_delay = 0.3 self._clf = SentimentClassifier(files['binary_goods'], binary_dict) def _vk_grac...
ArtemMIPT/sentiment_analysis
vk_parser.py
Python
mit
2,902
0.005513
"""SCons.Tool.FortranCommon Stuff for processing Fortran, common to all fortran dialects. """ # # Copyright (c) 2001 - 2015 The SCons Foundation # # 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 So...
Uli1/mapnik
scons/scons-local-2.4.0/SCons/Tool/FortranCommon.py
Python
lgpl-2.1
10,707
0.006538
import gc import os import argparse os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' from util import generate_features def get_arguments(): parser = argparse.ArgumentParser(description='Generate features using a previously trained model') parser.add_argument('data', type=str, help='File containing the input smiles m...
patrick-winter-knime/deep-learning-on-molecules
smiles-vhts/generate_features.py
Python
gpl-3.0
769
0.007802
# -*- coding: utf-8 -*- """ *************************************************************************** r_li_richness_ascii.py ---------------------- Date : February 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr **************...
stevenmizuno/QGIS
python/plugins/processing/algs/grass7/ext/r_li_richness_ascii.py
Python
gpl-2.0
1,514
0
import pyaudio import wave #CHUNK = 1024 CHUNK = 1 FORMAT = pyaudio.paInt16 #CHANNELS = 2 CHANNELS = 1 #RATE = 44100 RATE = 10025 RECORD_SECONDS = 5 WAVE_OUTPUT_FILENAME = "output.wav" p = pyaudio.PyAudio() stream = p.open(format=FORMAT, channels=CHANNELS, rate=RATE, i...
rzzzwilson/morse
morse/test.py
Python
mit
682
0.005865
# Copyright (C) 2014,2015 VA Linux Systems Japan K.K. # Copyright (C) 2014,2015 YAMAMOTO Takashi <yamamoto at valinux co jp> # 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 t...
eayunstack/neutron
neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/openflow/native/test_br_int.py
Python
apache-2.0
17,011
0.002116
import re import transaction from ..models import DBSession SQL_TABLE = """ SELECT c.oid, n.nspname, c.relname FROM pg_catalog.pg_class c LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace WHERE c.relname = :table_name AND pg_catalog.pg_table_is_visible(c.oid) ORDER BY 2, 3 """ SQL_TABLE_SCHEM...
aagusti/osipkd-json-rpc
jsonrpc/scripts/DbTools.py
Python
lgpl-2.1
3,322
0.003612
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'ProjectBadge.awardLevel' db.add_column(u'badges_projectbadge', 'awardLevel', ...
ngageoint/gamification-server
gamification/badges/migrations/0002_auto__add_field_projectbadge_awardLevel__add_field_projectbadge_multip.py
Python
mit
8,179
0.007214
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2016-11-19 18:40 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('mqtt_logger', '0002_mqttsubscription_active'), ] operations = [ migrations.AlterMod...
ast0815/mqtt-hub
mqtt_logger/migrations/0003_auto_20161119_1840.py
Python
mit
664
0.003012
# Hack, hide DataLossWarnings # Based on html5lib code namespaceHTMLElements=False should do it, but nope ... # Also it doesn't seem to be available in older version from html5lib, removing it import warnings from typing import IO, Union from bs4 import BeautifulSoup from html5lib.constants import DataLossWarning war...
Flexget/Flexget
flexget/utils/soup.py
Python
mit
491
0.004073
import requests LRS = "http://cygnus.ic.uva.nl:8000/XAPI/statements" u = raw_input("LRS username: ") p = raw_input("LRS password: ") r = requests.get(LRS,headers={"X-Experience-API-Version":"1.0"},auth=(u,p)); if r.status_code == 200: print "Success" else: print "Server returns",r.status_code
ictofnwi/coach
test_lrs.py
Python
agpl-3.0
305
0.019672
import pytest from plenum.test.helper import perf_monitor_disabled from plenum.test.node_catchup.helper import ensure_all_nodes_have_same_data from plenum.test.view_change_with_delays.helper import \ do_view_change_with_propagate_primary_on_one_delayed_node # This is needed only with current view change implement...
evernym/zeno
plenum/test/view_change_with_delays/test_view_change_with_propagate_primary_on_one_delayed_node.py
Python
apache-2.0
1,269
0.001576
""" Defines the Sumatra version control interface for Git. Classes ------- GitWorkingCopy GitRepository :copyright: Copyright 2006-2015 by the Sumatra team, see doc/authors.txt :license: BSD 2-clause, see LICENSE for details. """ from __future__ import print_function from __future__ import absolute_import from __fu...
maxalbert/sumatra
sumatra/versioncontrol/_git.py
Python
bsd-2-clause
6,219
0.002573
# Copyright 2013-2020 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) from spack import * class Claw(CMakePackage): """CLAW Compiler targets performance portability problem in climate an...
rspavel/spack
var/spack/repos/builtin/packages/claw/package.py
Python
lgpl-2.1
1,854
0.004854
from __future__ import division from sys import stdin, stdout from collections import deque def solve(n, edges, s): def build_graph(n, edges): graph = [[] for _ in range(n)] for (a, b) in edges: a, b = a - 1, b - 1 graph[a].append(b) graph[b].append(a) re...
m00nlight/hackerrank
algorithm/Graph-Theory/Breadth-First-Search-Shortest-Reach/main.py
Python
gpl-2.0
1,017
0.00295
# -*- coding: utf-8 -*- # Generated by Django 1.11.10 on 2018-04-16 16:39 from __future__ import unicode_literals import base.models.learning_unit_year import django.core.validators from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ...
uclouvain/osis_louvain
base/migrations/0260_auto_20180416_1839.py
Python
agpl-3.0
4,812
0.003117
from api_linked_rpc import * #@UnusedWildImport
linkedin/indextank-service
nebu/rpc.py
Python
apache-2.0
48
0.041667
puts(green("installing MidoNet cli on %s" % env.host_string)) args = {} Puppet.apply('midonet::midonet_cli', args, metadata) run(""" cat >/root/.midonetrc <<EOF [cli] api_url = http://%s:8080/midonet-api username = admin password = admin project_id = admin tenant = admin EOF """ % metadata.servers...
midonet/Chimata-No-Kami
stages/midonet_cli/fabfile.py
Python
apache-2.0
363
0.00551
import unittest from bolt.core.plugin import Plugin from bolt import interval from bolt import Bot import yaml class TestIntervalPlugin(Plugin): @interval(60) def intervaltest(self): pass class TestInterval(unittest.TestCase): def setUp(self): self.config_file = "/tmp/bolt-test-config.y...
Arcbot-Org/Arcbot
tests/core/test_interval.py
Python
gpl-3.0
910
0
""" Django settings for pennapps project. Generated by 'django-admin startproject' using Django 1.8.4. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build pat...
raoariel/PennApps-F15
pennapps/pennapps/settings.py
Python
mit
2,659
0
# coding=utf-8 import unittest from text import grep from text import string_utils import text_test class GrepTest(unittest.TestCase): def test_grep(self): log_list = text_test.read_log() linux_syslog_head = '(\S+\s+\d+)\s+(\d+:\d+:\d+)\s+(\S+)\s+' group_data = grep.grep...
interhui/py-text
text_test/grep_test.py
Python
apache-2.0
1,719
0.016289
# Copyright (C) 2013 Andrew Okin # 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, merge, publish, distribu...
Forkk/Sporkk-Pastebin
sporkk/views.py
Python
mit
4,231
0.022453
import pprint import sys from xml.dom import xmlbuilder, expatbuilder, Node from xml.dom.NodeFilter import NodeFilter class Filter(xmlbuilder.DOMBuilderFilter): whatToShow = NodeFilter.SHOW_ELEMENT def startContainer(self, node): assert node.nodeType == Node.ELEMENT_NODE if node.tagName == "s...
Pikecillo/genna
external/PyXML-0.8.4/test/test_filter.py
Python
gpl-2.0
5,625
0.000533
# # Copyright 2009-2010 Goran Sterjov # This file is part of Myelin. # # Myelin 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 3 of the License, or # (at your option) a...
gsterjov/Myelin
bindings/python/myelin/introspection/value.py
Python
gpl-3.0
11,453
0.024797
# -*- Mode: Python; py-indent-offset: 4 -*- # coding=utf-8 # vim: tabstop=4 shiftwidth=4 expandtab import unittest import sys sys.path.insert(0, "../") import sys import copy try: import cairo has_cairo = True except ImportError: has_cairo = False from gi.repository import GObject from gi.repository imp...
jdahlin/pygobject
tests/test_everything.py
Python
lgpl-2.1
23,544
0.000935
""" Unit tests for the red2d (3-7-column) reader """ import warnings warnings.simplefilter("ignore") import unittest from sas.sascalc.dataloader.loader import Loader import os.path class abs_reader(unittest.TestCase): def setUp(self): self.loader = Loader() def test_checkdata(self): ""...
lewisodriscoll/sasview
test/sasdataloader/test/utest_red2d_reader.py
Python
bsd-3-clause
844
0.009479
# # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
oVirt/ovirt-scheduler-proxy
src/ovirtscheduler/runner.py
Python
apache-2.0
2,775
0
import keyword import sys import warnings import rope.base.codeanalyze import rope.base.evaluate from rope.base import pyobjects, pyobjectsdef, pynames, builtins, exceptions, worder from rope.base.codeanalyze import SourceLinesAdapter from rope.contrib import fixsyntax from rope.refactor import functionutils def cod...
JetChars/vim
vim/bundle/python-mode/pymode/libs3/rope/contrib/codeassist.py
Python
apache-2.0
25,419
0.000669
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import shutil import...
pgroudas/pants
tests/python/pants_test/tasks/test_cache_manager.py
Python
apache-2.0
4,697
0.006813