text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
import base64
import urllib
from io import StringIO
import orjson
from django.conf import settings
from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.test_helpers import (
create_s3_buckets,
get_test_image_file,
override_settings,
use_s3_backend,
)
from zerver.lib.upload import upload_b... | brainwane/zulip | zerver/tests/test_thumbnail.py | Python | apache-2.0 | 17,260 | 0.00197 |
class Information:
def __init__(self, objectid, cvid, information_type_id, description):
self.objectid = objectid
self.cvid = cvid
self.information_type_id = information_type_id
self.description = description
self.deleted = 0
| itucsdb1611/itucsdb1611 | classes/information.py | Python | gpl-3.0 | 270 | 0 |
#!/usr/bin/python2.4
# Copyright (c) 2006-2008 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.
"""This is a simple HTTP server used for testing Chrome.
It supports several test URLs, as specified by the handlers in TestPa... | kuiche/chromium | net/tools/testserver/testserver.py | Python | bsd-3-clause | 36,527 | 0.008104 |
# 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 use ... | Kami/libcloud | libcloud/common/types.py | Python | apache-2.0 | 6,989 | 0 |
from enum import Enum
class EventType(Enum):
"""Enum containing the various types of events that can occur."""
CLIENT_READY = "CLIENT_READY"
CLIENT_RESUMED = "CLIENT_RESUMED"
MESSAGE_RECEIVED = "MESSAGE_RECEIVED"
SERVER_MESSAGE_RECEIVED = "SERVER_MESSAGE_RECEIVED"
PRIVATE_MESSAGE_RECEIVED = "... | nint8835/NintbotForDiscordV2 | NintbotForDiscord/Enums.py | Python | mit | 1,656 | 0 |
import os
import re
import sys
# This import is apparently needed for Nose on Red Hat's Python
import multiprocessing
from distutils.command.build_ext import build_ext
from distutils.errors import (CCompilerError, DistutilsExecError,
DistutilsPlatformError)
try:
from setuptools impo... | kikinteractive/MaxMind-DB-Reader-python | setup.py | Python | apache-2.0 | 5,415 | 0.000554 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from sqlalchemy import *
from sqlalchemy import exc
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import *
from flask_login import AnonymousUserMixin
import sys
import os
import logging
from werkzeug.security import generate_password_hash
from... | Kennyl/calibre-web | cps/ub.py | Python | gpl-3.0 | 23,868 | 0.005237 |
# -*- coding: utf-8 -*-
'''
# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
#
# This file was generated and any changes will be overwritten.
'''
from __future__ import unicode_literals
from ..collection_base impo... | OneDrive/onedrive-sdk-python | src/onedrivesdk/model/items_collection_page.py | Python | mit | 1,072 | 0.005597 |
def test_median_angle_correct():
from CPAC.median_angle import median_angle_correct
import numpy as np
import nibabel as nb
def getY(filepath):
nii = nb.load(filepath)
data = nii.get_data().astype(np.float64)
mask = (data != 0).sum(-1) != 0
return data[mask]... | erramuzpe/C-PAC | CPAC/median_angle/tests/test_median_angle.py | Python | bsd-3-clause | 1,151 | 0.01477 |
import uuid
from django.contrib.auth.models import User
from django.db import models
class Token(models.Model):
key = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
created_at = models.DateTimeField(auto_now_add=True)
is_active = models.BooleanField(default=True, db_index=True)
... | rafaelsierra/estoudebike-api | src/bike_auth/models.py | Python | apache-2.0 | 376 | 0.00266 |
# -*- coding: utf-8 -*-
#
# Cloud Robotics FX 会話理解API用メッセージ
#
# @author: Osamu Noguchi <noguchi@headwaters.co.jp>
# @version: 0.0.1
import cloudrobotics.message as message
APP_ID = 'SbrApiServices'
PROCESSING_ID = 'RbAppConversationApi'
# 会話メッセージ
#
class ConversationMessage(message.CRFXMessage):
def __init__... | seijim/cloud-robotics-fx-v2 | CloudRoboticsApi/ClientCode_Pepper/HeadWaters/PepperCode2/lib/cloudrobotics/conversation/message.py | Python | mit | 746 | 0.002809 |
from flask import Flask, redirect, url_for, session, request
from flask_oauthlib.client import OAuth, OAuthException
FACEBOOK_APP_ID = '188477911223606'
FACEBOOK_APP_SECRET = '621413ddea2bcc5b2e83d42fc40495de'
app = Flask(__name__)
app.debug = True
app.secret_key = 'development'
oauth = OAuth(app)
facebook = oauth... | Fleurer/flask-oauthlib | example/facebook.py | Python | bsd-3-clause | 1,663 | 0 |
import os
import logging
from .axle import split_package_name
logger = logging.getLogger(__name__)
class Path(object):
def __init__(self, path):
self.path = path
@property
def exists(self):
return os.path.exists(self.path)
class ReleaseValue(object):
_md5 = ''
def __init__(... | rob-b/belt | belt/values.py | Python | bsd-3-clause | 1,091 | 0 |
# -*- coding: utf-8 -*-
import time
from ..utils.purge import uniquify
class EventManager:
def __init__(self, core):
self.pyload = core
self._ = core._
self.clients = []
def new_client(self, uuid):
self.clients.append(Client(uuid))
def clean(self):
for n, client... | vuolter/pyload | src/pyload/core/managers/event_manager.py | Python | agpl-3.0 | 3,084 | 0 |
# -*- 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... | crmccreary/openerp_server | openerp/addons/board/__init__.py | Python | agpl-3.0 | 1,082 | 0.001848 |
import _plotly_utils.basevalidators
class NamelengthsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="namelengthsrc", parent_name="bar.hoverlabel", **kwargs
):
super(NamelengthsrcValidator, self).__init__(
plotly_name=plotly_name,
... | plotly/plotly.py | packages/python/plotly/plotly/validators/bar/hoverlabel/_namelengthsrc.py | Python | mit | 432 | 0.002315 |
import collections
import os
import codecs
from .top_block import TopBlockGenerator
from .. import Constants
from ..io import yaml
class HierBlockGenerator(TopBlockGenerator):
"""Extends the top block generator to also generate a block YML file"""
def __init__(self, flow_graph, _):
"""
Ini... | mrjacobagilbert/gnuradio | grc/core/generator/hier_block.py | Python | gpl-3.0 | 6,202 | 0.000967 |
import subprocess
def send_command(*args):
delimiter = '&&'
if len(args) == 2 and delimiter in args[1]:
split_arg = args[1].split(delimiter)
args = [args[1]]
args.extend(split_arg)
process = subprocess.Popen(args, stdout=subprocess.PIPE)
return process.communicate()[0].decode("... | andreipradan/raspberrymediaplayer | src/radio/api/utils.py | Python | mit | 328 | 0 |
# import .1dslicefrom3d
import artistools.makemodel.botyanski2017 | lukeshingles/artistools | artistools/makemodel/__init__.py | Python | mit | 65 | 0.015385 |
#from . import sslTests
| lwahlmeier/python-litesockets | tests/__init__.py | Python | unlicense | 24 | 0.041667 |
# -*- 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 'PayPalIPN.custom'
db.alter_column(u'paypal_ipn', 'cust... | aldenjenkins/foobargamingwebsite | paypal/standard/ipn/south_migrations/0006_auto__chg_field_paypalipn_custom__chg_field_paypalipn_transaction_subj.py | Python | bsd-3-clause | 14,862 | 0.007872 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2013 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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 t... | bluemini/kuma | vendor/packages/translate/storage/test_dtd.py | Python | mpl-2.0 | 20,624 | 0.001746 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others
# Copyright: (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, div... | jtyr/ansible | lib/ansible/modules/command.py | Python | gpl-3.0 | 13,711 | 0.003502 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | openstack/oslo.vmware | oslo_vmware/_i18n.py | Python | apache-2.0 | 852 | 0 |
from distutils.core import setup, Extension
setup(name = '_intcode',
version = '0.1',
ext_modules = [Extension('_intcode', sources = ['_intcode.c'])])
| msullivan/advent-of-code | 2019/setup.py | Python | mit | 164 | 0.04878 |
from __future__ import unicode_literals
import re
import time
import xml.etree.ElementTree
from .common import InfoExtractor
from ..utils import (
ExtractorError,
parse_duration,
)
class ClipfishIE(InfoExtractor):
IE_NAME = 'clipfish'
_VALID_URL = r'^https?://(?:www\.)?clipfish\.de/.*?/video/(?P<id... | apllicationCOM/youtube-dl-api-server | youtube_dl_server/youtube_dl/extractor/clipfish.py | Python | unlicense | 1,624 | 0.000616 |
# -*- 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):
# Adding field 'Customer.deleted'
db.add_column(u'django_fastbill_custome... | phelmig/django-fastbill | django_fastbill/migrations/0004_auto__add_field_customer_deleted.py | Python | mit | 10,979 | 0.007469 |
#!/usr/bin/python
#
# Copyright (C) 2006 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | santisiri/popego | envs/ALPHA-POPEGO/lib/python2.5/site-packages/gdata/test_data.py | Python | bsd-3-clause | 87,056 | 0.001861 |
#!/usr/bin/env python
# (C) Copyright IBM Corporation 2004, 2005
# 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 limitation
# ... | ayoubg/gem5-graphics | Mesa-7.11.2_GPGPU-Sim/src/mapi/glapi/gen/gl_XML.py | Python | bsd-3-clause | 24,796 | 0.038877 |
import unittest
from ebird.api.validation import clean_provisional
class CleanProvisionalTests(unittest.TestCase):
"""Tests for the clean_provisional validation function."""
def test_converts_bool(self):
self.assertEqual("true", clean_provisional(True))
self.assertEqual("false", clean_provis... | ProjectBabbler/ebird-api | tests/validation/test_clean_provisional.py | Python | mit | 483 | 0 |
from __future__ import unicode_literals
from django.apps import AppConfig
class SystemConfig(AppConfig):
name = 'system'
| inteos/IBAdmin | system/apps.py | Python | agpl-3.0 | 128 | 0 |
# 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 Glm(CMakePackage):
"""OpenGL Mathematics (GLM) is a header only C++ mathematics library fo... | rspavel/spack | var/spack/repos/builtin/packages/glm/package.py | Python | lgpl-2.1 | 666 | 0.001502 |
"""
Provides mathematical functions
"""
#############################################################################
# #
# PyMS software for processing of metabolomic mass-spectrometry data #
# Copyright (C) 2005-2012 Vladimir Lik... | strets123/pyms | Utils/Math.py | Python | gpl-2.0 | 5,643 | 0.010987 |
try:
INSTALLED_APPS
except NameError:
INSTALLED_APPS=()
#Generated Config - Don't modify above this line
| igudym/twango | twango/template/default/src/conf/h_third_party_apps.py | Python | bsd-3-clause | 115 | 0.026087 |
# Copyright 2010-2011 OpenStack Foundation
# Copyright 2013 IBM 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/license... | phenoxim/nova | nova/api/openstack/compute/views/images.py | Python | apache-2.0 | 6,081 | 0.000493 |
# pykarta/geocoder/massgis.py
# Copyright 2013--2019, Trinity College Computing Center
# Last modified: 22 October 2019
from __future__ import print_function
import lxml.etree as ET
from .geocoder_base import GeocoderBase, GeocoderResult, GeocoderError
import pykarta.address
# https://wiki.state.ma.us/confluence/page... | david672orford/pykarta | pykarta/geocoder/massgis.py | Python | gpl-2.0 | 3,478 | 0.02674 |
# -*- coding: iso-8859-1 -*-
# __init__.py: Top level .py file for python solution analysis tools.
#
# Copyright (C) 2010
# ASTRON (Netherlands Institute for Radio Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This file is part of the LOFAR software suite.
# The LOFAR software suite is free software: y... | kernsuite-debian/lofar | CEP/Calibration/ExpIon/src/__init__.py | Python | gpl-3.0 | 1,065 | 0.001878 |
#!/usr/bin/env python
# Install.py tool to build the GPU library
# used to automate the steps described in the README file in this dir
from __future__ import print_function
import sys,os,subprocess
# help message
help = """
Syntax from src dir: make lib-gpu args="-m machine -h hdir -a arch -p precision -e esuffix -... | jag1g13/lammps | lib/gpu/Install.py | Python | gpl-2.0 | 5,201 | 0.013459 |
"""
Interactive tool to draw mask on an image or image-like array.
TODO:
* need concept of subannotation
* need to take options on a right click of an annotation
* add support for arbitrary polygons back in .
* rename species_list to label_list or category_list
* Just use metadata instead of specie... | Erotemic/plottool | plottool_ibeis/interact_annotations.py | Python | apache-2.0 | 52,275 | 0.001607 |
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.models import TagKey, TagValue
from sentry.testutils import APITestCase
class ProjectTagKeyValuesTest(APITestCase):
def test_simple(self):
project = self.create_project()
tagkey = TagKey.objects.creat... | TedaLIEz/sentry | tests/sentry/api/endpoints/test_project_tagkey_values.py | Python | bsd-3-clause | 862 | 0.00116 |
# UrbanFootprint v1.5
# Copyright (C) 2017 Calthorpe Analytics
#
# This file is part of UrbanFootprint version 1.5
#
# UrbanFootprint is distributed under the terms of the GNU General
# Public License version 3, as published by the Free Software Foundation. This
# code is distributed WITHOUT ANY WARRANTY, without impl... | CalthorpeAnalytics/urbanfootprint | footprint/main/models/analysis_module/agriculture_module/agriculture_updater_tool.py | Python | gpl-3.0 | 9,307 | 0.002579 |
from __future__ import unicode_literals
from django.core.exceptions import PermissionDenied
from django.core.mail import send_mail
from django.core import validators
from django.db import models
from django.db.models.manager import EmptyManager
from django.utils.crypto import get_random_string, salted_hmac
from django... | dhoffman34/django | django/contrib/auth/models.py | Python | bsd-3-clause | 17,902 | 0.001061 |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Normal
from ..net import VAE
from ..util.common import batch_to_sequence, sequence_to_batch
from ..util.init import orthogonal_init
class _CNNBase(nn.Module):
def __init__(self):
super(_CNNBase, self).__ini... | qsheeeeen/Self-Driving-Car | rl_toolbox/policy/shared.py | Python | mit | 8,677 | 0 |
__author__ = 'thgoette'
from BasicTest import BasicTest, wait
import unittest
class InlineCallbacks(BasicTest):
@wait
def test_inlinecallbacks(self):
print "Starting inlineCallback Test "
def callback(result):
print "Callback: " + str(result)
self.assertEqual(result... | CN-UPB/OpenBarista | utils/decaf-utils-rpc/tests/unittests/InlineCallbacks.py | Python | mpl-2.0 | 468 | 0.002137 |
#!/usr/bin/env python
"""
fastq_split.py [-n|--num_files N_FILES] <input filename> <output directory>
"""
import os
import sys
import math
from srt.fastq import *
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-n", "--num_files", dest="num_files",
help="Number of output files", type... | PapenfussLab/Srtools | bin/fastq_split.py | Python | artistic-2.0 | 1,113 | 0.006289 |
# -*- coding: utf-8 -*-
"""Test CLR field support."""
import System
import pytest
from Python.Test import FieldTest
def test_public_instance_field():
"""Test public instance fields."""
ob = FieldTest()
assert ob.PublicField == 0
ob.PublicField = 1
assert ob.PublicField == 1
with pytest.rai... | AlexCatarino/pythonnet | tests/test_field.py | Python | mit | 8,719 | 0 |
import traceback, socket, os, time, smtplib, re, sys, getpass, logging
try:
import autotest.common as common
except ImportError:
import common
from autotest_lib.client.common_lib import global_config
CONFIG_SECTION = 'SCHEDULER'
CONFIG_SECTION_SMTP = 'SERVER'
class EmailNotificationManager(object):
def _... | libvirt/autotest | scheduler/email_manager.py | Python | gpl-2.0 | 3,273 | 0.002139 |
# -*- coding: utf-8 -*-
NAMESPACE_NFE = 'http://www.portalfiscal.inf.br/nfe'
NAMESPACE_SIG = 'http://www.w3.org/2000/09/xmldsig#'
NAMESPACE_SOAP = 'http://www.w3.org/2003/05/soap-envelope'
NAMESPACE_XSI = 'http://www.w3.org/2001/XMLSchema-instance'
NAMESPACE_XSD = 'http://www.w3.org/2001/XMLSchema'
NAMESPACE_METODO = ... | leonardoRC/PyNFe | pynfe/utils/flags.py | Python | lgpl-3.0 | 11,560 | 0.004088 |
# Standard Library
from builtins import str
import os
import zipfile
from urllib.parse import quote_plus
from urllib.request import urlopen
# Third Party Stuff
from django import template
from django.conf import settings
from django.contrib.auth.models import User
from django.db.models import Q
# Spoken Tutorial Stuf... | Spoken-tutorial/spoken-website | creation/templatetags/creationdata.py | Python | gpl-3.0 | 11,230 | 0.011843 |
"""
Tests for content parsing, and form-overloaded content parsing.
"""
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login, logout
from django.contrib.sessions.middleware import SessionMiddleware
from django.core.handlers.wsgi import W... | MobileWebApps/backend-python-rest-gae | lib/rest_framework/tests/test_request.py | Python | bsd-3-clause | 13,239 | 0.001057 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Article',
fields=[
('id', models.AutoField(verb... | nth2say/simple_django_blog | blog/migrations/0001_initial.py | Python | mit | 1,171 | 0.001708 |
import os
from celery import Celery
from django.apps import apps, AppConfig
from django.conf import settings
if not settings.configured:
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.local') # pragma: no cover
app = Cele... | savioabuga/lipame | lipame/taskapp/celery.py | Python | mit | 903 | 0.005537 |
#!/usr/bin/env python3
# Copyright 2013,2016 The Font Bakery Authors.
# Copyright 2017 The Google Font Tools Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.... | googlefonts/gftools | bin/gftools-nametable-from-filename.py | Python | apache-2.0 | 7,889 | 0.013056 |
# This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from flask import session
from indico.core import signals
from i... | mic4ael/indico | indico/modules/groups/__init__.py | Python | mit | 889 | 0.001125 |
# Common dialog code.
#
# Copyright (C) 2007, 2008 Red Hat, Inc. All rights reserved.
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distributed in the hope that it
... | ystk/debian-audit | system-config-audit/src/dialog_base.py | Python | gpl-2.0 | 5,208 | 0.000768 |
from enum import Enum
from collections import namedtuple
import settings
import os
import dbaccess
import urllib.request
import ast
import shutil
def move_file(filename, src, dest):
src = os.path.join(src, filename)
dest = os.path.join(dest, filename)
shutil.move(src, dest)
def create_file(filename, path... | thyagostall/apollo | src/problem.py | Python | mit | 6,320 | 0.004589 |
definition = {
"where": "?subj a foaf:Organization .",
"fields": {
"name": {
"where": "?subj rdfs:label ?obj ."
}
}
} | gwu-libraries/vivo2notld | vivo2notld/definitions/organization_summary.py | Python | mit | 157 | 0.006369 |
# Copyright 2020 The TensorFlow 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 applica... | tombstone/models | official/vision/detection/modeling/architecture/nn_blocks.py | Python | apache-2.0 | 11,423 | 0.002626 |
#encoding:utf-8
def get_topn(logfile, topn=10):
fhandler = open(logfile, 'r')
rt_dict = {}
# 统计
while True:
line = fhandler.readline()
if line == '':
break
nodes = line.split()
ip, url, code = nodes[0], nodes[6], nodes[8]
key = (ip, ... | 51reboot/actual_09_homework | 07/zhaoyuanhai/cmdb/loganalysis.py | Python | mit | 1,002 | 0.003018 |
from django.core.mail import send_mail
from greatesttodo.celery import app
from reminder.models import Reminder
@app.task
def send_email_reminder(reminder_id):
try:
reminder = Reminder.objects.get(id=reminder_id)
send_mail(
subject=reminder.text,
message=reminder.text,
... | Rub4ek/scalors-assignment-backend | reminder/tasks.py | Python | mit | 447 | 0 |
#!/usr/bin/env python
# Unix SMB/CIFS implementation.
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007-2008
#
# Based on the original in EJS:
# Copyright (C) Andrew Tridgell <tridge@samba.org> 2005
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General P... | gwr/samba | source4/scripting/python/samba/__init__.py | Python | gpl-3.0 | 11,696 | 0.002137 |
import unittest
import sys
import inspect
from robot.running.handlers import _PythonHandler, _JavaHandler, DynamicHandler
from robot import utils
from robot.utils.asserts import *
from robot.running.testlibraries import TestLibrary
from robot.running.dynamicmethods import (
GetKeywordArguments, GetKeywordDocumenta... | yahman72/robotframework | utest/running/test_handlers.py | Python | apache-2.0 | 12,868 | 0.001399 |
##
##SMART FP7 - Search engine for MultimediA enviRonment generated contenT
##Webpage: http://smartfp7.eu
##
## 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/.
##... | SmartSearch/Edge-Node | LinkedDataManager/feed_generator/ldm_feeder.py | Python | mpl-2.0 | 8,016 | 0.013348 |
# -*- coding: utf-8 -*-
""" Tests of managing ESX hypervisors directly. If another direct ones will be supported, it should
not be difficult to extend the parametrizer.
"""
import pytest
from cfme.infrastructure.provider.virtualcenter import VMwareProvider
from cfme.common.provider import DefaultEndpoint
from utils i... | dajohnso/cfme_tests | cfme/tests/infrastructure/test_esx_direct_host.py | Python | gpl-2.0 | 3,559 | 0.001686 |
# coding=utf-8
# Copyright 2020 The Learning-to-Prompt Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | google-research/l2p | augment/color_util.py | Python | apache-2.0 | 17,401 | 0.006724 |
from django.conf.urls import patterns, url
from cart import views
urlpatterns = patterns('',
url(r'^$', views.view_cart, name='view'),
url(r'^add/$', views.add_to_cart, name='add'),
url(r'^remove/$', views.remove_from_cart, name='remove'),
... | juntatalor/qexx | cart/urls.py | Python | mit | 768 | 0.004049 |
# -*- coding: utf-8 -*-
import json
import os
import urllib.parse
from functools import wraps
import bottle
from bottle import (
route,
run,
jinja2_template as template,
redirect,
request,
response,
static_file,
BaseTemplate,
)
import tweepy
BASE_DIR = os.path.dirname(os.path.abspath(_... | kk6/tssm | app.py | Python | mit | 5,552 | 0.001441 |
# -*- coding: utf-8 -*-
# © 2016 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import api, fields, models
from dateutil.rrule import (rrule,
YEARLY,
MONTHLY,
WEEKLY,
... | be-cloud-be/horizon-addons | server-tools/date_range/wizard/date_range_generator.py | Python | agpl-3.0 | 2,576 | 0 |
# -*- coding: utf-8 -*-
# Copyright (C) 2016 Adam Collin, Mathew Topper
# Copyright (C) 2017-2018 Mathew Topper
#
# 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... | DTOcean/dtocean-core | dtocean_core/interfaces/plots_installation.py | Python | gpl-3.0 | 18,785 | 0.000799 |
from server.util import ScriptManager
def objectClick2_2213(player, obId, obX, obY):
player.getPA().openUpBank()
def objectClick2_11758(player, obId, obX, obY):
player.getPA().openUpBank() | TheRealVestige/VestigeX-Server | Data/scripts/player/objects/objectclick2.py | Python | gpl-3.0 | 196 | 0.02551 |
import datetime
from airflow.models import DAG
from airflow.operators.latest_only_operator import LatestOnlyOperator
import utils.helpers as helpers
args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime.datetime(2017, 3, 1),
'retries': 1,
'retry_delay': datetime.timedelta(mi... | opentrials/opentrials-airflow | dags/data_contributions.py | Python | mpl-2.0 | 718 | 0 |
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_XXX
# Purpose: Description of the plug-in.
#
# Author: Name and e-mail address
#
# Created: Date
# Copyright: (c) Name
# Licence: GPL
# ----------------------------... | LubyRuffy/spiderfoot | modules/sfp_template.py | Python | gpl-2.0 | 2,631 | 0.00152 |
import os
import sys
from robot.api import logger
from keywordgroup import KeywordGroup
from robot.libraries.BuiltIn import BuiltIn
try:
from robot.libraries.BuiltIn import RobotNotRunningError
except ImportError:
RobotNotRunningError = AttributeError
class Logging(KeywordGroup):
# Private
def _deb... | overfly83/bjrobot | src/BJRobot/keywords/logging.py | Python | mit | 1,462 | 0.004788 |
"""Layout for images and other replaced elements.
See http://dev.w3.org/csswg/css-images-3/#sizing
"""
from .min_max import handle_min_max_height, handle_min_max_width
from .percent import percentage
def default_image_sizing(intrinsic_width, intrinsic_height, intrinsic_ratio,
specified_wid... | Kozea/WeasyPrint | weasyprint/layout/replaced.py | Python | bsd-3-clause | 11,239 | 0 |
from __future__ import absolute_import | rmwdeveloper/webhack | webhack/__init__.py | Python | mit | 38 | 0.026316 |
# -*- coding: utf-8 -*-
"""Provides vertical object."""
from __future__ import absolute_import
from ..entity import Entity
class Vertical(Entity):
"""docstring for Vertical."""
collection = 'verticals'
resource = 'vertical'
_relations = {
'advertiser',
}
_pull = {
'id': int,
... | Cawb07/t1-python | terminalone/models/vertical.py | Python | bsd-3-clause | 596 | 0 |
from django.conf import settings
from django.utils import translation
from geotrek.tourism import models as tourism_models
from geotrek.tourism.views import TouristicContentViewSet, TouristicEventViewSet
from geotrek.trekking.management.commands.sync_rando import Command as BaseCommand
# Register mapentity models
fro... | johan--/Geotrek | geotrek/tourism/management/commands/sync_rando.py | Python | bsd-2-clause | 1,966 | 0.002543 |
"""
Copyright 2018 vidosits (https://github.com/vidosits/)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agree... | delftrobotics/keras-retinanet | tests/models/test_densenet.py | Python | apache-2.0 | 1,587 | 0.00063 |
# This import depends on the automake rule protoc_middleman, please make sure
# protoc_middleman has been built before run this file.
import json
import re
import os.path
# BEGIN OPENSOURCE
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir))
# END OPENSOURCE
import tmp.bench... | scheib/chromium | third_party/protobuf/benchmarks/util/result_parser.py | Python | bsd-3-clause | 8,710 | 0.00907 |
"""Active Directory authentication backend."""
import itertools
import logging
import dns
from django.conf import settings
from django.contrib.auth.models import User
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
try:
import ldap
from ldap.dn import dn2s... | reviewboard/reviewboard | reviewboard/accounts/backends/ad.py | Python | mit | 18,842 | 0 |
import os
import sys
setupfile = file("setup.py",'r')
input = sys.argv[1]
lines = setupfile.readlines()
output = file("setup.py", 'w')
for line in lines:
if line.startswith(" library_dirs"):
newline = " library_dirs=['"+str(input)+"'],\n"
output.write(newline)
else:
... | kshedstrom/pyroms | bathy_smoother/external/lp_solve_5.5/extra/Python/pyhelp.py | Python | bsd-3-clause | 381 | 0.023622 |
# Outspline - A highly modular and extensible outliner.
# Copyright (C) 2011-2014 Dario Giovannetti <dev@dariogiovannetti.net>
#
# This file is part of Outspline.
#
# Outspline 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 Softw... | xguse/outspline | src/outspline/conf/plugins/wxtrayicon.py | Python | gpl-3.0 | 1,043 | 0 |
import pytest
from addons.osfstorage.models import OsfStorageFile
from api.base.settings.defaults import API_BASE
from api_tests import utils as test_utils
from api_tests.preprints.filters.test_filters import PreprintsListFilteringMixin
from api_tests.preprints.views.test_preprint_list_mixin import PreprintIsPublished... | TomBaxter/osf.io | api_tests/nodes/views/test_node_preprints.py | Python | apache-2.0 | 6,285 | 0.003819 |
'''
Router Sim v1.0
Program description: This program simulates a network consisting of routers.
It will be displayed in a command line interface and feature controls
to build and maintain the network by modifying routers, save/load the
network to external files, display information about the routers in
the network ... | WGDEVS/RouterSim | RouterSim.py | Python | gpl-2.0 | 10,354 | 0.016226 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-02-15 07:47
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('studygroups', '0083_auto_20180209_1210'),
]
operations = [
migrations.RenameModel(
old_name='Facilitator',
... | p2pu/learning-circles | studygroups/migrations/0084_auto_20180215_0747.py | Python | mit | 366 | 0 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-08 22:45
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('topics', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
... | GeorgiaTechDHLab/TOME | topics/migrations/0002_auto_20170308_2245.py | Python | bsd-3-clause | 537 | 0 |
import arcas
import pandas
def test_setup():
api = arcas.Springer()
assert api.standard == 'http://api.springer.com/metadata/pam?q='
def test_keys():
api = arcas.Springer()
assert api.keys() == ['url', 'key', 'unique_key', 'title', 'author', 'abstract',
'doi', 'date', 'journa... | ArcasProject/Arcas | tests/test_springer.py | Python | mit | 3,670 | 0.007084 |
import numpy as np
import pytest
from pandas.errors import NullFrequencyError
import pandas as pd
from pandas import (
DatetimeIndex,
Index,
NaT,
Series,
TimedeltaIndex,
date_range,
offsets,
)
import pandas._testing as tm
from pandas.tseries.offsets import BDay
class TestShift:
@pyt... | jreback/pandas | pandas/tests/series/methods/test_shift.py | Python | bsd-3-clause | 13,266 | 0.00098 |
"""Common base class for Redis-based distributed worker systems.
This software is released under an MIT/X11 open source license.
Copyright 2012-2014 Diffeo, Inc.
"""
from __future__ import absolute_import
import logging
import socket
import redis
from rejester.exceptions import ProgrammerError
logger = logging.g... | diffeo/rejester | rejester/_redis.py | Python | mit | 2,666 | 0.0015 |
import platform
from copy import *
from ctypes import *
class Param(Structure): #Forward declaration
pass
class Value(Structure):
pass
class StringValue(Structure):
pass
class BoolValue(Structure):
pass
class NumberValue(Structure):
pass
class ListValue(Structure):
pass
PARAM_P = POINTER(Param)
VALUE_P = P... | zaibacu/zTemplate | lib/zTemplate.py | Python | mit | 2,885 | 0.038475 |
import unittest
import traveler
class MainTest(unittest.TestCase):
def test_base(self):
self.assertTrue(True)
def setUp(self):
self.poller = traveler.Poller()
def test_poller(self):
j = self.poller.load()
self.assertTrue(isinstance(j, str))
if __name__ == '__main__':
... | MrTrustworthy/traveler | tests/test_poller.py | Python | mit | 340 | 0.002941 |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2012-6 Met Office.
#
# This file is part of Rose, a framework for meteorological suites.
#
# Rose is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... | kaday/rose | lib/python/rose/macros/trigger.py | Python | gpl-3.0 | 24,332 | 0 |
import io
import os
import requests
import shutil
import sys
import zipfile
from waxe_image import __version__
API_RELEASES_URL = 'https://api.github.com/repos/waxe/waxe-image/releases'
NG_BUILD_FOLDER = 'website'
def main(argv=sys.argv):
if len(argv) > 2:
print('Too many arguments')
sys.exit(1... | waxe/waxe-image | waxe_image/scripts/get_ng_build.py | Python | mit | 1,483 | 0 |
import gitlab
from .. import mock, wrapped_config_get
gitlab.Gitlab("") # instantiation necessary to discover gitlab ProjectManager
class _GitlabProject:
def __init__(self, status):
self.commits = {"my_ref": self._Commit(status)}
self.tags = self._Tags()
self.releases = self._Releases()... | relekang/python-semantic-release | tests/mocks/mock_gitlab.py | Python | mit | 4,092 | 0.000489 |
# -*- coding: utf-8 -*-
def classeq(x, y):
return x.__class__==y.__class__
class Element(object): pass
| chaosim/dao | dao/base.py | Python | gpl-3.0 | 113 | 0.035398 |
N, M = map(int,input().split()) # More than 6 lines of code will result in 0 score. Blank lines are not counted.
for i in range(1, N, 2):
print(('.|.' * i).center(M, '-')) # Enter Code Here
print('WELCOME'.center(M, '-')) # Enter Code Here
for i in range(N-2, -1, -2):
print(('.|.' * i).center(M, '-')) # Ent... | avtomato/HackerRank | Python/_03_Strings/_09_Designer_Door_Mat/solution.py | Python | mit | 333 | 0.006006 |
from django import template
from django.template import TOKEN_VAR, TOKEN_BLOCK, TOKEN_COMMENT, TOKEN_TEXT, \
BLOCK_TAG_START, VARIABLE_TAG_START, VARIABLE_TAG_END, BLOCK_TAG_END
register = template.Library()
class RawNode(template.Node):
def __init__(self, data):
self.data = data
def render(self,... | redsolution/redsolution-cms | redsolutioncms/templatetags/redsolutioncms_tags.py | Python | gpl-3.0 | 1,289 | 0.006206 |
import datetime
import os
import json
import re
import psycopg2 as dbapi2
from flask import Flask
from flask import redirect
from flask import request
from flask import render_template
from flask.helpers import url_for
from store import Store
from fixture import *
from sponsors import *
from curlers import *
from cl... | itucsdb1509/itucsdb1509 | clubs.py | Python | gpl-3.0 | 8,354 | 0.003953 |
# coding=utf-8
# Copyright 2022 The Trax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | google/trax | trax/shapes_test.py | Python | apache-2.0 | 2,632 | 0.00304 |
import functools
import itertools
import types
import unittest
import six
from chainer.testing import _bundle
from chainer import utils
def _param_to_str(obj):
if isinstance(obj, type):
return obj.__name__
return repr(obj)
def _shorten(s, maxlen):
# Shortens the string down to maxlen, by repla... | okuta/chainer | chainer/testing/parameterized.py | Python | mit | 4,970 | 0.000201 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.