code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
#
# This file contains a class to analyse text in giellatekno xml format
#
# 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
# ... | unhammer/gt-CorpusTools | corpustools/test/test_analyser.py | Python | gpl-3.0 | 8,941 |
# Copyright (c) Mathias Kaerlev 2012.
# This file is part of Anaconda.
# Anaconda 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.
# ... | joaormatos/anaconda | mmfparser/player/players.py | Python | gpl-3.0 | 6,005 |
import os
import logging.config
class MyLogger(object):
# set logging to both file and screen
def __init__(self):
logging.config.fileConfig('../config/logging.conf')
self.logger = logging.getLogger('scrapeforum')
self.logger.addHandler(logging.StreamHandler())
self.errorIndicat... | stackingfunctions/scrapeforum | python/src/mylogger.py | Python | gpl-3.0 | 862 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:copyright: Copyright 2013-2014 by Łukasz Mierzwa
:contact: l.mierzwa@gmail.com
"""
from __future__ import unicode_literals
from setuptools import setup, find_packages
try:
from pip.req import parse_requirements
from pip.download import PipSession
... | prymitive/upaas-common | setup.py | Python | gpl-3.0 | 1,130 |
from .. import NogginConstants
from . import PBConstants
from . import Formations
def sReady(team, workingPlay):
workingPlay.setStrategy(PBConstants.S_READY)
Formations.fReady(team, workingPlay)
def sNoFieldPlayers(team, workingPlay):
workingPlay.setStrategy(PBConstants.S_NO_FIELD_PLAYERS)
Formations.... | northern-bites/nao-man | noggin/playbook/Strategies.py | Python | gpl-3.0 | 4,793 |
"""
Helcio Macedo
Checksum Verifier v1.0
https://github.com/neomacedo/ScriptsUteis
-----------------------------------------------------------
Script used to compare if local file its the same as remote.
"""
import hashlib
import urllib2
import optparse
# Remote address to file
remote_url = 'https://raw.githubusercon... | neomacedo/ScriptsUteis | Python/checksum_comparator.py | Python | gpl-3.0 | 1,563 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#######################################################################
#
# VidCutter - media cutter & joiner
#
# copyright © 2018 Pete Alexandrou
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Licen... | ozmartian/vidcutter | vidcutter/__main__.py | Python | gpl-3.0 | 17,036 |
# This file is part of pyderiv. http://forre.st/pyderiv
#
# pyderiv 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.
#
# pyderiv is distr... | forrestv/pyderiv | noise_test.py | Python | gpl-3.0 | 1,536 |
# oppia/api/media.py
from django.conf import settings
from django.contrib.auth import authenticate
from django.http import HttpResponseRedirect, Http404, HttpResponse, JsonResponse
from django.utils.translation import ugettext_lazy as _
from django.views.decorators.csrf import csrf_exempt
from django.contrib import me... | DigitalCampus/django-nurhi-oppia | oppia/api/media.py | Python | gpl-3.0 | 1,856 |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------
# Canal (seodiv) por Hernan_Ar_c
# ------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os, sys
from core import logger
from core import config
from core import scraperto... | r0balo/pelisalacarta | python/main-classic/channels/seodiv.py | Python | gpl-3.0 | 5,982 |
import numpy as np
#numpy is used for later classifiers
#Note: this is just a template with all required methods
#text is the text represented as a string
#textName is optional, indicate sthe name of the text, used for debug
#args are aditional arguments for the feature calculator
#debug indicates wheter to display deb... | darksteelcode/authorship | features/base.py | Python | gpl-3.0 | 1,482 |
#!/usr/bin/env python
#
# json.py
# TurboHvZ
#
# Copyright (C) 2008 Ross Light
#
# 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 opti... | zombiezen/turbohvz | hvz/json.py | Python | gpl-3.0 | 1,149 |
import mt, os, mimetypes
from time import strftime
class HTTPOut():
class mtEntry():
def __init__(self):
self.html = False
self.css = False
self.js = False
self.data = ""
self.target = ""
def __init__(self, session = None):
self.sessi... | andr3wmac/metaTower | packages/http/HTTPOut.py | Python | gpl-3.0 | 7,153 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Time-sheet Analyser: Python library which allows to analyse time-sheets.
# Copyright (C) 2017 Carlos Serra Toro.
#
# 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 S... | serratoro/timesheet-analyser | TimeSheetAnalyser/presenters/daily_attendance_plot_presenter.py | Python | gpl-3.0 | 3,657 |
#!/usr/bin/env python3
from __future__ import absolute_import
import six.moves.SimpleHTTPServer
from six.moves.BaseHTTPServer import HTTPServer
from six.moves.socketserver import ForkingMixIn
import six.moves.urllib.request, six.moves.urllib.parse, six.moves.urllib.error
import six.moves.urllib.parse
import sys
import... | bill-mccloskey/searchfox | router/router.py | Python | mpl-2.0 | 20,106 |
from sqlalchemy.schema import CreateTable
from community_share import store, config, setup
from community_share.models.user import UserReview
config.load_from_environment()
table_sql = CreateTable(UserReview.__table__).compile(store.engine)
print(table_sql)
| seanastephens/communityshare | update_scripts/make_sql.py | Python | mpl-2.0 | 261 |
# This file is part of the Simulation Manager project for VecNet.
# For copyright and licensing information about this project, see the
# NOTICE.txt and LICENSE.md files in its top-level directory; they are
# available at https://github.com/vecnet/simulation-manager
#
# This Source Code Form is subject to the terms of ... | vecnet/simulation-manager | sim_manager/tests/test_submit_group.py | Python | mpl-2.0 | 7,814 |
# The contents of this file are subject to the Mozilla Public 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.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"basis,
#... | os2webscanner/os2webscanner | scrapy-webscanner/scanners/processors/xml.py | Python | mpl-2.0 | 2,214 |
"""
Usage:
import_localities < Localities.csv
"""
from django.contrib.gis.geos import GEOSGeometry
from django.utils.text import slugify
from ..import_from_csv import ImportFromCSVCommand
from ...utils import parse_nptg_datetime
from ...models import Locality
class Command(ImportFromCSVCommand):
"""
Impo... | jclgoodwin/bustimes.org.uk | busstops/management/commands/import_localities.py | Python | mpl-2.0 | 2,629 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import sqlalchemy as sa
from relengapi.blueprints.tokenauth import types
from relengapi.lib import db
from relengapi.li... | Callek/build-relengapi | relengapi/blueprints/tokenauth/tables.py | Python | mpl-2.0 | 1,677 |
"""
Django settings for cadasta project.
Generated by 'django-admin startproject' using Django 1.8.6.
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 path... | Cadasta/cadasta-platform | cadasta/config/settings/default.py | Python | agpl-3.0 | 17,780 |
def main():
PEOPLE = insert_people()
sum_salary_all(PEOPLE)
list_people_by_city(PEOPLE)
def insert_people():
PEOPLE = []
while True:
NAMES = {}
NAMES["name"] = name = raw_input("Inserisci nome ")
NAMES["city"] = city = raw_input("Inseriscci citta ")
NAMES["salar... | feroda/lessons-python4beginners | students/2016-09-04/federicofioriti/Epeople.py | Python | agpl-3.0 | 987 |
class Breadcrumb:
def __init__(self, text, url):
self.text = text
self.url = url | alienlike/hypertextual | hypertextual/models/breadcrumb.py | Python | agpl-3.0 | 100 |
from locust import HttpLocust, TaskSet, task
class UserBehavior(TaskSet):
def on_start(self):
""" on_start is called when a Locust start before any task is scheduled """
self.login()
def login(self):
# do a login here
# self.client.post("/login", {"username":"ellen_key", "passw... | PyBossa/pybossa-locust | mainandprojects.py | Python | agpl-3.0 | 600 |
import nose
import ckanext.dcatapit.harvesters.utils as utils
eq_ = nose.tools.eq_
ok_ = nose.tools.ok_
csw_harvester_config = {
'dataset_themes': 'OP_DATPRO',
'dataset_places': 'ITA_BZO',
'dataset_languages': '{ITA,DEU}',
'frequency': 'UNKNOWN',
'agents': {
'publisher': {
'c... | geosolutions-it/ckanext-dcatapit | ckanext/dcatapit/tests/test_harvest_utils.py | Python | agpl-3.0 | 2,692 |
# vim:fileencoding=utf8:et:ts=4:sts=4:sw=4:ft=python
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import (login as _login, logout as _logout,
authenticate)
from django.core.mail import send_mail
from django.core.urlresolvers import rever... | gentoo/identity.gentoo.org | okupy/accounts/views.py | Python | agpl-3.0 | 36,590 |
# Copyright (C) University of Tennessee Health Science Center, Memphis, TN.
#
# This program 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... | genenetwork/genenetwork2_diet | wqflask/base/data_set.py | Python | agpl-3.0 | 45,353 |
# -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol #
# ... | CLVsol/odoo_cl_addons | cl_todo/category/cl_todo_category.py | Python | agpl-3.0 | 4,706 |
# !/usr/bin/python
# -*- coding: cp1252 -*-
#
##################################################################################
#
# Copyright 2016-2017 Félix Brezo and Yaiza Rubio (i3visio, contacto@i3visio.com)
#
# This program is part of OSRFramework. You can redistribute it and/or modify
# it under the ter... | i3visio/osrframework | osrframework/wrappers/pending/bebee.py | Python | agpl-3.0 | 4,625 |
# Copyright 2017 ForgeFlow S.L.
# (http://www.forgeflow.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from datetime import datetime, timedelta
from odoo.exceptions import AccessError, ValidationError
from odoo.tests import common
class TestStockCycleCount(common.TransactionCase):
d... | OCA/stock-logistics-warehouse | stock_cycle_count/tests/test_stock_cycle_count.py | Python | agpl-3.0 | 12,526 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Michael Sandoz <michaelsandoz87@gmail.com>, Emanuel Cino
#
# The licence is in ... | emgirardin/compassion-modules | child_compassion/controllers/web_children_hold.py | Python | agpl-3.0 | 2,889 |
# Copyright (C) 2015 Forest and Biomass Romania
# Copyright (C) 2020 Terrabit
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
from odoo.osv import expression
class ResCountryZone(models.Model):
_name = "res.country.zone"
_description = "Country Zones"... | OCA/l10n-romania | l10n_ro_siruta/models/siruta.py | Python | agpl-3.0 | 4,887 |
# lachambre.be to json sausage machine
# Copyright (C) 2011 Laurent Peuch <cortex@worlddomination.be>
#
# This program 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
# Li... | Psycojoker/dierentheater | scraper/management/commands/create_db_dumps.py | Python | agpl-3.0 | 932 |
#!/usr/bin/python
import sys
import re
import types
import random
import lxml
from lxml import etree
from copy import deepcopy
def usage():
print "Usage: %s countryfile regionname valuefile clubfile1 [clubfile2...]" % sys.argv[0]
print " countryfile: XML file of the country"
print " ... | anttisalonen/freekick | src/tools/Python/stadium/stadium.py | Python | agpl-3.0 | 5,396 |
# -*- coding: utf-8 -*-
# Akvo Reporting is covered by the GNU Affero General Public License.
# See more details in the license.txt file located at the root folder of the Akvo RSR module.
# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
from datetime import date
from a... | akvo/akvo-rsr | akvo/rsr/tests/usecases/test_change_project_parent.py | Python | agpl-3.0 | 4,628 |
from __future__ import unicode_literals
import pytest
from tests.factories import UniprotFactory
@pytest.fixture
def uniprot_egfr_human():
return UniprotFactory(
uniprot_acc='P00533',
uniprot_id='EGFR_HUMAN',
description='Epidermal growth factor receptor EC=2.7.10.1'
)
| ecolell/pfamserver | tests/fixtures/uniprot.py | Python | agpl-3.0 | 304 |
# -*- coding: utf-8 -*-
# © 2016 Elico Corp (www.elico-corp.com).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Membership Management - POS Membership',
'version': '8.0.1.0.2',
'category': 'Generic Modules',
'depends': [
'account_membership_balance',
'po... | Elico-Corp/odoo-addons | pos_membership/__openerp__.py | Python | agpl-3.0 | 694 |
"""
Unit tests for the Mixed Modulestore, with DDT for the various stores (Split, Draft, XML)
"""
import datetime
import itertools
import logging
import mimetypes
from collections import namedtuple
from contextlib import contextmanager
from shutil import rmtree
from tempfile import mkdtemp
from uuid import uuid4
imp... | stvstnfrd/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py | Python | agpl-3.0 | 178,445 |
# -*- coding: utf-8 -*-
# © 2017 Houssine BAKKALI - Coop IT Easy
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import fields, models
class ProductTemplate(models.Model):
_inherit = "product.template"
default_code = fields.Char(related='product_variant_ids.default_... | houssine78/addons | product_internal_ref/models/product.py | Python | agpl-3.0 | 368 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# AppTalk documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 25 00:32:14 2017.
#
# 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
# au... | apptalk/apptalk | docs/conf.py | Python | agpl-3.0 | 5,545 |
# -*- coding: utf-8 -*-
import os
import pytest
from skylines.lib import files
from skylines.lib.types import is_unicode
from skylines.model import User, IGCFile
from tests.data import users, igcs
def test_user_delete_deletes_user(db_session):
john = users.john()
db_session.add(john)
db_session.commit()... | skylines-project/skylines | tests/model/test_user.py | Python | agpl-3.0 | 1,765 |
from __future__ import absolute_import, unicode_literals
import time
from datetime import timedelta
from djcelery_transactions import task
from django.utils import timezone
from redis_cache import get_redis_connection
from .models import CreditAlert, Invitation, Org, TopUpCredits
@task(track_started=True, name='sen... | ewheeler/rapidpro | temba/orgs/tasks.py | Python | agpl-3.0 | 1,662 |
from . import test_remote_printer
from . import test_printer
| OCA/report-print-send | remote_report_to_printer/tests/__init__.py | Python | agpl-3.0 | 61 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) cgstudiomap <cgstudiomap@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | cgstudiomap/cgstudiomap | main/local_modules/frontend_shop/__openerp__.py | Python | agpl-3.0 | 1,388 |
from flask_wtf import FlaskForm
from saylua.utils.form import sl_validators
from saylua.utils.form.fields import SlField, SlTextAreaField
class ForumThreadForm(FlaskForm):
title = SlField('Thread Title', [
sl_validators.Required(),
sl_validators.NotBlank(),
sl_validators.Min(3)])
body ... | LikeMyBread/Saylua | saylua/modules/forums/forms/main.py | Python | agpl-3.0 | 632 |
# This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from django import template
register = template.Library()
@register.filter
def username(user):
return ("%s %s" % (user.first_name, user.last_name)).lstrip() or... | fnp/redakcja | src/documents/templatetags/common_tags.py | Python | agpl-3.0 | 336 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-23 21:38
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('members', '0005_trainingrecordtype'),
]
operations = [
migrations.AlterFie... | BenMotz/cubetoolkit | toolkit/members/migrations/0006_auto_20180223_2138.py | Python | agpl-3.0 | 506 |
import os
import shutil
from hashlib import md5
from io import StringIO
from PIL import Image
from photonix.photos.models import LibraryPath
from photonix.photos.utils.db import record_photo
from photonix.photos.utils.fs import (determine_destination,
find_new_file_name, mkdir_p)... | damianmoore/photo-manager | photonix/photos/utils/organise.py | Python | agpl-3.0 | 6,846 |
from django.apps import apps
from django.dispatch import receiver
from django.db.models.signals import post_migrate
@receiver(post_migrate, sender=apps.get_app_config('autodidact'))
def create_homepage(sender, **kwargs):
'''Receiver function that populates the database with a homepage in case it doesn't exist'''
... | JaapJoris/autodidact | autodidact/management.py | Python | agpl-3.0 | 434 |
import requests
from django.conf import settings
from django.http import HttpResponse, HttpResponseBadRequest
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_http_methods
@csrf_exempt
@require_http_methods(["POST"])
def post_service_request(request):
payload =... | City-of-Helsinki/smbackend | services/views.py | Python | agpl-3.0 | 1,229 |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2014-2022 GEM Foundation
#
# OpenQuake 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 Licen... | gem/oq-engine | openquake/hazardlib/gsim/eshm20_craton.py | Python | agpl-3.0 | 14,799 |
# Miro - an RSS based video player application
# Copyright 2009 - Participatory Culture Foundation
#
# This file is part of vidscraper.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of sour... | ujdhesa/unisubs | libs/vidscraper/sites/wistia.py | Python | agpl-3.0 | 4,955 |
import openerp.addons.website.tests.test_ui as test_ui
def load_tests(loader, base, _):
base.addTest(test_ui.WebsiteUiSuite(test_ui.full_path(__file__,'website_sale-add_product-test.js'),
{'redirect': '/page/website.homepage'}))
base.addTest(test_ui.WebsiteUiSuite(test_ui.full_path(__file__,'website_sa... | browseinfo/odoo_saas3_nicolas | addons/website_sale/tests/test_ui.py | Python | agpl-3.0 | 963 |
from __future__ import print_function
from __future__ import unicode_literals
from django.contrib import admin
from .models import Conference
from .models import Paper
from .models import Author
from .models import Attachment
from .actions import paper_actions
class AttachInline(admin.TabularInline):
model = A... | wadobo/papersplease | papersplease/papers/admin.py | Python | agpl-3.0 | 1,742 |
# Copyright: Ankitects Pty Ltd and contributors
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import anki.lang
import aqt
from aqt import AnkiQt
from aqt.profiles import RecordingDriver, VideoDriver
from aqt.qt import *
from aqt.utils import (
TR,
HelpPage,
disable_help_butt... | simgunz/anki | qt/aqt/preferences.py | Python | agpl-3.0 | 10,181 |
# -*- coding: utf-8 -*-
# © 2015 Compassion CH (Nicolas Tran)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, models
class AccountPaymentOrder(models.Model):
_inherit = 'account.payment.order'
@api.multi
def open2generated(self):
"""
Replace act... | CompassionCH/l10n-switzerland | l10n_ch_fds_upload_sepa/models/account_payment_order.py | Python | agpl-3.0 | 1,096 |
""" Encode any known changes to the database here
to help the matching process
"""
renamed_modules = {
'base_calendar': 'calendar',
'mrp_jit': 'procurement_jit',
'project_mrp': 'sale_service',
# OCA/account-invoicing
'invoice_validation_wkfl': 'account_invoice_validation_workflow',
'account_inv... | grap/OpenUpgrade | openerp/addons/openupgrade_records/lib/apriori.py | Python | agpl-3.0 | 931 |
from django.core.management.base import BaseCommand
from django.utils import timezone
from mainsite.models import AccessTokenProxy, AccessTokenScope
class Command(BaseCommand):
def handle(self, *args, **options):
self.stdout.write('Splitting all scopes on tokens')
chunk_size = 5000
page ... | concentricsky/badgr-server | apps/mainsite/management/commands/generate_token_scopes.py | Python | agpl-3.0 | 970 |
# -*- coding: utf-8 -*-
"""
Integration tests for submitting problem responses and getting grades.
"""
import json
import os
from textwrap import dedent
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test.client import RequestFactor... | martynovp/edx-platform | lms/djangoapps/courseware/tests/test_submitting_problems.py | Python | agpl-3.0 | 51,827 |
# -*- 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... | jss-emr/openerp-7-src | openerp/addons/account/account_move_line.py | Python | agpl-3.0 | 70,268 |
#-----------------------------------------------------------
# Threaded, Gevent and Prefork Servers
#-----------------------------------------------------------
import datetime
import errno
import logging
import os
import os.path
import platform
import psutil
import random
import resource
import select
import signal
im... | trabacus-softapps/openerp-8.0-cc | openerp/service/server.py | Python | agpl-3.0 | 32,015 |
# -*- coding: utf-8 -*-
# Copyright(C) 2013 Julien Veyssier
#
# This file is part of weboob.
#
# weboob 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 op... | franek/weboob | modules/parolesmania/backend.py | Python | agpl-3.0 | 1,772 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can r... | dayatz/taiga-back | taiga/celery.py | Python | agpl-3.0 | 1,321 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | chanceraine/nupic.research | tests/union_pooling/union_pooler_test.py | Python | agpl-3.0 | 4,882 |
# Aspect ratio
# create mesh
from SMESH_mechanic import *
# get faces with aspect ratio > 1.5
filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_AspectRatio, SMESH.FT_MoreThan, 1.5)
ids = mesh.GetIdsFromFilter(filter)
print "Number of faces with aspect ratio > 1.5:", len(ids)
# copy the faces with aspect ratio > 1.5 to a... | FedoraScientific/salome-smesh | doc/salome/examples/filters_ex01.py | Python | lgpl-2.1 | 1,332 |
# GUI Application automation and testing library
# Copyright (C) 2006 Mark Mc Mahon
#
# 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 you... | manojklm/pywinauto-x64 | pywinauto/win32structures.py | Python | lgpl-2.1 | 32,760 |
# 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)
import platform
import sys
import os
from spack import *
class Namd(MakefilePackage):
"""NAMDis a parallel molecular... | rspavel/spack | var/spack/repos/builtin/packages/namd/package.py | Python | lgpl-2.1 | 5,399 |
##############################################################################
# Copyright (c) 2013-2017, 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... | skosukhin/spack | lib/spack/spack/cmd/use.py | Python | lgpl-2.1 | 1,713 |
#
# This file is part of Mapnik (c++ mapping toolkit)
#
# Copyright (C) 2013 Artem Pavlenko
#
# Mapnik 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... | qianwenming/mapnik | src/build.py | Python | lgpl-2.1 | 15,637 |
import flask.views
from flask import request
TAM_PAGINA=5
def calculoPrimeraPag(cant):
"""
Setea los valores correspondientes a la primera pagina de un paginar,
recibe la cantidad de items, fases o proyectos que existen para dicho paginar
"""
if(cant!=0):#Si devolvio algo
t=cant/TAM_PAGINA... | diegocrzt/pmspy | pms/vista/paginar.py | Python | lgpl-2.1 | 2,986 |
"core.Pixmap tests"
from unittest import SkipTest
from testutils import *
from gfxprim.core import Pixmap
from gfxprim import gfx, core
def test_gfx_submodule_loads():
"gfx is present in a Pixmap"
c = Pixmap(1, 1, core.C.PIXEL_RGB888)
assert c.gfx
def test_gfx_submodule_has_C():
"gfx contains C"
c = Pix... | gfxprim/gfxprim | tests/pylib/test_gfx.py | Python | lgpl-2.1 | 3,030 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Shows how to use BitmapManager to asynchronously load a Bitmap from a file.
Run this snippet providing a list of filenames of (high resolution) pictures:
$ ./asyncload.py /path/to/mypics/*.jpg anotherpic.png nonexistent.png
Press space to sequentially load the pictur... | pararthshah/libavg-vaapi | src/samples/asyncload.py | Python | lgpl-2.1 | 3,390 |
# Copyright (C) 2010, 2011 Apple 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and... | annulen/qtwebkit-snapshots | Source/WebKit2/Scripts/webkit/parser.py | Python | lgpl-2.1 | 5,618 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import run_tests # set sys.path
import tempfile
import os
from kobo.http import *
class TestPOSTTransport(unittest.TestCase):
def setUp(self):
self.postt = POSTTransport()
def test_get_content_type(self):
tf0 = tempfile.mkstemp()[1... | pombredanne/https-git.fedorahosted.org-git-kobo | tests/test_http.py | Python | lgpl-2.1 | 1,375 |
import unittest
from charm.toolbox.symcrypto import SymmetricCryptoAbstraction,AuthenticatedCryptoAbstraction, MessageAuthenticator
from charm.toolbox.pairinggroup import PairingGroup,GT
from charm.core.math.pairing import hashPair as sha1
class SymmetricCryptoAbstractionTest(unittest.TestCase):
def testAESCB... | lferr/charm | charm/test/toolbox/symcrypto_test.py | Python | lgpl-3.0 | 4,362 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-03-11 11:56
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('equinox_api', '0004_operation_description'),
]
operations = [
migrations.Add... | ivanprjcts/equinox-spring16-API | equinox_spring16_api/equinox_api/migrations/0005_application_new_att.py | Python | lgpl-3.0 | 463 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from FastBitSet import FastBitSet
import math
import mmh3
class FastBloomFilter(object):
mask32 = 0xffffffff
mask64 = 0xffffffffffffffff
mask128 = 0xffffffffffffffffffffffffffffffff
seeds = [2, 3, 5, 7, 11,
13, 17, 19, 23, 29, ... | nealzhang/util | FastBloomFilter.py | Python | lgpl-3.0 | 2,828 |
fn='/home/thomas/Dokumente/freecad_buch/D006_landxml/Survey.xml'
fn='/home/thomas/Dokumente/freecad_buch/D006_landxml/bratton farm-2.0.xml'
# fn='/home/thomas/Dokumente/freecad_buch/D006_landxml/test.xml'
fn='/home/thomas/Dokumente/freecad_buch/D006_landxml/Portsmouth Heights.xml'
fn='/home/thomas/Dokumente/freecad_buc... | microelly2/geodata | geodat/my_xmlparser.py | Python | lgpl-3.0 | 9,730 |
# coding=utf-8
"""
CERMMorse : test_config
5/7/2017 : 11:32 PM
Author : James L. Key
"""
from unittest import TestCase
from readconfig import Config
__author__ = 'James L. Key'
__project__ = 'CERMMorse'
class TestConfig(TestCase):
def setUp(self):
self.conf = Config(configpath='../data/config.json')
... | jameslkey/CERM-Morse-Code-Exhibit | tests/test_config.py | Python | lgpl-3.0 | 2,346 |
from openerp import models, api, _
from openerp.exceptions import UserError
class ExportMoveExport(models.TransientModel):
_name = 'export.move.export'
_description = 'Export Moves'
@api.multi
def create_export_file(self):
context = dict(self._context or {})
moves = self.env['export.mo... | mncoon/odoo-addons | syscoon_finance_export/wizard/move_export.py | Python | lgpl-3.0 | 748 |
__author__ = 'beau'
import serial
ser = serial.Serial('/dev/tty.usbmodem1422',9600, timeout=1)
import time
import sys
def get_angle():
print "requesting angle"
start = time.time()
ser.write('nofddfp\n')
print "..."
reply = ser.readline()
deltaT = time.time()-start
print reply
print "ro... | B3AU/micropython | robocam/main.py | Python | lgpl-3.0 | 452 |
#!env python
# Copyright 2008 Simon Edwards <simon@simonzone.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
... | KDE/twine2 | kbindinggenerator/cmake.py | Python | lgpl-3.0 | 15,357 |
import sys, os
from pythonparser import diagnostic
from ...language.environment import ProcessArgumentManager
from ...master.databases import DeviceDB, DatasetDB
from ...master.worker_db import DeviceManager, DatasetManager
from ..module import Module
from ..embedding import Stitcher
from ..targets import OR1KTarget
fr... | JQIamo/artiq | artiq/compiler/testbench/perf_embedding.py | Python | lgpl-3.0 | 2,231 |
from forgery_py import *
for x in range(20):
randPerson=name.first_name(),name.last_name(),personal.gender(),name.location(),address.phone()
randCV=lorem_ipsum.title(),lorem_ipsum.sentence()
randAddr=address.city(),address.state(),address.country(),address.continent()
randEmail=internet.email_address()
randCo... | WZQ1397/automatic-repo | python/modules/ForgeryPyGenerateVirtualData.py | Python | lgpl-3.0 | 706 |
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 |
"""Connectors"""
__copyright__ = "Copyright (C) 2014 Ivan D Vasin"
__docformat__ = "restructuredtext"
import abc as _abc
import re as _re
from ... import plain as _plain
from .. import _std as _std_http
_BASIC_USER_TOKENS = ('user', 'password')
class HttpBasicClerk(_std_http.HttpStandardClerk):
"""An authen... | nisavid/bedframe | bedframe/auth/http/_basic/_connectors.py | Python | lgpl-3.0 | 1,567 |
# (C) British Crown Copyright 2014, Met Office
#
# This file is part of Iris.
#
# Iris 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) any later ve... | Jozhogg/iris | lib/iris/tests/unit/analysis/maths/test_add.py | Python | lgpl-3.0 | 1,586 |
from collections import defaultdict
from matplotlib import pyplot as plt
from matplotlib.ticker import MultipleLocator
import numpy as np
from msaf.models import Marker
def summarize_alleles2( analytical_sets, temp_dir = None ):
""" return a tuple of (report, plot)
"""
allele_plots = {}
allele_repor... | trmznt/msaf | msaf/lib/tools/allele.py | Python | lgpl-3.0 | 7,523 |
from io.endeios.example.javascripts import ABean, TestInterface
from java.lang import Long
def myecho(a):
return a
def greet():
return "Hello Python"
class MyClass(TestInterface):
def __init__(self):
pass
def getBean(self):
retVal =ABean()
retVal.setName("python")
retVal.setNumber(101)
retVal.setRe... | Endeios/javascripts | src/main/python/functions.py | Python | lgpl-3.0 | 863 |
import androidhelper
import curses
droid = androidhelper.Android()
win=curses.initscr()
result="No result"
try:
win.box()
w,h=win.getmaxyx()
win.addstr(2,2,"Curses Test %sx%s" % (w,h))
win.addstr(10,10,"Hit a key")
win.getch()
finally:
curses.endwin()
print("Result=",result)
| gc313/Learning-Python | testcurses.py | Python | lgpl-3.0 | 292 |
#!/usr/bin/python
# Quick PoC template for HTTP POST form brute force, with anti-CRSF token
# Target: DVWA v1.10
# Date: 2015-10-19
# Author: g0tmi1k ~ https://blog.g0tmi1k.com/
# Source: https://blog.g0tmi1k.com/2015/10/dvwa-login/
import requests
import sys
import re
from BeautifulSoup import BeautifulSoup
# Var... | cybert79/HaXor | boot2root-scripts/dvwa-login-bruteforce-http-post-csrf.py | Python | unlicense | 3,803 |
# coding=utf-8
# Лекция http://uneex.ru/LecturesCMC/PythonIntro2014/03_DataTypes
import decimal
import random
# print decimal.Decimal(1.1) + decimal.Decimal(1.1)
# print decimal.Decimal("1.1") + decimal.Decimal("1.1")
# print dir(random)
a = []
for j in range(0, 10):
a.append(random.randrange(100))
print a
| pasko-evg/Python-2014 | Lecture03/lecture_03.py | Python | unlicense | 321 |
import unittest
import itertools
class Solution:
def maxRotateFunction(self, A):
"""
:type A: List[int]
:rtype: int
"""
if not A:
return 0
n = len(A)
sum_ = sum(A)
f = sum(i * num for i, num in enumerate(A))
max_ = f
for ... | chrisxue815/leetcode_python | problems/test_0396.py | Python | unlicense | 723 |
from util import *
import random, string
from random import randint
import time
class KonačniAutomat(types.SimpleNamespace):
"""Automat koji prepoznaje regularni jezik."""
@classmethod
def iz_komponenti(klasa, stanja, abeceda, prijelaz, početno, završna):
"""Sipser page 35 definition 1.5 - konstrukcija iz petor... | silvahaberl/Jezici-gramatike-automati- | KA.py | Python | unlicense | 16,900 |
from django.conf.urls import url, include
from snippets import views
from rest_framework.routers import DefaultRouter
# Create a router and register our viewsets with it.
router = DefaultRouter()
router.register(r'snippets', views.SnippetViewSet)
router.register(r'users', views.UserViewSet)
# The API URLs are now det... | bertrandvidal/stuff | djangoprojects/django_rest_framework/tutorial/snippets/urls.py | Python | unlicense | 568 |
#!/usr/bin/env python
#encoding=utf-8
from onefile import *
def two():
print "at two\n",
def second():
print "at second\n",
if __name__ == '__main__':
two()
#one()
#first()
| licongyu95/learning_python | core_python_programming/cap2/two.py | Python | unlicense | 180 |
import fechbase
class Records(fechbase.RecordsBase):
def __init__(self):
fechbase.RecordsBase.__init__(self)
self.fields = [
{'name': 'FORM TYPE', 'number': '1'},
{'name': 'FILER FEC CAND ID', 'number': '2'},
{'name': 'CANDIDATE NAME', 'number': '3'},
... | h4ck3rm1k3/FEC-Field-Documentation | fec/version/v5_0/F2.py | Python | unlicense | 1,867 |
from collections import deque
import gym
from gym import spaces
import numpy as np
from ray.rllib.utils.images import rgb2gray, resize
def is_atari(env):
if (
hasattr(env.observation_space, "shape")
and env.observation_space.shape is not None
and len(env.observation_space.shape) <= 2
... | ray-project/ray | rllib/env/wrappers/atari_wrappers.py | Python | apache-2.0 | 10,098 |
import numpy as np
import pandas as pd
import pytest
ROWID_ZERO_INDEXED_BACKENDS = ('omniscidb',)
@pytest.mark.parametrize(
'column',
[
'string_col',
'double_col',
'date_string_col',
pytest.param('timestamp_col', marks=pytest.mark.skip(reason='hangs')),
],
)
@pytest.mark.x... | cloudera/ibis | ibis/backends/tests/test_column.py | Python | apache-2.0 | 1,384 |
# -*- coding: utf-8 -*-
#
# Copyright 2017 Ricequant, 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 ... | ricequant/rqalpha-mod-vnpy | rqalpha_mod_vnpy/ctp/api.py | Python | apache-2.0 | 22,615 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.