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 |
|---|---|---|---|---|---|
from kik.resource import Resource
class Attribution(Resource):
"""
Parent class for all attribution types
"""
pass
class CustomAttribution(Attribution):
"""
Attribution class for custom attributions, as documented at `<https://dev.kik.com/#/docs/messaging#attribution>`_
Usage:
>>> ... | kikinteractive/kik-python | kik/messages/attribution.py | Python | mit | 1,812 |
#!/usr/bin/env python
# Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# 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 limi... | jonparrott/botocore | tests/unit/test_sns_operations.py | Python | mit | 3,318 |
"""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 |
import json
import mock
from django.test import TestCase
from django.test.client import RequestFactory
from readthedocs.core.middleware import FooterNoSessionMiddleware
from readthedocs.rtd_tests.mocks.paths import fake_paths_by_regex
from readthedocs.projects.models import Project
class Testmaker(TestCase):
f... | espdev/readthedocs.org | readthedocs/rtd_tests/tests/test_footer.py | Python | mit | 3,568 |
# coding=utf-8
from __future__ import unicode_literals
from collections import OrderedDict
from .. import BaseProvider
localized = True
class Provider(BaseProvider):
all_colors = OrderedDict((
("AliceBlue", "#F0F8FF"),
("AntiqueWhite", "#FAEBD7"),
("Aqua", "#00FFFF"),
("Aquamarin... | deanishe/alfred-fakeum | src/libs/faker/providers/color/__init__.py | Python | mit | 5,864 |
#### 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 = Building()
result.template = "object/building/player/shared_player_house_naboo_medium_style_01.iff"
result.attrib... | anhstudios/swganh | data/scripts/templates/object/building/player/shared_player_house_naboo_medium_style_01.py | Python | mit | 479 |
'''
sc_studio.string_view
Author: Ming Tsang
Copyright (c) 2014-2015 HKUST SmartCar Team
Refer to LICENSE for details
'''
import binascii
import logging
import time
import tkinter
from tkinter import Tk, Text
from sc_studio import config
from sc_studio.view import View
class StringView(View):
def __init__(self, par... | hkust-smartcar/sc-studio | src/sc_studio/string_view.py | Python | mit | 1,489 |
#### 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 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('twit', '0006_auto_20160419_0248'),
]
operations = [
migrations.CreateModel(
name='Retweet',
fields=[... | arunchaganty/presidential-debates | django/twit/migrations/0007_retweet.py | Python | mit | 697 |
#!/usr/bin/env python3
"""Defines ways to "convert" a file name to an input/output stream."""
from __future__ import absolute_import, division, print_function
from builtins import range
from io import TextIOBase
import math
import os
from emLam.utils import allname, openall
class MultiFileWriter(TextIOBase):
def... | DavidNemeskey/emLam | emLam/corpus/multi_file_writer.py | Python | mit | 2,175 |
class Solution:
# @param {integer} s
# @param {integer[]} nums
# @return {integer}
def minSubArrayLen(self, s, nums):
i = 0
j = -1
n = len(nums)
t = 0
min_len = sys.maxint
while(i<n and j <n):
if t < s:
j += 1
if... | saai/codingbitch | twoPointers/minSubArrayLen.py | Python | mit | 623 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/component/droid/shared_binary_load_lifter_droid_chassis.iff"
result... | anhstudios/swganh | data/scripts/templates/object/tangible/component/droid/shared_binary_load_lifter_droid_chassis.py | Python | mit | 510 |
# -*- coding: utf-8 -*-
u"""
Created on 2015-7-23
@author: cheng.li
"""
from PyFin.Math.Distributions.NormalDistribution import NormalDistribution
from PyFin.Math.Distributions.NormalDistribution import CumulativeNormalDistribution
from PyFin.Math.Distributions.NormalDistribution import InverseCumulativeNormal
__all... | wegamekinglc/Finance-Python | PyFin/Math/Distributions/__init__.py | Python | mit | 429 |
from dolfin import *
class Forms(object):
"""docstring for Forms"""
def __init__(self, mesh, W,F_M,F_NS, u_k,b_k,params,options={}):
assert type(options) is dict, 'options must be a dictionary object'
self.mesh = mesh
self.W = W
self.F_M= F_M
self.F_NS= F_NS
se... | wathen/PhD | MHD/FEniCS/MHD/CG/common/Forms.py | Python | mit | 3,046 |
#!/usr/bin/env python
import glob
import inspect
import os
import keyring
import getpass
import sys
import signal
from i3pystatus import Module, SettingsBase
from i3pystatus.core import ClassFinder
from collections import defaultdict, OrderedDict
def signal_handler(signal, frame):
sys.exit(0)
signal.signal(signal.... | claria/i3pystatus | setting_util.py | Python | mit | 2,881 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Example program to receive packets from the radio link
#
import virtGPIO as GPIO
from lib_nrf24 import NRF24
import time
pipes = [[0xe7, 0xe7, 0xe7, 0xe7, 0xe7], [0xc2, 0xc2, 0xc2, 0xc2, 0xc2]]
radio2 = NRF24(GPIO, GPIO.SpiDev())
radio2.begin(9, 7)
radio2.setRetries(1... | CarlosPena00/Mobbi | Rasp/nrf/lib_nrf24/example-nrf24-recv.py | Python | mit | 1,196 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
for u in orm.Upfront.objects.all():
if u.va_first_use == 'Y':
... | fna/owning-a-home-api | mortgageinsurance/migrations/0003_change_type_va_first_use.py | Python | cc0-1.0 | 2,743 |
# Copyright (c) 2018 Phil Birkelbach
#
# 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.
#
# This program is distrib... | makerplane/FIX-Gateway | tests/test_database.py | Python | gpl-2.0 | 20,881 |
from collections import namedtuple, OrderedDict
from functools import wraps
from queue import Queue
import os
import shutil
import threading
from plover import log, system
from plover.dictionary.loading_manager import DictionaryLoadingManager
from plover.exception import DictionaryLoaderException
from plover.formatti... | openstenoproject/plover | plover/engine.py | Python | gpl-2.0 | 20,307 |
from functools import partial
from xml.sax.saxutils import quoteattr
from navmazing import NavigateToSibling, NavigateToAttribute
from selenium.common.exceptions import NoSuchElementException
import cfme.fixtures.pytest_selenium as sel
from cfme import web_ui as ui
from cfme.exceptions import DestinationNotFound, Sta... | rlbabyuk/integration_tests | cfme/cloud/stack.py | Python | gpl-2.0 | 8,488 |
#! /usr/bin/env python
# --*-- coding:utf-8 --*--
import os
import sys
sys.path.append(os.path.split(os.path.split(os.path.abspath(sys.path[0]))[0])[0])
from CountMan.monitor.util import *
from CountMan.monitor.setting import *
class Queryer(object):
def __init__(self):
self.dao = DatabaseInterface()
... | YFFY/Supervisor | CountMan/monitor/queryer.py | Python | gpl-2.0 | 854 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Campaign.user'
db.alter_column(u'campaign_campaign', '... | fandrefh/AnjoMeu | anjo/campaign/migrations/0005_auto__chg_field_campaign_user.py | Python | gpl-2.0 | 4,461 |
#
# Copyright (c) 2008--2010 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | dmacvicar/spacewalk | backend/server/rhnSQL/sql_types.py | Python | gpl-2.0 | 1,465 |
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
# PyQt4 includes for python bindings to QT
from PyQt4.QtCore import QString, QUrl
from PyQt4.QtGui import QDialog, QDesktopServices
# UI specific includes
from opus_gui.main.views.ui_opusabout impor... | christianurich/VIBe2UrbanSim | 3rdparty/opus/src/opus_gui/main/controllers/dialogs/opusabout.py | Python | gpl-2.0 | 1,157 |
"""
See peoplegui--old.py: the alternative here uses nedted row frames with fixed
widdth labels with pack() to acheive the same aligned layout as grid(), but it
takes two extra lines of code as is (though adding window resize support makes
the two techniques roughly the same--see later in the book).
"""
from tk... | simontakite/sysadmin | pythonscripts/programmingpython/Preview/peoplegui--frame.py | Python | gpl-2.0 | 2,035 |
"""
6 8 7 4 3 2
1. from right to left, find the first element which violates the increasing order, marked as N.
2. from right to left, find the first element which is larger that N, marked as M.
3. swap N and M.
> 7 8 6 4 3 2
4. reverse all digits on the right of M.
> 7 2 3 4 6 8
"""
class Solution:
... | linyaoli/acm | others/hard/next_permutation.py | Python | gpl-2.0 | 1,207 |
# Django
from administrator.models import Administrator
# local Django
from django.contrib import admin
class AdministratorAdmin(admin.ModelAdmin):
pass
admin.site.register(Administrator, AdministratorAdmin)
| kamsuri/vms | vms/administrator/admin.py | Python | gpl-2.0 | 217 |
# -*- coding: utf-8 -*-
import fauxfactory
import pytest
from cfme import test_requirements
from cfme.cloud.provider import CloudProvider
from cfme.infrastructure.provider import InfraProvider
from cfme.markers.env_markers.provider import ONE
from cfme.markers.env_markers.provider import ONE_PER_CATEGORY
from cfme.res... | Yadnyawalkya/integration_tests | cfme/tests/configure/test_tag.py | Python | gpl-2.0 | 18,479 |
#!/usr/bin/env python
#
# Copyright 2013 Tim O'Shea
#
# This file is part of PyBOMBS
#
# PyBOMBS 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)
# any later version.
#
# P... | scalable-networks/ext | pybombs/app_store.py | Python | gpl-2.0 | 5,226 |
from MSMSeeder.attic import core
| choderalab/Ensembler2 | MSMSeeder/__init__.py | Python | gpl-2.0 | 33 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
PointDistance.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*************************... | luofei98/qgis | python/plugins/processing/algs/qgis/ftools/PointDistance.py | Python | gpl-2.0 | 7,944 |
# ~*~ coding: utf-8 ~*~
from __future__ import unicode_literals
from django.conf.urls import url
from rest_framework.routers import DefaultRouter
from .. import api
app_name = "audits"
router = DefaultRouter()
router.register(r'ftp-log', api.FTPLogViewSet, 'ftp-log')
urlpatterns = [
]
urlpatterns += router.urls
| eli261/jumpserver | apps/audits/urls/api_urls.py | Python | gpl-2.0 | 319 |
import random
import json
from django.db import connection
from django.conf import settings
from sitemodel.interface import SiteInterface, SiteModel, random_str
from django.core.files import File
from server.models import Site, TextUpload, BinaryUpload
from sitemodel.frp.model import FRP_Category, FRP_Contact, FRP... | davidbarkhuizen/sdmm | django_web_server/sitemodel/frp/interface.py | Python | gpl-2.0 | 7,900 |
"""Empty stub file that will import with no errors if the
PYTHON_PATH is set correctly.
This file is imported by mwaconfig.py, so most MWA python code should
import this. Use it to put global initialisation code in here, if any.
"""
pass
| ryandougherty/mwa-capstone | MWA_Tools/mwapy/config_local.py | Python | gpl-2.0 | 251 |
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2016 CERN.
#
# INSPIRE 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... | jacenkow/inspire-next | tests/integration/test_orcid.py | Python | gpl-2.0 | 5,384 |
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from urbansim.abstract_variables.abstract_travel_time_variable_for_non_interaction_dataset import abstract_travel_time_variable_for_non_interaction_dataset
class SSS_travel_time_to_DDD(abstract... | christianurich/VIBe2UrbanSim | 3rdparty/opus/src/sanfrancisco/zone/SSS_travel_time_to_DDD.py | Python | gpl-2.0 | 1,871 |
__author__ = 'donstrata'
| eplanet/diffbuilder | test/__init__.py | Python | gpl-2.0 | 25 |
# -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# Unl... | ospaceteam/outerspace | server/lib/rsa/core.py | Python | gpl-2.0 | 1,834 |
#!/usr/bin/env python
import unittest
import os, sys, subprocess, argparse, shutil, re
TEMPLATE_ANDROID_MK = '''\
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
{cut}
LOCAL_MODULE := mixed_sample
LOCAL_SRC_FILES := {cpp1}
LOCAL_LDLIBS += -llog -ldl
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
{cut}
L... | s-trinh/visp | platforms/android/build-tests/test_ndk_build.py | Python | gpl-2.0 | 5,331 |
# -*- coding: utf-8 -*-
import re,urlparse,json
from liveresolver.modules import client
from BeautifulSoup import BeautifulSoup as bs
import xbmcgui
def resolve(url):
try:
result = client.request(url)
html = result
result = json.loads(result)
try:
f4m=res... | sanctuaryaddon/sanctuary | script.module.liveresolver/lib/liveresolver/resolvers/playwire.py | Python | gpl-2.0 | 1,286 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from six.moves import zip
import unittest
import numpy as np
from numpy.testing import (assert_allclose, assert_almost_equal,
assert_array_equal, assert_array_almost_equal)
import p... | jonyroda97/redbot-amigosprovaveis | lib/matplotlib/tests/test_transforms.py | Python | gpl-3.0 | 24,823 |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
# Copyright (c) 2015 Eric Pascual
#
# 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 w... | LE-GO-LE-STOP/Robocup-Junior-Rescue-2016 | src/python/ev3dev/ev3.py | Python | gpl-3.0 | 6,266 |
# coding=utf-8
from __future__ import division
from ..BaseIndicator import Indicator as _Indicator
from ..tools.Tools import PSD as PSD
import numpy as _np
__author__ = 'AleB'
class InBand(_Indicator):
"""
Extract the PSD of a given frequency band
Parameters
----------
freq_min : float, >0... | MPBA/pyphysio | pyphysio/indicators/FrequencyDomain.py | Python | gpl-3.0 | 3,150 |
#!/usr/bin/python
# write an experiment that raises an exception
import sys
import os
BOREALISPATH = os.environ['BOREALISPATH']
sys.path.append(BOREALISPATH)
import experiments.superdarn_common_fields as scf
from experiment_prototype.experiment_prototype import ExperimentPrototype
from experiment_prototype.decimati... | SuperDARNCanada/borealis | experiments/testing_archive/test_taps_not_list.py | Python | gpl-3.0 | 2,729 |
#!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pub... | china-quant/backtrader | backtrader/lineroot.py | Python | gpl-3.0 | 9,645 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015, 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in... | jocave/snapcraft | snapcraft/tests/test_commands_prime.py | Python | gpl-3.0 | 5,460 |
# -*- coding: utf8 -*-
"""
Physical and Chemical data
"""
from csv import reader as csvreader
from mathics.builtin.base import Builtin
from mathics.core.expression import (Expression, from_python, Symbol, String,
strip_context)
from mathics.settings import ROOT_DIR
def load_ele... | benley/Mathics | mathics/builtin/physchemdata.py | Python | gpl-3.0 | 5,698 |
# -*- coding: utf-8 -*-
# darwinvpnlauncher.py
# Copyright (C) 2013 LEAP
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versio... | laborautonomo/bitmask_client | src/leap/bitmask/services/eip/darwinvpnlauncher.py | Python | gpl-3.0 | 6,729 |
# -*- encoding: utf-8 -*-
from abjad.tools import scoretools
from abjad.tools import scoretools
from abjad.tools import markuptools
from abjad.tools import scoretools
from abjad.tools import pitchtools
from abjad.tools.topleveltools import attach
from abjad.tools.topleveltools import iterate
def label_leaves_in_expr_... | mscuthbert/abjad | abjad/tools/labeltools/label_leaves_in_expr_with_numbered_intervals.py | Python | gpl-3.0 | 1,783 |
# !/usr/bin/python
# coding=utf-8
import logging
import lief
logger = logging.getLogger(__name__)
class Checksec:
def __init__(self, macho):
self.macho = lief.parse(macho.as_posix())
def checksec(self):
macho_dict = {}
macho_dict['name'] = self.macho.name
has_nx = self.has_n... | ajinabraham/YSO-Mobile-Security-Framework | mobsf/StaticAnalyzer/views/ios/macho_analysis.py | Python | gpl-3.0 | 9,156 |
from uber.tests import *
@pytest.fixture
def attendee_id():
with Session() as session:
return session.query(Attendee).filter_by(first_name='Regular', last_name='Attendee').one().id
@pytest.fixture(autouse=True)
def mock_apply(monkeypatch):
monkeypatch.setattr(Attendee, 'apply', Mock())
return Atte... | Anthrocon-Reg/ubersystem | uber/tests/models/test_getter.py | Python | gpl-3.0 | 1,761 |
# (c) 2018 Red Hat Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
---
author: Ansible Networking Team
connection: httpapi
short_description: Use httpapi to run... | jimi-c/ansible | lib/ansible/plugins/connection/httpapi.py | Python | gpl-3.0 | 9,898 |
# -*- coding: utf-8 -*-
'''
Copyright (c) 2015 Heidelberg University Library
Distributed under the GNU GPL v3. For full terms see the file
LICENSE.md
'''
from ompannouncements import Announcements
def index():
a = Announcements(myconf, db, locale)
news_list = a.create_announcement_list()
return locals() | UB-Heidelberg/UBHD-OMPArthistorikum | controllers/home.py | Python | gpl-3.0 | 318 |
__author__ = 'teresah'
| Terhands/saskdance | app/web/users/__init__.py | Python | gpl-3.0 | 23 |
#! /usr/bin/env python
#
# IM - Infrastructure Manager
# Copyright (C) 2011 - GRyCAP - Universitat Politecnica de Valencia
#
# 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 t... | indigo-dc/im | test/loadtest/LoadTestRESTR.py | Python | gpl-3.0 | 5,151 |
__author__ = 'igor'
"""
构建 mnist network
构建 Graph
1.inference() - Builds the model as far as is required for running the network
forward to make predictions.
2.loss() -Adds to the inference model the layers required to generate loss
3.training() - Adds to the loss model the Ops required to generate and
apply gradient... | IgowWang/ML_python3 | tensorgo/mnist/mnist.py | Python | gpl-3.0 | 3,726 |
#!/usr/bin/env python3.2
#
# Copyright (c) Net24 Limited, Christchurch, New Zealand 2011-2012
# and Voyager Internet Ltd, New Zealand, 2012-2013
#
# This file is part of py-magcode-core.
#
# Py-magcode-core is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gener... | onlinepcwizard/dms | dms/database/zone_sectag.py | Python | gpl-3.0 | 4,785 |
"""
Examples
========
ModularFocalNetwork(8, [1600, 800], 4).plot() => 8 modules, 4 connections to each neuron
"""
import numpy as np
from Plotters import plot_connectivity_matrix
def range_from_base(base, size):
return xrange(base, base + size)
class ModularFocalNetwork(object):
def __init__(self, C, di... | lawrencejones/neuro | iz/ModularFocalNetwork.py | Python | gpl-3.0 | 1,792 |
# Copyright (c) 2014-2016 Genome Research Ltd.
#
# This file is part of IVA.
#
# IVA 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.
# ... | martinghunt/iva | iva/tests/mapping_test.py | Python | gpl-3.0 | 14,028 |
"""
:synopsis: user-centric views for askbot
This module includes all views that are specific to a given user - his or her profile,
and other views showing profile-related information.
Also this module includes the view listing all forum users.
"""
import calendar
import collections
import functools
import datetime
i... | erichegt/askbot-devel | askbot/views/users.py | Python | gpl-3.0 | 45,938 |
#!/usr/bin/env python3
import numpy as np
import argparse
from smcpp.estimation_tools import load_data
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description='Convert SMC++-formatted data set into PSMCfa-style data.')
parser.add_argument("--contig", help="name of outputted conti... | terhorst/psmcpp | util/smc2psmc.py | Python | gpl-3.0 | 1,221 |
# This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | XeCycle/indico | indico/modules/rb/views/admin/mappers.py | Python | gpl-3.0 | 4,282 |
from flask import Flask, url_for
import requests
import json
from database.database import db_session
from models import City
app = Flask(__name__)
@app.teardown_appcontext
def shutdown_session(exception=None):
db_session.remove()
@app.route('/')
def api_root():
return 'Welcome'
@app.route('/GetCity')
d... | mayankjohri/LetsExplorePython | Section 2 - Advance Python/Chapter S2.05 - REST API - Server & Clients/code/servers/old/3_welcome_with_rest.py | Python | gpl-3.0 | 958 |
#!/usr/bin/env python
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
import string
from future_builtins import map
from calibre.utils.config impo... | nozuono/calibre-webserver | src/calibre/gui2/tweak_book/__init__.py | Python | gpl-3.0 | 4,766 |
# (C) British Crown Copyright 2012 - 2013, Met Office
#
# This file is part of Biggus.
#
# Biggus 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... | ocefpaf/biggus | biggus/tests/test_adapter.py | Python | gpl-3.0 | 8,309 |
from PyQt4 import QtGui, QtCore
from math import fabs
class DiagramPoint(QtGui.QGraphicsEllipseItem):
def __init__(self,x,y, p, infty = False, color = 0):
super(QtGui.QGraphicsEllipseItem, self).__init__()
c = self.color(color)
self.setBrush(QtGui.QBrush(c[0]))
se... | kjemmett/TARGet | bindings/python/dionysus/viewer/diagram.py | Python | gpl-3.0 | 5,443 |
"""DocumentSource scrapes MDN wiki documents."""
import logging
import dateutil
from .base import DocumentBaseSource
logger = logging.getLogger("kuma.scraper")
class DocumentSource(DocumentBaseSource):
"""Coordinate scraping and local cloning of an MDN Document."""
OPTIONS = DocumentBaseSource.STANDARD_... | Elchi3/kuma | kuma/scrape/sources/document.py | Python | mpl-2.0 | 7,446 |
# 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/constants.py | Python | mpl-2.0 | 649 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (C) 2014 Didotech srl (<http://www.didotech.com>).
#
# All Rights Reserved
#
# This program is free software: you can redistr... | dhp-denero/LibrERP | stock_picking_filter/__openerp__.py | Python | agpl-3.0 | 1,611 |
# Copyright 2018 David Vidal <david.vidal@tecnativa.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import _, api, models
from odoo.exceptions import UserError
class IrSequence(models.Model):
_inherit = 'ir.sequence'
@api.constrains('prefix', 'code')
def check_simplified_... | factorlibre/l10n-spain | l10n_es_pos/models/ir_sequence.py | Python | agpl-3.0 | 890 |
# -*- coding: UTF-8 -*-
# COPYRIGHT (c) 2016 Cristóbal Ganter
#
# GNU AFFERO GENERAL PUBLIC LICENSE
# Version 3, 19 November 2007
#
# 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, eit... | TelematicaUSM/EduRT | backend_modules/__init__.py | Python | agpl-3.0 | 902 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('predict', '0002_auto_20160524_0947'),
]
operations = [
migrations.RemoveField(
model_name='predictdataset',
... | IQSS/gentb-site | apps/predict/migrations/0003_auto_20160525_1521.py | Python | agpl-3.0 | 853 |
#!/usr/bin/env python
# coding=utf-8
import datetime
import os
import six
import msgpack
import toughradius
from txzmq import ZmqEndpoint, ZmqFactory, ZmqPushConnection, ZmqPullConnection
from twisted.internet import protocol
from twisted.internet import reactor
from twisted.internet.threads import deferToThread
from t... | sumonchai/ToughRADIUS | toughradius/manage/radiusd.py | Python | agpl-3.0 | 16,110 |
from datetime import datetime
from xmodule.modulestore import Location, namedtuple_to_son
from xmodule.modulestore.exceptions import ItemNotFoundError
from xmodule.modulestore.inheritance import own_metadata
from xmodule.exceptions import InvalidVersionError
from xmodule.modulestore.mongo.base import MongoModuleStore
... | IITBinterns13/edx-platform-dev | common/lib/xmodule/xmodule/modulestore/mongo/draft.py | Python | agpl-3.0 | 9,889 |
from dependencies.dependency import aq_inner
from dependencies.dependency import aq_parent
from lims.permissions import *
from dependencies.dependency import BaseContent
from lims.upgrade import stub
def upgrade(tool):
# Hack prevent out-of-date upgrading
# Related: PR #1484
# https://github.com/bikalabs/... | sciCloud/OLiMS | lims/upgrade/to3015.py | Python | agpl-3.0 | 1,179 |
# 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 import _
from frappe.utils import flt
from erpnext.accounts.report.financial_statements import (get_period_list, get_columns, ... | mbauskar/helpdesk-erpnext | erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.py | Python | agpl-3.0 | 1,352 |
from django.db import models
# Create your models here.
class Event(models.Model):
url = models.URLField(null=True)
img_url = models.URLField(null=True)
title = models.CharField(max_length=200)
description = models.TextField()
def __str__(self):
return self.title
| kermit666/posterwall | posterwall/apps/events/models.py | Python | agpl-3.0 | 294 |
from unittest import TestCase
from agent_finder import find_subclasses
import opencog.cogserver
import test_agent
class HelperTest(TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_find_agents(self):
x=find_subclasses(test_agent,opencog.cogserver.MindAgent)
... | rkarlberg/opencog | tests/cython/test_agent_finder.py | Python | agpl-3.0 | 400 |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import
import hashlib
import six
from djan... | hrayr-artunyan/shuup | shuup/utils/filer.py | Python | agpl-3.0 | 5,631 |
"""
This script strips the console log of a pytest-xdist Jenkins run into the test
lists of each pytest worker.
Assumes the following format:
[test-suite] [worker] RESULT test
"""
import io
import os
import re
import shutil
import click
@click.command()
@click.option(
'--log-file',
help="File name of conso... | eduNEXT/edunext-platform | scripts/xdist/get_worker_test_list.py | Python | agpl-3.0 | 1,941 |
"""
Configuration for bookmarks Django app
"""
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
from edx_django_utils.plugins import PluginSettings, PluginURLs
from openedx.core.djangoapps.plugins.constants import ProjectType, SettingsType
class BookmarksConfig(AppConfig):
... | eduNEXT/edunext-platform | openedx/core/djangoapps/bookmarks/apps.py | Python | agpl-3.0 | 1,146 |
# Copyright (c) 2014 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# including the impl... | credativ/gofer | test/unit/test_metrics.py | Python | lgpl-2.1 | 2,890 |
#!/usr/bin/env python
## \file mesh_deformation.py
# \brief Python script for doing the parallel deformation using SU2_DEF.
# \author F. Palacios
# \version 6.1.0 "Falcon"
#
# The current SU2 release has been coordinated by the
# SU2 International Developers Society <www.su2devsociety.org>
# with selected contribu... | drewkett/SU2 | SU2_PY/mesh_deformation.py | Python | lgpl-2.1 | 3,437 |
# 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 OclIcd(AutotoolsPackage):
"""This package aims at creating an Open Source alternative to v... | iulian787/spack | var/spack/repos/builtin/packages/ocl-icd/package.py | Python | lgpl-2.1 | 2,788 |
""" Sets up the Qt environment to work with various Python Qt wrappers """
# define authorship information
__authors__ = ['Eric Hulser']
__author__ = ','.join(__authors__)
__credits__ = []
__copyright__ = 'Copyright (c) 2012, Projex Software'
__license__ = 'LGPL'
# main... | bitesofcode/xqt | xqt/wrappers/pyside.py | Python | lgpl-3.0 | 9,830 |
# coding: utf-8
from __future__ import unicode_literals
import itertools
import json
import re
from .common import InfoExtractor, SearchInfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urlparse,
)
from ..utils import (
clean_html,
determine_ext,
ExtractorError,
extract_attribut... | rrooij/youtube-dl | youtube_dl/extractor/yahoo.py | Python | unlicense | 23,544 |
# 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... | sxjscience/tvm | python/tvm/relay/testing/resnet_3d.py | Python | apache-2.0 | 10,942 |
# ===============================================================================
# Copyright 2014 Jake Ross
#
# 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... | USGSDenverPychron/pychron | pychron/dashboard/tasks/client/preferences.py | Python | apache-2.0 | 1,997 |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2011,2013 Contributor
#
# 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
#... | jrha/aquilon | build/bootstrap_ms/ms/version/__init__.py | Python | apache-2.0 | 726 |
# Copyright 2014 OpenStack Foundation
# 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... | weiting-chen/manila | contrib/tempest/tempest/api/share/admin/test_share_servers_negative.py | Python | apache-2.0 | 4,715 |
# Copyright (C) 2021 NEC Corp
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | stackforge/tacker | tacker/objects/common.py | Python | apache-2.0 | 2,537 |
# coding=utf-8
#
# 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");... | markflyhigh/incubator-beam | sdks/python/apache_beam/examples/snippets/transforms/element_wise/keys_test.py | Python | apache-2.0 | 1,774 |
# -*- coding: utf-8 -*-
"""Tests of Beautiful Soup as a whole."""
from pdb import set_trace
import logging
import unittest
import sys
import tempfile
from bs4 import (
BeautifulSoup,
BeautifulStoneSoup,
)
from bs4.builder import (
TreeBuilder,
ParserRejectedMarkup,
)
from bs4.element import (
Char... | mdworks2016/work_development | Python/05_FirstPython/Chapter9_WebApp/fppython_develop/lib/python3.7/site-packages/bs4/tests/test_soup.py | Python | apache-2.0 | 28,802 |
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | luotao1/Paddle | python/paddle/fluid/tests/unittests/test_imperative_signal_handler.py | Python | apache-2.0 | 5,136 |
#!/usr/bin/python
import urllib2, base64
import shutil
import json
import json
import argparse
import os
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='''
This script will copy the step/jobentry images from a running carte (with kthin-server) to the img folder
''', formatter_class = arg... | brosander/kettle-vertx-webapp | src/util/copyData.py | Python | apache-2.0 | 1,824 |
# This file is part of the MapProxy project.
# Copyright (C) 2011-2013 Omniscale <http://omniscale.de>
# 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/LIC... | olt/mapproxy | mapproxy/cache/geopackage.py | Python | apache-2.0 | 27,948 |
# 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... | zhreshold/mxnet | python/mxnet/io/io.py | Python | apache-2.0 | 36,450 |
import contextlib
import pytest
import logging
from distutils.version import LooseVersion
from .service import service_available_predicate
from ..clients import marathon
from ..matcher import assert_that, eventually, has_len
logger = logging.getLogger(__name__)
marathon_1_3 = pytest.mark.skipif('marathon_version_l... | mesosphere/marathon | tests/shakedown/shakedown/dcos/marathon.py | Python | apache-2.0 | 4,526 |
#!/usr/bin/env python
"""Test registry for builders."""
# These need to register plugins so, pylint: disable=unused-import
from grr.lib.builders import signing_test
# pylint: enable=unused-import
| pidydx/grr | grr/lib/builders/tests.py | Python | apache-2.0 | 196 |
from __future__ import print_function
import sys
from builtins import input
from builtins import map
# This file is part of Androguard.
#
# Copyright (c) 2012 Geoffroy Gueguen <geoffroy.gueguen@gmail.com>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this... | shuxin/androguard | androguard/decompiler/dad/decompile.py | Python | apache-2.0 | 18,369 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.