code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
from django.db import models
from django.contrib.auth.models import User
class Greeting(models.Model):
author = models.ForeignKey(User, null=True, blank=True)
content = models.TextField()
date = models.DateTimeField(auto_now_add=True)
| towerjoo/mindsbook | guestbook/models.py | Python | bsd-3-clause | 248 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2019 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 the hope ... | chipaca/snapcraft | snapcraft/internal/review_tools/_runner.py | Python | gpl-3.0 | 2,719 |
#!/usr/bin/env python
"""Perspective-distorted sinusoidal grating in gaussian window"""
from VisionEgg import *
start_default_logging(); watch_exceptions()
from VisionEgg.Core import *
from VisionEgg.Gratings import *
from VisionEgg.SphereMap import *
from VisionEgg.Text import *
from VisionEgg.Textures import *
impo... | visionegg/visionegg | demo/mouse_gabor_perspective.py | Python | lgpl-2.1 | 11,119 |
# coding=utf-8
from __future__ import absolute_import, unicode_literals, division
# database settings
MONGODB_SETTINGS = {"host": "localhost",
"port": 27017,
"db": "puls"}
REDIS_SETTINGS = {"host": "localhost",
"port": 6379,
"db": 6}
| za-creature/puls | config/databases.py | Python | mit | 313 |
import json
import numpy as np
from glob import glob
inputs = {
'xml_file_path' : "./data/single_wavelength_copy",
'file_set' : {'p38' : glob( "./data/single_wavelength_copy/*.xml")},
'section' : '280_480_TOP_120',
'ligand_order' : ['Bosutinib','Bosutinib Isomer','Erlotinib','Gefitinib'... | choderalab/assaytools | examples/direct-fluorescence-assay/inputs_p38_singlet.py | Python | lgpl-2.1 | 1,067 |
#!/usr/bin/python
#
# Filename: telnet_top_100_defaults.py
#
# Version: 1.0.0
#
# Author: Joe Gervais (TryCatchHCF)
#
# Summary:
#
# Part of the DumpsterFire Toolset. See documentation at https://github.com/TryCatchHCF/DumpsterFire
#
# Description:
#
#
import os, sys, telnetlib, datetime
from FireModules.fire_modu... | TryCatchHCF/DumpsterFire | FireModules/AccountBruting/telnet_top_100_defaults.py | Python | mit | 4,332 |
import re
import bleach
from django.utils.translation import ugettext_lazy as _
ALLOWED_TAGS = bleach.ALLOWED_TAGS + [
'div', 'span', 'p', 'br', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
'pre', 'code', 'cite',
'dl', 'dt', 'dd', 'small', 'sub', 'sup', 'u', 'strike', 'samp', 'abbr',
'ul', 'ol', 'li',
'no... | anaran/kuma | kuma/wiki/constants.py | Python | mpl-2.0 | 12,866 |
import numpy as np
from .base import Homogeneous, HomogFamilyAlignment
from functools import reduce
class Affine(Homogeneous):
r"""
Base class for all ``n``-dimensional affine transformations. Provides
methods to break the transform down into its constituent
scale/rotation/translation, to view the ho... | patricksnape/menpo | menpo/transform/homogeneous/affine.py | Python | bsd-3-clause | 12,831 |
# The Hazard Library
# Copyright (C) 2012 GEM Foundation
#
# 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 later version.
#
# Th... | ROB-Seismology/oq-hazardlib | openquake/hazardlib/source/simple_fault.py | Python | agpl-3.0 | 8,796 |
# conding: utf-8
from django import forms
from .models import Contact
class ContactForm(forms.ModelForm):
class Meta:
model = Contact
fields = ['name', 'email', 'telephone', 'subject', 'description']
def clean(self):
cleaned_data = super(ContactForm, self).clean()
email = c... | delete/estofadora | estofadora/core/forms.py | Python | mit | 1,354 |
"""
Memory usage functions.
"""
from __future__ import absolute_import
import sys
import collections
import numpy as nm
import scipy.sparse as sp
from sfepy.base.base import basestr, Struct, Output
import six
def get_mem_usage(obj, usage=None, name=None, traversal_order=None, level=0):
"""
Get lower bound of... | rc/sfepy | sfepy/base/mem_usage.py | Python | bsd-3-clause | 5,326 |
# coding: utf-8
from typing import Undefined
class TooLongMessageException(Exception):
length = None
def __init__(self, length):
self.length = length
class CommandError(Exception):
msgid = Undefined(str)
msgparams = Undefined(dict)
##
# Errors with messages 431 ~ 436
##
class NoNicknameGiven... | leandropls/tornadoirc | irc/exceptions.py | Python | bsd-3-clause | 4,329 |
# -*- coding: utf-8 -*-
#
# The MIT License (MIT)
#
# Copyright (c) 2013 Ivo Tzvetkov
#
# 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 ri... | ivotkv/neolixir | neolixir/dummy.py | Python | mit | 2,382 |
#!/usr/bin/env python3
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgp... | nuclear-wizard/moose | modules/porous_flow/doc/content/modules/porous_flow/tests/fluidstate/fluidstate.py | Python | lgpl-2.1 | 5,385 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doctype('Company')
enabled = frappe.db.get_single_value("Accounts Settings", "auto_accounting_for_stock... | VisheshHanda/production_backup | erpnext/patches/v8_0/move_perpetual_inventory_setting.py | Python | gpl-3.0 | 510 |
import os
import unittest
import sys
import testing.postgresql
import utils
from ingestion.etl import Etl
from sqlalchemy import create_engine
from sqlalchemy.orm import session
class EtlLargeTest(unittest.TestCase):
@classmethod
def setUpClass(self):
self._postgresql = testing.postgresql.Postgresql(... | datamindedbe/train-occupancy | tests/ingestion/etl_large_tests.py | Python | apache-2.0 | 1,479 |
# remember to update __version__ in catanlog.py
# when updating this one
__version__ = '0.9.3'
| rosshamish/catanlog | version.py | Python | gpl-3.0 | 96 |
# -*- coding: utf-8 -*-
import json
import urlparse
from django.core.cache import cache
import django.test
from django.utils.datastructures import MultiValueDict
from django.utils import encoding
from mock import patch, Mock
from nose.tools import eq_
from pyquery import PyQuery as pq
import amo
import amo.tests
fro... | wagnerand/zamboni | apps/bandwagon/tests/test_views.py | Python | bsd-3-clause | 43,675 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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... | vertigo235/Sick-Beard-XEM | sickbeard/providers/generic.py | Python | gpl-3.0 | 15,171 |
"""
Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, ...
Note:
n is positive and will fit within the range of a 32-bit signed integer
(n < 2 ** 31).
Example 1:
Input:
3
Output:
3
Example 2:
Input:
11
Output:
0
Explanation:
... | ufjfeng/leetcode-jf-soln | python/400_nth_digit.py | Python | mit | 1,020 |
from gi.repository import Gtk, Gio
import datetime, calendar
from budget.edit_mode import Edit_Entry
class Projections():
def __init__(self, data):
## Entry Row Indexes
# Content Grid
self.ENTRY_ROW_LAYOUT_GRID_INDEX = 0 # Element
# Layout Widget Indexes... | mthxx/Budget | budget/projections.py | Python | gpl-2.0 | 58,183 |
#!/usr/bin/env python
#
##########################################################################
# Copyright 2010, 2012 Nick Foster
#
# This file is part of gr-air-modes
#
# gr-air-modes is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
... | lyusupov/ADSB-Out | ADSB_Encoder.py | Python | gpl-3.0 | 13,011 |
class SortieStatus:
not_takeoff = 'not_takeoff'
landed = 'landed'
in_flight = 'in_flight'
ditched = 'ditched'
crashed = 'crashed'
# air_crash = 'air_crash'
shotdown = 'shotdown'
def __init__(self, is_airstart=False):
self.status = self.in_flight if is_airstart else s... | vaal-/il2_stats | src/mission_report/statuses.py | Python | mit | 3,360 |
#!/usr/bin/python
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'}
DOCUMENTATION = '''
---
modul... | hkariti/ansible | lib/ansible/modules/cloud/amazon/aws_ssm_parameter_store.py | Python | gpl-3.0 | 5,410 |
from __future__ import division, print_function
import os, json
from glob import glob
import numpy as np
from scipy import misc, ndimage
from scipy.ndimage.interpolation import zoom
from keras import backend as K
from keras.layers.normalization import BatchNormalization
from keras.utils.data_utils import get_file
fro... | anhquan0412/deeplearning_fastai | deeplearning1/nbs/vgg16.py | Python | apache-2.0 | 5,740 |
# Copyright (C) 2016-2017 Pelagicore AB
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
# above copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS... | DunderRoffe/softwarecontainer | servicetest/dbus/test_dbus.py | Python | lgpl-2.1 | 6,338 |
# A program that has a list of six colors and chooses one by random. The user can then has three chances to quess the right color. After the third attepmt the program outputs "Nope. The color I was thinking of was..."
import random
# this is the function that will execute the program
def program():
# These are the ... | starnes/Python | guessnameclass.py | Python | mit | 1,452 |
#!/usr/bin/env python3
import asm, datetime, os
"""
Import script for Shelterpro databases in DBF format
Requires my hack to dbfread to support VFP9 -
copy parseC in FieldParser.py and rename it parseV, then remove
encoding so it's just a binary string that can be ignored.
Requires address.dbf, addrlink.dbf, anim... | bobintetley/asm3 | import/shelterpro_dbf.py | Python | gpl-3.0 | 18,704 |
# --------------------------------------------------------------------------------------
# Author: cgarcia@umw.edu
# About: This file runs a scenario based on the parameters in the specified parameter
# file. To see some example parameter files, look in the "params" folder.
# -----------------------------------... | chrisgarcia001/Jepson-2014-2015 | scenario_runner.py | Python | apache-2.0 | 3,033 |
# -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2014 SF Isle of Man Limited
#
# PyBossa 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... | stitchfix/pybossa | test/test_forms.py | Python | agpl-3.0 | 5,646 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, with_statement
import unittest
# import nose
# import nose.tools
import pyrochess
class TestModule(unittest.TestCase):
"""Nose test class."""
# @classmethod
# def setUpClass(self):
# p... | idrmhyprbls/PyroChess | tests/test_basic.py | Python | bsd-3-clause | 687 |
from __future__ import absolute_import, division, print_function, with_statement
import os
import platform
import socket
import sys
import textwrap
from tornado.testing import bind_unused_port
# Encapsulate the choice of unittest or unittest2 here.
# To be used as 'from tornado.test.util import unittest'.
if sys.ver... | mehmetkose/tornado | tornado/test/util.py | Python | apache-2.0 | 3,023 |
#!/usr/bin/env python3
# config.py
# Copyright (C) 2011-`date +%Y` Hamed Saleh and Mahrud Sayrafi
#
# This program comes with ABSOLUTELY NO WARRANTY.
# This is free software, and you are welcome to redistribute it
# under certain conditions; see LICENSE for details.
import sys
sys.path.appen... | jux-foundation/jux | share/config.py | Python | gpl-3.0 | 443 |
# -*- coding: utf-8 -*-
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2002 Bruce J. DeGrasse
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2007-2012 Brian G. Matherly
# Copyright (C) 2008 James Friedmann <jfriedmannj@gmail.com>
# Copyright (C) 2009 Benny Malengier <b... | beernarrd/gramps | gramps/plugins/textreport/detancestralreport.py | Python | gpl-2.0 | 41,493 |
#
# 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 us... | chgm1006/spark-app | src/main/python/ml/lda_example.py | Python | apache-2.0 | 1,900 |
# 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/.
from .constants import LOG
import uuid
import logging
class WSDispatch():
""" Very simple message dispatcher.
... | jrconlin/pushsrv_ws | pushsrv_ws/wsdispatch.py | Python | mpl-2.0 | 3,007 |
# If you feed a slice to a dict you can then return the corresponding value but returning a dict within the function.
def get_status(is_busy):
status = "busy" if is_busy else "available"
return {"status" : status}
# test:
Test.assert_equals(get_status(True)["status"], "busy")
Test.assert_equals(get_status(Fa... | Matt-Stammers/Python-Foundations | Simple Functions/Dict_Indexed_Output.py | Python | gpl-3.0 | 797 |
import os
import re
import io
import sys
import json
import argparse
import unittest
from datetime import date
from getpass import getpass
try:
import github3
except ImportError:
print('To run release tool you need to install github3.py:')
print('')
print(' $ pip install github3.py')
print('')
... | lbryio/lbry | lbry/scripts/release.py | Python | mit | 8,824 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "regdesk.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| vargheseg5/CultRegDesk | regdesk/static/manage.py | Python | lgpl-3.0 | 250 |
# coding: pyxl
regular = <div />
module = <module.tag />
| christoffer/pycharm-pyxl | testdata/TagNames.py | Python | mit | 57 |
#
# (c) 2015, Peter Sprygada <psprygada@ansible.com>
#
# Copyright (c) 2016 Dell Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Licens... | tsdmgz/ansible | lib/ansible/utils/module_docs_fragments/dellos9.py | Python | gpl-3.0 | 2,591 |
# -*- test-case-name: twisted.web.test.test_domhelpers -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Specific tests for (some of) the methods in L{twisted.web.domhelpers}.
"""
from xml.dom import minidom
from twisted.trial.unittest import TestCase
from twisted.web import microdom
... | waseem18/oh-mainline | vendor/packages/twisted/twisted/web/test/test_domhelpers.py | Python | agpl-3.0 | 11,053 |
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import reverse
from django.shortcuts import render, get_object_or_404, redirect
from django.utils.translation import ugettext as _
from events.... | I-sektionen/i-portalen | wsgi/iportalen_django/votings/views.py | Python | mit | 3,056 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pygtk
pygtk.require('2.0')
import gtk, sys, cairo
from math import pi
def expose (widget, event):
cr = widget.window.cairo_create()
# Sets the operator to clear which deletes everything below where an object is drawn
cr.set_operator(cairo.OPERATOR_CLEA... | pacoqueen/Brunilda | test_alpha.py | Python | gpl-3.0 | 1,382 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-10-28 12:36
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('guidedmodules', '0011_modulequestion_answer_type_module'),
]
operations = [
migratio... | GovReady/govready-q | guidedmodules/migrations/0012_remove_taskanswerhistory_answered_by_reference.py | Python | gpl-3.0 | 439 |
# 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/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_executions_operations.py | Python | mit | 25,041 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
SGDiagramDownloader
A QGIS plugin
A tool for QGIS that will download SG (South African Surveyor General)
diagrams.
-------------------
begin ... | kartoza/sg-diagram-downloader | plugin.py | Python | gpl-2.0 | 7,714 |
# Copyright 2013 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 req... | yanheven/cinder | cinder/brick/local_dev/lvm.py | Python | apache-2.0 | 28,909 |
#!/usr/bin/env python3
import os
import sys
_upper_dir = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..'))
if _upper_dir not in sys.path:
sys.path.append(_upper_dir)
import chdb
import config
def print_unsourced_ids_from_wikipedia():
cfg = config.get_localized_config()
db = chdb.init_wp... | guilherme-pg/citationhunt | scripts/print_unsourced_pageids_from_wikipedia.py | Python | mit | 1,269 |
# Copyright 2013 Huawei Technologies Co.,LTD.
# 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
#
# Unl... | queria/my-tempest | tempest/api/identity/admin/test_tokens.py | Python | apache-2.0 | 4,372 |
from marabunta import BaseRobot
from math import sin,cos,pi
class HeadingConsensusRobot(BaseRobot):
"""Robot model for heading consensus.
By iteratively calling the update() method,
this robot will communicate with the rest
of the swarm and align its heading to the
swarm's mean heading.
Obstacl... | david-mateo/marabunta | marabunta/models/HeadingConsensusRobot.py | Python | gpl-3.0 | 2,310 |
from swe_pipeline import run_pipeline
import tempfile
import unittest
from unittest.mock import patch, MagicMock
class TestRunner(unittest.TestCase):
def setUp(self):
self.file = tempfile.NamedTemporaryFile()
def tearDown(self):
self.file.close()
def _default_options(
self, tagged... | robertostling/efselab | tests/test_pipeline_runner.py | Python | gpl-3.0 | 6,147 |
import logging
from django.utils.log import dictConfig
# Taken from https://github.com/nvie/rq/blob/master/rq/logutils.py
def setup_loghandlers(level=None):
# Setup logging for post_office if not already configured
logger = logging.getLogger('post_office')
if not logger.handlers:
dictConfig({
... | LeGast00n/django-post_office | post_office/logutils.py | Python | mit | 1,075 |
#
# 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... | apache/incubator-airflow | airflow/providers/google/cloud/example_dags/example_pubsub.py | Python | apache-2.0 | 6,695 |
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Marcus de Assis Angeloni <marcus@liv.ic.unicamp.br>
# Thu 7 Apr 2016 21:12:03
import numpy
import bob.ip.base
import bob.ip.gabor
import os
import sys
import math
import skimage.feature
from skimage.feature import greycomatrix, greycoprops
from scipy.stats import... | marcusangeloni/smc2016 | processing/feature_extraction.py | Python | apache-2.0 | 9,777 |
'''This gives a number of useful quick methods for dealing with VCF files.
'''
__author__ = "dpark@broadinstitute.org"
__version__ = "PLACEHOLDER"
__date__ = "PLACEHOLDER"
import os, shutil, logging
import pysam
import util.file, util.misc
log = logging.getLogger(__name__)
def make_intervals(i, n, fasta, chr_prefix... | broadinstitute/cms | cms/util/old/vcf.py | Python | bsd-2-clause | 15,777 |
"""Request handling code for pollit"""
import datetime
import hashlib
from django.conf import settings
from django.http import Http404
from django.shortcuts import render_to_response
from django.template import RequestContext
from models import Poll, PollExpired
from settings import AUTHENTICATION_REQUIRED, CHECK_FOR_... | callowayproject/django-pollit | pollit/views.py | Python | apache-2.0 | 7,039 |
# -*- coding: utf-8 -*-
# <Lettuce - Behaviour Driven Development for python>
# Copyright (C) <2010-2012> Gabriel Falcão <gabriel@nacaolivre.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundatio... | yangming85/lettuce | tests/unit/test_strings.py | Python | gpl-3.0 | 8,348 |
import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate... | agry/NGECore2 | scripts/mobiles/endor/arachne_webmaster.py | Python | lgpl-3.0 | 1,565 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# bormeparser documentation build configuration file, created by
# sphinx-quickstart on Sat Jun 27 16:25:25 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
... | PabloCastellano/bormeparser | docs/conf.py | Python | gpl-3.0 | 11,422 |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from .youtube import YoutubeIE
from ..utils import (
js_to_json,
qualities,
determine_ext,
)
class Tele13IE(InfoExtractor):
_VALID_URL = r'^https?://(?:www\.)?t13\.cl/videos(?:/[^/]+)+/(?P<id>[\w-]+)'
_TESTS = [
{
'ur... | valmynd/MediaFetcher | src/plugins/youtube_dl/youtube_dl/extractor/tele13.py | Python | gpl-3.0 | 2,628 |
#
# Copyright (c) 2012 The developers of Aqualid project - http://aqualid.googlecode.com
#
# 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 th... | menify/sandbox | aql/aql/utils/__init__.py | Python | mit | 1,407 |
#!/usr/bin/env python3
import sys
from testrunner import run
# Use a custom global timeout for slow hardware. On microbit (nrf51), the
# test completes in 80s.
TIMEOUT = 100
def testfunc(child):
child.expect_exact('micro-ecc compiled!')
child.expect_exact('Testing 16 random private key pairs and signature ... | A-Paul/RIOT | tests/pkg_micro-ecc/tests/01-run.py | Python | lgpl-2.1 | 540 |
import configparser
import os
import sqlite3
import click
from .. import util
def _initialize_tables(db_path):
"""Create a SQLite database with the default tables and data"""
conn = sqlite3.connect(db_path)
c = conn.cursor()
c.execute('''CREATE TABLE card_networks
(id INTEGER PRIMAR... | dguo/churn | src/subcommands/initialize.py | Python | mit | 4,625 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-04-06 15:44
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('scoping', '0068_snowballingsession_database'),
]
o... | mcallaghan/tmv | BasicBrowser/scoping/migrations/0069_auto_20170406_1544.py | Python | gpl-3.0 | 1,463 |
from sparkle.QtWrapper import QtCore, QtGui
from sparkle.acq.daq_tasks import get_ai_chans
class ChannelDialog(QtGui.QDialog):
def __init__(self, device_name):
super(ChannelDialog, self).__init__()
layout = QtGui.QGridLayout()
cnames = get_ai_chans(device_name)
layout.add... | portfors-lab/sparkle | sparkle/gui/dialogs/channel_dlg.py | Python | gpl-3.0 | 1,792 |
from django.utils.http import urlencode
from allauth.socialaccount import providers
from allauth.socialaccount.providers.base import Provider, ProviderAccount
from allauth.compat import reverse
class DraugiemAccount(ProviderAccount):
def get_avatar_url(self):
ret = None
pic_small_url = self.acc... | wli/django-allauth | allauth/socialaccount/providers/draugiem/provider.py | Python | mit | 1,813 |
from typing import Any
from ....error import GraphQLError
from ....language import FieldNode
from ....type import get_named_type, is_introspection_type
from .. import ValidationRule
__all__ = ["NoSchemaIntrospectionCustomRule"]
class NoSchemaIntrospectionCustomRule(ValidationRule):
"""Prohibit introspection que... | graphql-python/graphql-core | src/graphql/validation/rules/custom/no_schema_introspection.py | Python | mit | 1,139 |
# Copyright (C) 2019-2020 - Raphael Valyi Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
import logging
from odoo import SUPERUSER_ID, api
_logger = logging.getLogger(__name__)
def pre_init_hook(cr):
"""
The objective of this hook is to ensure the Brazil country is
translated... | OCA/l10n-brazil | l10n_br_base/hooks.py | Python | agpl-3.0 | 1,161 |
#
# 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 us... | wtanaka/beam | sdks/python/apache_beam/options/value_provider.py | Python | apache-2.0 | 3,176 |
#!/usr/bin/python
from __future__ import division
import subprocess
import itertools
import operator
import argparse
import os.path as osp
import sys
from oca_projects import OCA_PROJECTS, url
def get_contributions(projects, since, merges):
cmd = ['git', 'log', '--pretty=format:%ai %ae']
if since is not Non... | charbeljc/maintainer-tools | oca/tools/check_contrib.py | Python | agpl-3.0 | 4,010 |
from __future__ import print_function
import mbuild as mb
from mbuild.lib.moieties import H2O
from mbuild.examples import Ethane
def main():
"""Solvate an ethane molecule in a Box of water. """
ethane = Ethane()
water = H2O()
return mb.solvate(ethane, water, 500, box=[2, 2, 2])
if __name__ == "__ma... | Jonestj1/mbuild | mbuild/examples/solvate/solvate.py | Python | mit | 425 |
__author__ = 'jchugh'
from multiprocessing import Process
from ConfigParser import NoOptionError
from simple_kafka import kafka_client
from simple_oauth.oauth import Oauth
from simple_oauth.oauth_request import Request
from simple_oauth.oauth_token import Token
from twitter import TwitterStream
from config import confi... | joychugh/learning-kafka | main.py | Python | mit | 3,725 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013-2017 Open Architects Consulting SPRL.
# Copyright (C) 2018- Coop IT Easy SCRLfs.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | houssine78/vertical-cooperative | easy_my_coop_taxshelter_report/__openerp__.py | Python | agpl-3.0 | 1,753 |
import os
from utils.rpm_yum import get_rpm_list
from utils.rpm_yum import install_rpms
from utils.exec_command import call_subprocess
from utils.archive import unzip_files
from utils.archive import untar_files
###############################################################################
#
def deploy_salt_config_f... | uvsmtid/common-salt-states | states/bootstrap/bootstrap.dir/modules/utils/install_salt.py | Python | apache-2.0 | 7,362 |
# Copyright 2015 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.
import logging
from telemetry.page import shared_page_state
class RepeatableSynthesizeScrollGestureSharedState(
shared_page_state.SharedPageState):
... | js0701/chromium-crosswalk | tools/perf/page_sets/repeatable_synthesize_scroll_gesture_shared_state.py | Python | bsd-3-clause | 580 |
from kombu.mixins import ConsumerMixin
from kombu.log import get_logger
#from kombu.utils import kwdict, reprcall
import subprocess
from queues import task_queues
logger = get_logger(__name__)
class Worker(ConsumerMixin):
def __init__(self, connection):
self.connection = connection
def get_consumer... | echopen/PRJ-medtec_sigproc | echopen-leaderboard/processor_node/worker.py | Python | mit | 2,041 |
#!/usr/bin/python
# 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")... | gzsombor/ranger | kms/scripts/update_property.py | Python | apache-2.0 | 1,535 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def LocalDatastoreInfo(vim, *args, **kwargs):
'''The information details about a datastor... | xuru/pyvisdk | pyvisdk/do/local_datastore_info.py | Python | mit | 1,067 |
class User():
'''
Defines properties and methods foe each user
'''
def __init__(self, username, email, password):
self.username = username
self.email = email
self.password = password
self.bucketlists = {}
self.logged_in = False | mkiterian/bucket-list-app | user.py | Python | mit | 283 |
#!/usr/bin/env python3
"""Plot the live microphone signal(s) with matplotlib.
Matplotlib and NumPy have to be installed.
"""
import math
from matplotlib.animation import FuncAnimation
import matplotlib.pyplot as plt
import numpy as np
import rtmixer
import sounddevice as sd
window = 200 # ms
interval = 30 # ms
bl... | mgeier/python-rtmixer | examples/plot_input.py | Python | mit | 2,484 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.conf.urls import url
from . import views
urlpatterns = [
# URL pattern for the UserListView
url(
regex=r'^$',
view=views.UserListView.as_view(),
name='list'
),
# URL pattern for the U... | rdboyett/urlshortener | urlshortener_project/users/urls.py | Python | bsd-3-clause | 977 |
#!/usr/bin/env python
'''
OWASP ZSC
https://www.owasp.org/index.php/OWASP_ZSC_Tool_Project
https://github.com/zscproject/OWASP-ZSC
http://api.z3r0d4y.com/
https://groups.google.com/d/forum/owasp-zsc [ owasp-zsc[at]googlegroups[dot]com ]
shellcode template used : http://shell-storm.org/shellcode/files/shellcode-57.php
... | Ali-Razmjoo/OWASP-ZSC | lib/generator/linux_x86/system.py | Python | gpl-3.0 | 1,164 |
#--------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""),... | tbombach/autorest | src/client/Python/msrestazure/test/unittest_exceptions.py | Python | mit | 7,105 |
from __future__ import unicode_literals
import dateutil.parser
from django.core.management.base import BaseCommand
from django.contrib.humanize.templatetags.humanize import naturaltime
from clint.textui import columns
from remote_fixtures.utils import S3Mixin, humanize_filesize
class Command(BaseCommand, S3Mixin):
... | gizmag/remote-fixtures | remote_fixtures/management/commands/list_fixtures.py | Python | mit | 913 |
import numpy as np
from sklearn.metrics import average_precision_score
from sklearn.metrics import confusion_matrix
from tensorflow.core.framework import summary_pb2
import matplotlib
import matplotlib.pyplot as plt
import itertools
def add_summary(tf_writer, tag, raw_value, global_step):
value = summary_pb2.Summary... | UCSB-VRL/action_recognition | code/utils.py | Python | mit | 3,396 |
from polls.models import Question, Choice
from api import serializers as s
from rest_framework import generics
class QuestionList(generics.ListCreateAPIView):
queryset = Question.objects.all()
serializer_class = s.QuestionSerializer
class QuestionDetail(generics.RetrieveUpdateDestroyAPIView):
queryset = ... | karimone/django_test | django_project/api/views.py | Python | gpl-3.0 | 531 |
#!/usr/bin/env python3
# MIT License
#
# Copyright (c) 2017 Benedikt Schmitt <benedikt@benediktschmitt.de>
#
# 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 wi... | benediktschmitt/sqlalchemy-materialized-paths | example.py | Python | mit | 4,097 |
######################################################################
# Cloud Routes Web Application
# -------------------------------------------------------------------
# Reaction - Forms Class
######################################################################
from wtforms import TextField, SelectField
from wtf... | codecakes/cloudroutes-service | src/web/reactionforms/aws-ec2stop/__init__.py | Python | agpl-3.0 | 1,254 |
import collections
import asyncio
import traceback
import discord
from discord.ext.commands import Cog
import termcolor
import aiohttp
import core.keystore
import core.parameters
import typing
# This queue is a global object, which actually means that multiple
# shards might fiddle with it. HOWEVER, this is fine s... | DXsmiley/mathbot | mathbot/modules/reporter.py | Python | gpl-3.0 | 3,625 |
from nintendo import aauth
from anynet import http
import pytest
import struct
EXPECTED_REQUEST = \
"POST /v3/application_auth_token HTTP/1.1\r\n" \
"Host: 127.0.0.1:12345\r\n" \
"User-Agent: libcurl (nnAccount; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 12.3.0.0; Add-on 12.3.0.0)\r\n" \
"Accept: */*\r... | Kinnay/NintendoClients | tests/test_aauth.py | Python | mit | 1,400 |
from os import environ
import logging
import rethinkdb as r
from rethinkdb.errors import RqlDriverError, ReqlError
_MCDB = "materialscommons"
_MCDB_HOST = environ.get('MCDB_HOST') or 'localhost'
probe = environ.get('MCDB_PORT')
if not probe:
print("Unable to run without a setting for MCDB_PORT")
exit(-1)
_MCDB... | materials-commons/materialscommons.org | backend/tests/python_api_mulltiuser_check/DB.py | Python | mit | 1,380 |
import patches.base
import patches.utils
class Patch(patches.base.Patch):
description = "Add new locale field to location"
def apply(self):
access_tuple = patches.utils.parseDBAccessDirective()
con = patches.utils.getPostgreSQLConnection(*access_tuple)
cur = con.cursor()
cur.exe... | thehub/hubspace | patches/012.py | Python | gpl-2.0 | 422 |
from __future__ import absolute_import
import os
import shutil
from django.core.files import File
from django.core.files.images import ImageFile
from django.test import TestCase
from django.utils.unittest import skipIf
from .models import Image
if Image:
from .models import (Person, PersonWithHeight, PersonWith... | Proggie02/TestRepo | tests/regressiontests/model_fields/imagefield.py | Python | bsd-3-clause | 15,869 |
'''
@author: frank
'''
import sys, os, os.path
from zstacklib.utils import log
from zstacklib.utils import linux
import zstacklib.utils.iptables as iptables
pidfile = '/var/run/zstack/ceph-primarystorage.pid'
log.configure_log('/var/log/zstack/ceph-primarystorage.log')
logger = log.get_logger(__name__)
import cephage... | zstackorg/zstack-utility | cephprimarystorage/cephprimarystorage/cdaemon.py | Python | apache-2.0 | 1,450 |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import DankcoinTestFramework
from test_framework.util import *
class... | dankcoin/dankcoin | qa/rpc-tests/zapwallettxes.py | Python | mit | 2,882 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import socket
def zooUnauth(ip_list, port=2181, timeout=10):
# 检测zookeeper的未授权访问,超时间隔为10s,
# 这个函数我只想安安静静做个单线程
# 返回值是一个list,用来和主线程的结果合并
result = []
for ip in ip_list:
try:
socket.setdefaulttimeout(timeout)
s = socket.so... | Shinpachi8/SubDomainsResultDeal | util/ZookeeperUnauth.py | Python | apache-2.0 | 947 |
#!/usr/bin/env python
# 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
# "Li... | apache/tashi | src/zoni/hardware/systemmanagement.py | Python | apache-2.0 | 3,800 |
from django.contrib import admin
# Register your models here.
from .models import (Becario, Plaza, Emplazamiento, PreferenciasBecario, PlanFormacion,
AsistenciaFormacion, ResponsableAula, CambiosPendientes, HistorialBecarios, Titulacion,
Convocatoria, AdministracionEmplazamiento)
class BecarioAdmin(admin.ModelAdmin)... | jeplasenciap/gespai | gestion/admin.py | Python | agpl-3.0 | 3,008 |
'''
:copyright: Copyright 2006-2009 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE.txt for details.
'''
class TopicTreeTraverser:
'''
Topic tree traverser. Provides the traverse() method
which traverses a topic tree and calls self._onTopic() for
each topic in the tree that sati... | 163gal/Time-Line | libs64/wx/lib/pubsub/core/topictreetraverser.py | Python | gpl-3.0 | 3,844 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.