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 -*-
# MIT License
#
# Copyright (c) 2017 Tijme Gommers
#
# 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... | tijme/angularjs-sandbox-escape-scanner | acstis/Scanner.py | Python | mit | 5,980 | 0.002007 |
import zeeguu_core
from zeeguu_core.model import Article, Language, LocalizedTopic
session = zeeguu_core.db.session
counter = 0
languages = Language.available_languages()
languages = [Language.find('da')]
for language in languages:
articles = Article.query.filter(Article.language == language).order_by(Article.i... | mircealungu/Zeeguu-Core | tools/tag_topics_in_danish.py | Python | mit | 1,205 | 0.00249 |
from tictactoe import game, player
import unittest
from unittest import mock
class GameTest(unittest.TestCase):
def setUp(self):
self.num_of_players = 2
self.width = 3
self.height = 3
self.game = game.Game(2, 3, 3)
def test_init(self):
self.assertEqual(self.game.board,... | jureslak/racunalniske-delavnice | fmf/python_v_divjini/projekt/test/test_game.py | Python | gpl-2.0 | 1,623 | 0.000616 |
'''
'''
from rest_framework import serializers
import models
class PluginSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = models.Plugin
fields = ('id', 'name', )
class ScoredServiceSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = models... | nuccdc/scoring_engine | scoring_engine/engine/serializers.py | Python | mit | 1,320 | 0.000758 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-14 12:09
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('account', '0005_user_last_... | jabber-at/hp | hp/account/migrations/0006_notifications.py | Python | gpl-3.0 | 1,200 | 0.0025 |
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 aut... | sirkubax/ansible | lib/ansible/module_utils/cloudstack.py | Python | gpl-3.0 | 13,783 | 0.004136 |
import logging
from borgmatic.borg.flags import make_flags, make_flags_from_arguments
from borgmatic.execute import execute_command
logger = logging.getLogger(__name__)
# A hack to convince Borg to exclude archives ending in ".checkpoint". This assumes that a
# non-checkpoint archive name ends in a digit (e.g. from... | witten/borgmatic | borgmatic/borg/list.py | Python | gpl-3.0 | 3,343 | 0.003889 |
import datetime
import io
import boto3
import mock
import pytest
import requests
import testfixtures
from botocore.exceptions import ClientError
from opentracing.ext import tags
from opentracing_instrumentation.client_hooks import boto3 as boto3_hooks
DYNAMODB_ENDPOINT_URL = 'http://localhost:4569'
S3_ENDPOINT_URL... | uber-common/opentracing-python-instrumentation | tests/opentracing_instrumentation/test_boto3.py | Python | mit | 6,158 | 0 |
import unittest
from dosbox.filesystem.directory import *
class DirectoryTestCase(unittest.TestCase):
def setUp(self):
self.root_dir = Directory("root")
self.sub_dir1 = Directory("subdir1")
def test_path(self):
self.root_dir.add(self.sub_dir1)
self.assertEqual(self.sub_dir1.p... | jpartogi/DOSBox.py | tests/filesystem/directory.py | Python | gpl-3.0 | 733 | 0.004093 |
# -*- coding: utf-8 -*-
# Scrapy settings for saymedia project
#
# For simplicity, this file contains only the most important settings by
# default. All the other settings are documented here:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
#
BOT_NAME = 'saymedia'
SPIDER_MODULES = ['saymedia.spiders']
N... | saymedia/SaySpider | saymedia/saymedia/settings.py | Python | mit | 1,287 | 0.001554 |
import _plotly_utils.basevalidators
class HistfuncValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="histfunc", parent_name="histogram2d", **kwargs):
super(HistfuncValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,... | plotly/plotly.py | packages/python/plotly/plotly/validators/histogram2d/_histfunc.py | Python | mit | 487 | 0.002053 |
from django.http import HttpResponse, JsonResponse
from pa3_web.models import Subscriber
#
# Example of a subscription client
#
def delete_subscriber(phone_number):
[sub.delete() for sub in Subscriber.objects.filter(protocol='sms',
identifier=phone_number)... | sistason/pa3 | src/pa3_frontend/pa3_django/pa3_web/subscription_sms_handling.py | Python | gpl-3.0 | 411 | 0.007299 |
#!/usr/bin/env python
import subprocess, os, sys, argparse
parser = argparse.ArgumentParser()
parser.add_argument("directory", help="First target directory for evaluation")
parser.add_argument("directories", nargs='+', help="All other directories to be evaluated")
parser.add_argument("-o", "--output", help="Output des... | nrebhun/FileSponge | src/filesponge.py | Python | mit | 2,647 | 0.0068 |
"""Taking screenshots inside tests!
If you want to take a screenshot inside your test, just do it like this:
.. code-block:: python
def test_my_test(take_screenshot):
# do something
take_screenshot("Particular name for the screenshot")
# do something else
"""
import fauxfactory
import py... | nachandr/cfme_tests | cfme/fixtures/screenshots.py | Python | gpl-2.0 | 1,470 | 0.001361 |
import os
import datetime
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'invest.settings')
import django
django.setup()
from myportfolio.models import Investor, Portfolio, AssetClass, STOCKS, BONDS,\
ALTERNATIVES, Security, Transaction, Account
def populate():
investor1 = add_investor(name='David Lim',
... | choozm/mamakstallinvestor-stockquote | populate_myportfolio.py | Python | mit | 6,849 | 0.019711 |
from django.apps import AppConfig
class RestateConfig(AppConfig):
name = 'restate'
| MrSami/sandbox | alpagu/restate/apps.py | Python | mit | 89 | 0 |
import click
from parsec.cli import pass_context, json_loads
from parsec.decorators import custom_exception, json_output
@click.command('delete_group_user')
@click.argument("group_id", type=str)
@click.argument("user_id", type=str)
@pass_context
@custom_exception
@json_output
def cli(ctx, group_id, user_id):
"""R... | galaxy-iuc/parsec | parsec/commands/groups/delete_group_user.py | Python | apache-2.0 | 466 | 0 |
#### 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 = Creature()
result.template = "object/mobile/shared_dressed_doak_sif.iff"
result.attribute_template_id = 9
result... | anhstudios/swganh | data/scripts/templates/object/mobile/shared_dressed_doak_sif.py | Python | mit | 441 | 0.047619 |
from a10sdk.common.A10BaseClass import A10BaseClass
class DisablePartitionName(A10BaseClass):
"""Class Description::
.
Class disable-partition-name supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param disable_partition... | amwelch/a10sdk-python | a10sdk/core/logging/logging_disable_partition_name.py | Python | apache-2.0 | 1,271 | 0.009441 |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | googleapis/python-aiplatform | .sample_configs/param_handlers/delete_specialist_pool_sample.py | Python | apache-2.0 | 714 | 0.001401 |
# Copyright 2006 James Tauber and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | lovelysystems/pyjamas | library/pyjamas/ui/CheckBox.py | Python | apache-2.0 | 3,250 | 0.003077 |
# Copyright (c) 2009-2010 Six Apart Ltd.
# 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 an... | mozilla/remoteobjects | remoteobjects/dataobject.py | Python | bsd-3-clause | 9,792 | 0.000511 |
from collections import OrderedDict
from rest_framework.fields import Field
from ..models import SourceImageIOError
class ImageRenditionField(Field):
"""
A field that generates a rendition with the specified filter spec, and serialises
details of that rendition.
Example:
"thumbnail": {
... | wagtail/wagtail | wagtail/images/api/fields.py | Python | bsd-3-clause | 1,340 | 0.001493 |
# Copyright (c) 2014 Dark Secret Software 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 agree... | openstack/stacktach-shoebox | shoebox/disk_storage.py | Python | apache-2.0 | 6,327 | 0 |
# -*- coding: utf-8 -*-
#
# Tupelo documentation build configuration file, created by
# sphinx-quickstart on Fri Jan 9 09:29:36 2015.
#
# 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... | uw-dims/tupelo | docs/source/conf.py | Python | bsd-3-clause | 10,490 | 0.006292 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
#
# This program is free software: you can redistribute it and/or ... | syci/domsense-agilebg-addons | account_followup_choose_payment/__init__.py | Python | gpl-2.0 | 1,092 | 0.000916 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-05-02 15:41
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sponsors', '0005_auto_20160530_1255'),
]
operations = [
migrations.AddField... | pycontw/pycontw2016 | src/sponsors/migrations/0006_sponsor_conference.py | Python | mit | 579 | 0.001727 |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | EmreAtes/spack | var/spack/repos/builtin/packages/libhio/package.py | Python | lgpl-2.1 | 2,974 | 0.001009 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Unit tests for all SQL implementations of spectrum libraries.
"""
from os import path as os_path
import uuid
import unittest
import numpy as np
import fourgp_speclib
class TestSpectrumLibrarySQL(object):
"""
This class is a mixin which adds lots of standard... | dcf21/4most-4gp | src/pythonModules/fourgp_speclib/fourgp_speclib/tests/test_spectrum_library_sql.py | Python | mit | 7,484 | 0.004009 |
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | tseaver/google-cloud-python | tasks/google/cloud/tasks_v2beta2/gapic/cloud_tasks_client.py | Python | apache-2.0 | 93,412 | 0.002516 |
from tkinter import *
from tkinter import ttk
from tkinter import filedialog
from tkinter import messagebox
from PDFManager.PDFMangerFacade import PDFMangerFacade
class PDFManager_UI:
def __init__(self):
self.i= -1;
self.files=[]
self.root = Tk()
self.root.title('PDFManager')
... | DevilSeven7/PDFManager | PDFManager/UI.py | Python | gpl-2.0 | 8,592 | 0.018506 |
# thesquirrel.org
#
# Copyright (C) 2015 Flying Squirrel Community Space
#
# thesquirrel.org is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any la... | bendk/thesquirrel | events/tests/test_forms.py | Python | agpl-3.0 | 7,189 | 0.000556 |
#!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'openwisp2.settings')
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| openwisp/django-x509 | tests/manage.py | Python | bsd-3-clause | 252 | 0 |
# 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)
from spack import *
class PyPickleshare(PythonPackage):
"""Tiny 'shelve'-like database with concurrency support"""
... | LLNL/spack | var/spack/repos/builtin/packages/py-pickleshare/package.py | Python | lgpl-2.1 | 764 | 0.003927 |
"""
Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor 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 la... | sbrichards/rockstor-core | src/rockstor/smart_manager/data_collector.py | Python | gpl-3.0 | 15,176 | 0.00112 |
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from example.apps.things.models import Thing
class ThingAdmin(admin.ModelAdmin):
fieldsets = (
(None, {
'fields': ('name', 'slug', 'image', 'description'),
}),
(_(u'Dates'), {
... | benspaulding/django-epio-example | example/apps/things/admin.py | Python | bsd-3-clause | 661 | 0 |
# stdlib
import urllib2
import urllib
import httplib
import socket
import os
import re
import time
from urlparse import urlsplit
from util import json
from collections import defaultdict
# project
from checks import AgentCheck
from config import _is_affirmative
EVENT_TYPE = SOURCE_TYPE_NAME = 'docker'
CGROUP_METRICS... | JohnLZeller/dd-agent | checks.d/docker.py | Python | bsd-3-clause | 18,138 | 0.003418 |
# pylint: disable=no-init,too-many-instance-attributes
from __future__ import (absolute_import, division, print_function)
from mantid.simpleapi import *
from mantid.api import (PythonAlgorithm, AlgorithmFactory, MatrixWorkspaceProperty,
ITableWorkspaceProperty, PropertyMode, Progress)
from manti... | ScreamingUdder/mantid | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/TransformToIqt.py | Python | gpl-3.0 | 13,257 | 0.002263 |
# -*- coding: utf-8 -*-
from openerp.osv import osv, fields
from openerp.tools.translate import _
import logging
from datetime import datetime
from openerp.osv.fields import datetime as datetime_field
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT, DEFAULT_SERVER_DATE_FORMAT
from unidecode import unidecode
i... | henrytao-me/openerp.positionq | addons/positionq/pq_salary/pq_thang_luong.py | Python | agpl-3.0 | 1,548 | 0.007175 |
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2010-2011 University of California, Berkeley, 2005-2009 University of Washington
# See opus_core/LICENSE
from opus_core.resources import Resources
from opus_core.misc import take_choices, do_id_mapping_dict_from_array
from opus_core.misc import DebugPrin... | christianurich/VIBe2UrbanSim | 3rdparty/opus/src/opus_core/datasets/interaction_dataset.py | Python | gpl-2.0 | 33,528 | 0.007904 |
from django.apps import AppConfig
class JcvrbaseappConfig(AppConfig):
name = 'jcvrbaseapp'
| jucapoco/baseSiteGanttChart | jcvrbaseapp/apps.py | Python | mit | 97 | 0 |
from common.utility.utils import FileUtils
default_resource_path = '/Users/Fernando/Develop/downloader'
def get_image(image_hash):
"""
Download huaban image by image hash code.
Such as get_image('3058ff7398b8b725f436c6c7d56f60447468034d2347b-fGd8hd')
:param image_hash: Image hash code.
:return:... | flyingSprite/spinelle | common/utility/image_downloader.py | Python | mit | 707 | 0.004243 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_yadi
----------------------------------
Tests for `yadi` module.
"""
import unittest
from yadi import yadi
class TestYadi(unittest.TestCase):
def setUp(self):
pass
def test_something(self):
pass
def tearDown(self):
pass
... | saltzm/yadi | tests/test_yadi.py | Python | bsd-3-clause | 367 | 0.00545 |
#!/usr/bin/env python
# File created February 29, 2012
from __future__ import division
__author__ = "William Walters"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["William Walters", "Emily TerAvest"]
__license__ = "GPL"
__version__ = "1.8.0-dev"
__maintainer__ = "William Walters"
__email__ = "Wil... | wasade/qiime | qiime/truncate_reverse_primer.py | Python | gpl-2.0 | 7,049 | 0.000284 |
# -*- coding: utf-8 -*-
"""
Unit tests for student optouts from course email
"""
import json
from mock import patch, Mock
from django.core import mail
from django.core.management import call_command
from django.core.urlresolvers import reverse
from django.conf import settings
from student.tests.factories import UserF... | valtech-mooc/edx-platform | lms/djangoapps/bulk_email/tests/test_course_optout.py | Python | agpl-3.0 | 4,696 | 0.003012 |
"""Represent the :class:`.Trophy` class."""
from typing import TYPE_CHECKING, Any, Dict, Union
from .base import PRAWBase
if TYPE_CHECKING: # pragma: no cover
import praw
class Trophy(PRAWBase):
"""Represent a trophy.
End users should not instantiate this class directly. :meth:`.Redditor.trophies` can... | praw-dev/praw | praw/models/trophy.py | Python | bsd-2-clause | 1,987 | 0.001007 |
"""
This file contains tasks that are designed to perform background operations on the
running state of a course.
"""
import json
from time import time
from sys import exc_info
from traceback import format_exc
from celery import current_task
from celery.utils.log import get_task_logger
from celery.signals import wor... | PepperPD/edx-pepper-platform | lms/djangoapps/instructor_task/tasks_helper.py | Python | agpl-3.0 | 18,210 | 0.005327 |
#!/usr/bin/python
from pygame import mixer
from threading import Timer
from random import randint
from xml.etree import ElementTree as XmlEt
import argparse
from utils import LOGGER
from sounds import SoundPool
# @brief constrain - constrains x to interval [mi, ma]
def constrain(x, mi, ma):
return min(ma, max(m... | Manewing/pyAmbient | pyambient.py | Python | mit | 7,575 | 0.00462 |
#
# 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
# ... | openstack/tacker | tacker/vnfm/monitor_drivers/ping/ping.py | Python | apache-2.0 | 3,250 | 0.000615 |
#!/usr/bin/env python
"""
Handles importing data from the various filetypes that Q2MM uses.
Schrodinger
-----------
When importing Schrodinger files, if the atom.typ file isn't in the directory
where you execute the Q2MM Python scripts, you may see this warning:
WARNING mmat_get_atomic_num x is not a valid atom typ... | Q2MM/q2mm | q2mm/filetypes.py | Python | mit | 123,627 | 0.002912 |
from unittest.mock import patch
from superdesk.tests import TestCase
from apps.publish.enqueue.enqueue_service import EnqueueService
class NoTakesEnqueueTestCase(TestCase):
def setUp(self):
super().setUp()
self.product_ids = self.app.data.insert(
"products",
[
... | superdesk/superdesk-core | tests/enqueue_test.py | Python | agpl-3.0 | 1,353 | 0.002217 |
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# Copyright (c) 2014, Arista Networks, 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 reta... | arista-eosext/rphm | setup.py | Python | bsd-3-clause | 3,002 | 0.001332 |
#!/usr/bin/python
# coding: utf-8
import copy
import json
from lcg import LCG
class Game(object):
def __init__(self, json_file):
super(Game, self).__init__()
with open(json_file) as f:
json_data = json.load(f)
self.ID = json_data["id"]
self.units = [Unit(json_u... | ooz/ICFP2015 | src/game.py | Python | mit | 8,981 | 0.001225 |
"""Routines related to PyPI, indexes"""
import sys
import os
import re
import mimetypes
import posixpath
from pip.log import logger
from pip.util import Inf, normalize_name, splitext, is_prerelease
from pip.exceptions import (DistributionNotFound, BestVersionAlreadyInstalled,
InstallationE... | ncdesouza/bookworm | env/lib/python2.7/site-packages/pip/index.py | Python | gpl-3.0 | 40,408 | 0.002203 |
from django.conf import settings
from django.core.cache import caches
from django.core.cache.backends.db import BaseDatabaseCache
from django.core.management.base import BaseCommand, CommandError
from django.db import (
DEFAULT_DB_ALIAS, connections, models, router, transaction,
)
from django.db.utils import Databa... | Vvucinic/Wander | venv_2_7/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/core/management/commands/createcachetable.py | Python | artistic-2.0 | 4,389 | 0.00319 |
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta
import json
import mock
import time
from django.conf import settings
from django.core import mail
from olympia import amo
from olympia.abuse.models import AbuseReport
from olympia.access.models import Group, GroupUser
from olympia.activity.models import... | tsl143/addons-server | src/olympia/reviewers/tests/test_models.py | Python | bsd-3-clause | 63,568 | 0.000031 |
# -*- coding: utf-8 -*-
stopwords = """
| A French stop word list. Comments begin with vertical bar. Each stop
| word is at the start of a line.
au | a + le
aux | a + les
avec | with
ce | this
ces | these
dans | with
de | of
des ... | michelp/xodb | xodb/snowball/french/__init__.py | Python | mit | 2,426 | 0 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, date_diff, formatdate, add_days, today, getdate
from frappe import _
from frappe.model.document import Docum... | libracore/erpnext | erpnext/hr/doctype/leave_allocation/leave_allocation.py | Python | gpl-3.0 | 9,271 | 0.02373 |
from PyQt5.QtCore import QThread, pyqtSignal
from API.CurseAPI import CurseAPI, CurseFile, CurseModpack
from PyQt5.QtWidgets import *
from GUI.Strings import Strings
strings = Strings()
translate = strings.get
class FileDownloaderWindow(QWidget):
def __init__(self, file: str, curse: CurseAPI, path: str, fname=F... | Brain888/OpenMineMods | GUI/Downloader.py | Python | agpl-3.0 | 4,748 | 0.001053 |
""" Protocol Buffer Breaking Change Detector
This tool is used to detect "breaking changes" in protobuf files, to
ensure proper backwards-compatibility in protobuf API updates. The tool
can check for breaking changes of a single API by taking 2 .proto file
paths as input (before and after) and outputting a bool `is_br... | envoyproxy/envoy | tools/api_proto_breaking_change_detector/detector.py | Python | apache-2.0 | 5,354 | 0.002615 |
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2014, 2015 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at... | egabancho/invenio | invenio/legacy/bibmatch/engine.py | Python | gpl-2.0 | 64,532 | 0.005067 |
"""
Installs and configures MySQL
"""
import uuid
import logging
from packstack.installer import validators
from packstack.installer import utils
from packstack.modules.ospluginutils import getManifestTemplate, appendManifestFile
# Controller object will be initialized from main flow
controller = None
# Plugin nam... | tangfeixiong/packstack | packstack/plugins/mysql_001.py | Python | apache-2.0 | 5,760 | 0.009028 |
# Copyright (C) 2013 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 of conditions and the... | Debian/openjfx | modules/web/src/main/native/Tools/QueueStatusServer/handlers/updatestatus.py | Python | gpl-2.0 | 3,275 | 0.001527 |
from JumpScale import j
"""
Provides the Params object and the ParamsFactory that is used in the Q-Tree
"""
class ParamsFactory:
"""
This factory can create new Params objects
"""
def __init__(self):
self.__jslocation__ = "j.data.params"
def get(self, dictObject={}):
"""
... | Jumpscale/jumpscale_core8 | lib/JumpScale/data/params/Params.py | Python | apache-2.0 | 5,825 | 0.000687 |
import mahotas as mh
from sklearn import cross_validation
from sklearn.linear_model.logistic import LogisticRegression
import numpy as np
from glob import glob
from edginess import edginess_sobel
#basedir = 'simple-dataset'
basedir = 'simple-dataset/'
def features_for(im):
im = mh.imread(im,as_grey=True).astype(... | gtesei/fast-furious | dataset/images2/simple_classification.py | Python | mit | 1,266 | 0.011848 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright 2016 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.
"""
Builds applications in debug mode:
- Copies the module directories into their destinations.
- Copies app.h... | youtube/cobalt | third_party/devtools/scripts/build/build_debug_applications.py | Python | bsd-3-clause | 2,246 | 0.000894 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'C:/Qgs18/apps/qgis/python/plugins/TopoDelProp/forms_ui/frmIntrodDatos.ui'
#
# Created: Fri Nov 09 12:38:15 2012
# by: PyQt4 UI code generator 4.8.6
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtC... | gasparmoranavarro/TopoDelProp | forms/frmIntrodDatos.py | Python | gpl-2.0 | 8,916 | 0.003141 |
# 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/network/azure-mgmt-network/azure/mgmt/network/v2021_05_01/operations/_peer_express_route_circuit_connections_operations.py | Python | mit | 9,496 | 0.004844 |
if __name__ == '__main__':
import os
import sys
port = int(sys.argv[1])
root_dirname = os.path.dirname(os.path.dirname(__file__))
if root_dirname not in sys.path:
sys.path.append(root_dirname)
print('before pydevd.settrace')
breakpoint(port=port) # Set up through custo... | Elizaveta239/PyDev.Debugger | tests_python/resources/_debugger_case_breakpoint_remote_no_import.py | Python | epl-1.0 | 406 | 0.009852 |
# -*- coding: utf-8 -*-
# Copyright 2019 OpenSynergy Indonesia
# Copyright 2022 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# pylint: disable=locally-disabled, manifest-required-author
{
"name": "Employee Job Family From Contract",
"version": "8.0.1.0.0",
"c... | open-synergy/opnsynid-hr | hr_employee_job_family_from_contract/__openerp__.py | Python | agpl-3.0 | 676 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import random
sys.path.append('.')
from twisted.internet import reactor
from twisted.python import log
from . import driver
from . import multiplexer
from . import record_layer
from . import updater
from . import dsl
from . import conf
EVENT_LOOP_FREQUENCY_S ... | flipchan/LayerProx | versions/offthewire_version/marionette_tg/client.py | Python | apache-2.0 | 3,635 | 0.004402 |
# -*- coding: utf-8 -*-
import random
from openerp import SUPERUSER_ID
from openerp.osv import osv, orm, fields
from openerp.addons.web.http import request
class sale_order(osv.Model):
_inherit = "sale.order"
def _cart_qty(self, cr, uid, ids, field_name, arg, context=None):
res = dict()
for ... | Communities-Communications/cc-odoo | addons/website_sale/models/sale_order.py | Python | agpl-3.0 | 10,347 | 0.007055 |
import mock
import numpy as np
import theano
import pytest
class TestObjectives:
@pytest.fixture
def input_layer(self, value):
from lasagne.layers import InputLayer
shape = np.array(value).shape
x = theano.shared(value)
return InputLayer(shape, input_var=x)
@pytest.fixture... | ebattenberg/Lasagne | lasagne/tests/test_objectives.py | Python | mit | 9,755 | 0 |
# coding: utf8
from ...symbols import (
ADJ, DET, NOUN, NUM, PRON, PROPN, PUNCT, VERB, POS
)
from ...lemmatizer import Lemmatizer
class RussianLemmatizer(Lemmatizer):
_morph = None
def __init__(self):
super(RussianLemmatizer, self).__init__()
try:
from pymorphy2 import MorphAn... | recognai/spaCy | spacy/lang/ru/lemmatizer.py | Python | mit | 6,860 | 0.000729 |
# encoding: 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 model 'DesignerTextPromptQuestion'
db.create_table('smartgrid_design_designertextpromptquestion',... | jtakayama/makahiki-draft | makahiki/apps/widgets/smartgrid_design/migrations/0001_initial.py | Python | mit | 15,933 | 0.007218 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... | florian-dacosta/stock-logistics-warehouse | stock_reserve/__openerp__.py | Python | agpl-3.0 | 2,185 | 0 |
import __settings__
from __settings__ import INSTALLED_APPS
assert hasattr(__settings__, 'BASE_DIR'), 'BASE_DIR required'
INSTALLED_APPS += (
'post',
)
| novafloss/django-compose-settings | tests/fixtures/my_app/settings/post.py | Python | mit | 161 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=no-self-use, pointless-statement, missing-docstring, invalid-name,len-as-condition
from functools import partial
from rebulk.pattern import StringPattern
from ..validators import chars_before, chars_after, chars_surround, validators
chars = ' _.'
left ... | Toilal/rebulk | rebulk/test/test_validators.py | Python | mit | 2,170 | 0.00553 |
from iSoft.entity.model import db, FaQuery
import math
import json
from iSoft.model.AppReturnDTO import AppReturnDTO
from iSoft.core.Fun import Fun
import re
class QueryDal(FaQuery):
def __init__(self):
pass
def query_findall(self, pageIndex, pageSize, criterion, where):
relist, is_succ = Fun... | wengzhilai/family | iSoft/dal/QueryDal.py | Python | bsd-3-clause | 3,612 | 0.000573 |
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.mlab as mlab
import math
import scipy.special as sps
mean = 0
variance = 1
sigma = math.sqrt(variance)
def drawSampleNormal(sampleSize):
samples = np.random.normal(mean, sigma, sampleSize)
count, bins, ignored = plt.hist(samples, 80, normed... | PredictionIO/open-academy | KairatAshim/pio_assignment2/problem2/problem2.py | Python | apache-2.0 | 1,046 | 0.013384 |
from io import BytesIO
import os
import pickle
from tempfile import mkstemp
import unittest
from unittest.mock import patch, Mock
import warnings
from Orange.widgets.settings import SettingsHandler, Setting, SettingProvider
class SettingHandlerTestCase(unittest.TestCase):
@patch('Orange.widgets.settings.SettingPr... | marinkaz/orange3 | Orange/widgets/tests/test_settings_handler.py | Python | bsd-2-clause | 7,342 | 0 |
from .Exporter import Exporter
from ..python2_3 import asUnicode
from ..parametertree import Parameter
from ..Qt import QtGui, QtCore, QtSvg, QT_LIB
from .. import debug
from .. import functions as fn
import re
import xml.dom.minidom as xml
import numpy as np
__all__ = ['SVGExporter']
class SVGExporter(Exporter):
... | campagnola/acq4 | acq4/pyqtgraph/exporters/SVGExporter.py | Python | mit | 17,330 | 0.011541 |
# -*- coding: utf-8 -*-
from Plugins.Extensions.MediaPortal.plugin import _
from Plugins.Extensions.MediaPortal.resources.imports import *
from Plugins.Extensions.MediaPortal.resources.keyboardext import VirtualKeyBoardExt
CONFIG = "/usr/lib/enigma2/python/Plugins/Extensions/MediaPortal/additions/additions.xml"
clas... | n3wb13/OpenNfrGui-5.0-1 | lib/python/Plugins/Extensions/MediaPortal/additions/porn/x2search4porn.py | Python | gpl-2.0 | 7,051 | 0.032203 |
import webipy
import numpy as np
import matplotlib.pyplot as plt
import pylab
import pandas as pd
pylab.rcParams['figure.figsize'] = (15, 11)
@webipy.exports
def plot(x, n=4):
"""
Demo of scatter plot on a polar axis.
Size increases radially in this example and color increases with angle
"""
N = ... | PlotWatt/webipy | examples/ex1.py | Python | bsd-3-clause | 1,406 | 0 |
#!/usr/bin/env python
import os
import sys
PREFIX_DELIMITER = '_'
def enumerate_symbols(symbols_folder_path):
symbols = []
for filename in os.listdir(symbols_folder_path):
parts = os.path.splitext(filename)
if parts[1] == ".svg":
symbols.append(parts[0])
return symbols
def ... | rokuz/omim | tools/python/generate_local_ads_symbols.py | Python | apache-2.0 | 1,823 | 0.002194 |
import pytest
# TODO: use same globals for reverse operations such as add, remove
GRAPHS = [
({},
[],
[]),
({'nodeA': {}},
['nodeA'],
[]),
({'nodeA': {'nodeB': 'weight'},
'nodeB': {}},
['nodeA', 'nodeB'],
[('nodeA', 'nodeB')]),
({'nodeA': {'nodeB': 'weight'},
'... | palindromed/data-structures | src/test_graph.py | Python | mit | 10,017 | 0.000399 |
import sys
import os
#For baseline and redundacy-detecion to prepare message size picture
def MessageSize(typePrefix, directory):
wf = open("%(typePrefix)s-msgsize.data"%vars(), "w")
wf.write("#Suggest Filename: %(typePrefix)s-message.data\n#Data for drawing message overall size in different Amount/Redunda... | momingsong/ns-3 | bash-py-gp/baseline_picdata.py | Python | gpl-2.0 | 12,175 | 0.012238 |
"""
Routines to compute RMSD of all PROT_IND_ files
These routines were developed by:
Rodrigo Antonio Faccioli - rodrigo.faccioli@usp.br / rodrigo.faccioli@gmail.com
Leandro Oliveira Bortot - leandro.bortot@usp.br / leandro.obt@gmail.com
"""
import os
import sys
from collections import OrderedDict... | rodrigofaccioli/2pg_cartesian | scripts/analysis/compute_rmsd_pdb_files.py | Python | apache-2.0 | 1,725 | 0.029565 |
import os
import commands
import re
import SiteMover
from futil import *
from PilotErrors import PilotErrors
from pUtil import tolog, readpar, verifySetupCommand
from time import time
from FileStateClient import updateFileState
from timed_command import timed_command
class castorSvcClassSiteMover(SiteMover.SiteMover... | RRCKI/pilot | castorSvcClassSiteMover.py | Python | apache-2.0 | 16,969 | 0.005187 |
# -*- coding: utf-8 -*-
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
import json
from intranet.models import User, Project, Part, STATE_CREATED
class Test(TestCase):
@classmethod
def setUpClass(self):
self.c = Client()
Use... | fatihzkaratana/intranet | backend/intranet/tests/api.py | Python | apache-2.0 | 7,125 | 0.012351 |
# Voitto - a simple yet efficient double ledger bookkeeping system
# Copyright (C) 2010 Santtu Pajukanta <santtu@pajukanta.fi>
#
# 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 ... | japsu/voitto | tappio/models.py | Python | gpl-3.0 | 2,774 | 0.001081 |
# -*- 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 unique constraint on 'Assessment', fields ['user', 'sample_result']
db.create_unique('assessment', ... | chop-dbhi/varify-data-warehouse | vdw/assessments/migrations/0007_auto__add_unique_assessment_user_sample_result.py | Python | bsd-2-clause | 20,310 | 0.008567 |
"""
Django settings for quixotic_webapp project.
Generated by 'django-admin startproject' using Django 1.10.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
i... | zcarwile/quixotic_webapp | quixotic_webapp/settings.py | Python | gpl-3.0 | 3,517 | 0.001137 |
# 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... | dhuang/incubator-airflow | airflow/timetables/interval.py | Python | apache-2.0 | 3,585 | 0.000558 |
# -*- coding: utf-8 -*-
import sys
sys.path.append('../')
import time
import pytest
import os
import telebot
from telebot import types
from telebot import util
should_skip = 'TOKEN' and 'CHAT_ID' not in os.environ
if not should_skip:
TOKEN = os.environ['TOKEN']
CHAT_ID = os.environ['CHAT_ID']
@pytest.mar... | jpelias/pyTelegramBotAPI | tests/test_telebot.py | Python | gpl-2.0 | 7,077 | 0.002685 |
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: miha@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
import random
from tests.ggrc import TestCase
from freezegun import freeze_time
... | uskudnik/ggrc-core | src/tests/ggrc_workflows/notifications/test_enable_disable_notifications.py | Python | apache-2.0 | 7,378 | 0.010165 |
import json
import logging
import math
import re
import tba_config
import urllib
from difflib import SequenceMatcher
from google.appengine.api import memcache, urlfetch
from google.appengine.ext import ndb
from models.location import Location
from models.sitevar import Sitevar
from models.team import Team
class Loc... | bdaroz/the-blue-alliance | helpers/location_helper.py | Python | mit | 24,876 | 0.003136 |
#!/usr/bin/env python3
delineator = "//"
hashtag = "#"
# generate poems from a file
# out: list of poem lines
def generate_poems(filename):
g = []
# get to the first poem in the file
with open(filename, 'r') as f:
for line in f:
line = line.rstrip()
if line.startswith( deli... | benjspriggs/tumb-borg | tumb_borg/process.py | Python | apache-2.0 | 1,044 | 0.01341 |
import os
ARCH = 'arm'
CPU = 'arm926'
# toolchains options
CROSS_TOOL = 'gcc'
#------- toolchains path -------------------------------------------------------
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc'
EXEC_PATH = r'D:\arm-2013.11\bin'
elif CROSS_T... | wolfgangz2013/rt-thread | bsp/at91sam9g45/rtconfig.py | Python | apache-2.0 | 3,724 | 0.008861 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
def check_junior(sender, instance, created, **kwargs):
# from .models import Entry # avoid circled import
if created and instance.user.junior:
total_entry = sender.objects.filter(user=instance.user).count()
if t... | kaankizilagac/sozluk | sozluk/topics/signals.py | Python | mit | 412 | 0.002427 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.