text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel... | stvstnfrd/edx-platform | openedx/core/djangoapps/video_pipeline/migrations/0001_initial.py | Python | agpl-3.0 | 1,352 | 0.005178 |
# This file is part of VoltDB.
# Copyright (C) 2008-2014 VoltDB Inc.
#
# This file contains original code and/or modifications of original code.
# Any modifications made by VoltDB Inc. are licensed under the following
# terms and conditions:
#
# Permission is hereby granted, free of charge, to any person obtaining
# a... | zheguang/voltdb | lib/python/voltcli/cli.py | Python | agpl-3.0 | 28,839 | 0.008808 |
# -*- 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 model 'LikeCfiItem'
db.create_table(u'catalog_likecfiitem', (
... | Makeystreet/makeystreet | woot/apps/catalog/migrations/0036_auto__add_likecfiitem__add_cfistoreitem.py | Python | apache-2.0 | 27,149 | 0.007219 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ts=4:sw=4:expandtab:
# Copyright 2008 Mark Mitchell
# License: see __license__ below.
__doc__ = """
Reads a GraphicsMagick source file and parses the specially formatted
comment blocks which precede each function and writes the information
obtained from the commen... | kazuyaujihara/osra_vs | GraphicsMagick/scripts/format_c_api_doc.py | Python | gpl-2.0 | 21,967 | 0.005281 |
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
import copy
from rapidsms.connection import Connection
from rapidsms.person import Person
from datetime import datetime
from rapidsms import utils
class StatusCodes:
'''Enum for representing status types of a message or response.'''
NONE = "N... | icomms/rapidsms | lib/rapidsms/message.py | Python | lgpl-3.0 | 4,140 | 0.008454 |
from pathlib import Path
from jobman.jobman import JobMan
from mc.clients.job_record_client import JobRecordClient
from mc.clients.flow_record_client import FlowRecordClient
from mc.flows.flow_engine import FlowEngine
from mc.db.db import Db
from mc.runners.flow_runner import FlowRunner
from mc.runners.jobman_job_run... | aspuru-guzik-group/mission_control | mc/houston/utils.py | Python | apache-2.0 | 6,799 | 0.000147 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... | cvandeplas/plaso | plaso/parsers/winprefetch_test.py | Python | apache-2.0 | 17,693 | 0.000396 |
from data import *
# white
pvals = {
PAWN: 100,\
BISHOP: 300,\
KNIGHT: 300,\
ROOK: 500,\
QUEEN: 900,\
-PAWN: -100,\
-BISHOP: -300,\
-KNIGHT: -300,\
-ROOK: -500,\
-QUEEN: -900,\
KING: 10000,\
-KING: -10000,\
EMPTY: 0,\
}
def value(state):
return state.som * su... | edrex/minichess | minichess/eval.py | Python | gpl-2.0 | 605 | 0.028099 |
#
# Copyright 2018 Analytics Zoo 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 agreed to... | intel-analytics/analytics-zoo | pyzoo/zoo/pipeline/api/keras/models.py | Python | apache-2.0 | 3,962 | 0.000757 |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | brain-research/acai | lib/layers.py | Python | apache-2.0 | 3,324 | 0 |
#! /usr/bin/env python
import os
from function import function
import speech_recognition as sr
from server import EmailServer
from pygame import mixer
from subprocess import call
from send import SendEmail
from detect import face_rec
from face import face_detect
from trainer import face_train
mixer.init(... | yahya-idriss/Python-Personal-assistant | start.py | Python | mit | 4,231 | 0.038762 |
from django.contrib import admin
from image_cropping import ImageCroppingMixin
from imageboard.models import Image
class ImageAdmin(ImageCroppingMixin, admin.ModelAdmin):
list_display = ['__str__', 'tag_list', 'owner', 'created', 'updated', 'visible', 'get_image_url']
list_filter = ['owner', 'visible', 'creat... | andrewnsk/dorokhin.moscow | imageboard/admin.py | Python | mit | 990 | 0.004082 |
#!/usr/bin/python
# Google Spreadsheet BMP Sensor Data-logging Example
# Depends on the 'gspread' package being installed. If you have pip installed
# execute:
# sudo pip install gspread
# Copyright (c) 2014 Adafruit Industries
# Author: Tony DiCola
# Permission is hereby granted, free of charge, to any person o... | dpcrook/timetemp | install/Archive/logging_sparkfun.py | Python | mit | 5,870 | 0.005281 |
from tweepy import Stream
from tweepy import OAuthHandler
from tweepy.streaming import StreamListener
import sqlite3 as sql3
import time
import json
import time
from datetime import datetime
import os
#import sys
#consumer key, consumer secret, access token, access secret.
ckey= 'TWITTER_CKEY' in os.environ
csecret= '... | ssmdevelopers/jklhoods | streamtweet.py | Python | gpl-2.0 | 1,889 | 0.022763 |
from __future__ import (absolute_import, division, print_function)
import filecmp
import numpy as np
import os
import stresstesting
import tempfile
import mantid.simpleapi as mantid
import mantid.kernel as kernel
from tube_calib_fit_params import TubeCalibFitParams
from tube_calib import getCalibratedPixelPositions, ... | wdzhou/mantid | Testing/SystemTests/tests/analysis/WishCalibrate.py | Python | gpl-3.0 | 8,447 | 0.003315 |
from SuperDiffer import app, db
from SuperDiffer.id import controllers as ID
from flask import Flask, render_template, request, abort, jsonify
import json,base64,pdb
"""Routes to allow clients to add left and right base64 encoded on JSON values and fetch their diff"""
#References: https://blog.miguelgrinberg.com/post... | gpaOliveira/SuperDiffer | SuperDiffer/routes.py | Python | mit | 2,533 | 0.013423 |
#!/usr/bin/env python
# vim: sts=4 sw=4 et
# This is a component of EMC
# probe.py Copyright 2010 Michael Haberler
#
#
# 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 versi... | araisrobo/linuxcnc | configs/gladevcp/probe/probe.py | Python | lgpl-2.1 | 7,589 | 0.011859 |
#!/usr/bin/env python
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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 ... | jmvrbanac/barbican | bin/barbican-keystone-listener.py | Python | apache-2.0 | 2,403 | 0.002913 |
import requests
from allauth.socialaccount.providers.oauth2.views import (
OAuth2Adapter,
OAuth2CallbackView,
OAuth2LoginView,
)
from .provider import FakeProvider
class FakeOAuth2Adapter(OAuth2Adapter):
provider_id = FakeProvider.id
access_token_url = 'https://localhost/o/oauth2/token'
auth... | AltSchool/django-allauth | allauth/socialaccount/providers/fake/views.py | Python | mit | 910 | 0 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2017-04-06
@author: Heysion Yuan
@copyright: 2017, Heysion Yuan <heysions@gmail.com>
@license: GPLv3
'''
from dab.webui import WebBase
from dab.core.db.models import Task
class TaskIndex(WebBase):
def get(self):
dataset = self.get_task_top_all()
... | heysion/deepin-auto-build | dab/webui/taskctrl.py | Python | gpl-3.0 | 2,297 | 0.01219 |
"""
:mod: DataIntegrityHandler
.. module: DataIntegrityHandler
:synopsis: DataIntegrityHandler is the implementation of the Data Integrity service in
the DISET framework
"""
# from DIRAC
from DIRAC import S_OK
from DIRAC.Core.DISET.RequestHandler import RequestHandler
from DIRAC.DataManagementSystem.DB.DataInte... | DIRACGrid/DIRAC | src/DIRAC/DataManagementSystem/Service/DataIntegrityHandler.py | Python | gpl-3.0 | 6,511 | 0.004147 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 Cubic ERP SAC (<http://cubicerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | jolevq/odoopub | extra-addons/customize/res_company.py | Python | agpl-3.0 | 1,213 | 0.003298 |
XXXXXXXXX XXXXX
XXXXXX
XXXXXX
XXXXX XXXXXXXXXXXXXXXX
XXXXX XXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX XXXXXXX X XXXXXXXXXX XXXXXX XXXXXXXXXXXXXXXX
XXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX ... | dnaextrim/django_adminlte_x | adminlte/static/plugins/datatables/extensions/ColReorder/examples/predefined.html.py | Python | mit | 16,794 | 0.037752 |
import numpy as np
import pdb
from scipy import linalg as splinalg
# A = np.array([
# [1, 1, -2, 1, 3, -1],
# [2, -1, 1, 2, 1, -3],
# [1, 3, -3, -1, 2, 1],
# [5, 2, -1, -1, 2, 1],
# [-3, -1, 2, 3, 1, 3],
# [4, 3, 1, -6, -3, -2]
# ], dtype=float)
# b = np.array([4, 20, -15, -3, 16, -27], dtype=fl... | Seek/LaTechNumeric | linearalg/linalg.py | Python | mit | 8,666 | 0.006577 |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django import forms
... | suutari-ai/shoop | shuup/admin/modules/users/views/permissions.py | Python | agpl-3.0 | 5,257 | 0.001332 |
import socket
import random
import time
# A blocking server that simply sends hello to anyone who conncets to it
def blocking_server(bind='0.0.0.0', port=8080, queued_connections=5):
"""
This sets up a blocking socket. We will be listening for incomming
conncetions
"""
sock = socket.socket(socket... | mr-uuid/snippets | python/sockets/servers/blocking.py | Python | mit | 1,330 | 0.001504 |
#!/usr/bin/env python3
'''Test for DDNS forwarding'''
from dnstest.test import Test
t = Test()
master = t.server("knot")
slave = t.server("knot")
zone = t.zone("example.com.")
t.link(zone, master, slave, ddns=True)
t.start()
master.zones_wait(zone)
seri = slave.zones_wait(zone)
# OK
update = slave.update(zone)
... | CZ-NIC/knot | tests-extra/tests/ddns/forward/test.py | Python | gpl-3.0 | 777 | 0 |
# Main network and testnet3 definitions
params = {
'bitcoin_main': {
'pubkey_address': 50,
'script_address': 9,
'genesis_hash': '00000c7c73d8ce604178dae13f0fc6ec0be3275614366d44b1b4b5c6e238c60c'
},
'bitcoin_test': {
'pubkey_address': 88,
'script_address': 188,
... | mazaclub/tate-server | src/networks.py | Python | agpl-3.0 | 413 | 0.004843 |
'''
'''
__version__ = '0.1-dev'
device_config_name = 'Devices'
exp_config_name = 'experiment'
| matham/sniffer | sniffer/__init__.py | Python | mit | 97 | 0 |
# Valid-IP-checker-
#This program check whether a given IP is valid or not IPV4
def ip_checkv4(ip):
parts=ip.split(".")
if len(parts)<4 or len(parts)>4:
return "invalid IP length should be 4 not greater or less than 4"
else:
while len(parts)== 4:
a=int(parts[0])
b=int(parts[1])
c=int(parts[2])
d=int(... | 0101a/Valid-IP-checker- | Ipv4.py | Python | gpl-2.0 | 918 | 0.051198 |
"""
Helper functions for creating Form classes from Django models
and database field objects.
"""
from __future__ import unicode_literals
from collections import OrderedDict
from itertools import chain
from django.core.exceptions import (
NON_FIELD_ERRORS, FieldError, ImproperlyConfigured, ValidationError,
)
fro... | rsvip/Django | django/forms/models.py | Python | bsd-3-clause | 55,046 | 0.001508 |
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 03 13:06:56 2015
@author: Eunice
"""
if __name__ == '__main__':
import sys
sys.path.append("..")
from engine import bar
# 以上模块仅测试用
from engine.broker.fillstrategy import DefaultStrategy
from engine.broker.backtesting import TradePercentage
from engine import ... | Yam-cn/potato | stratlib/thrSMA.py | Python | apache-2.0 | 5,091 | 0.004953 |
from captcha.conf import settings
from captcha.helpers import captcha_image_url
from captcha.models import CaptchaStore
from django.http import HttpResponse, Http404
from django.shortcuts import get_object_or_404
import random
import re
import tempfile
import os
import subprocess
try:
from cStringIO import StringI... | viaregio/django-simple-captcha | captcha/views.py | Python | mit | 4,373 | 0.002058 |
""" This module contains data dump creation and import functions.
Read more about the data dumps in our documentation here:
https://listenbrainz.readthedocs.io/en/production/dev/listenbrainz-dumps.html
"""
# listenbrainz-server - Server for the ListenBrainz project
#
# Copyright (C) 2017 MetaBrainz Foundation Inc.
#
... | Freso/listenbrainz-server | listenbrainz/db/dump.py | Python | gpl-2.0 | 24,816 | 0.001531 |
import asyncio
import logging
import uuid
from collections import defaultdict
from dask.utils import parse_timedelta, stringify
from .client import Client, Future
from .worker import get_client, get_worker
logger = logging.getLogger(__name__)
class QueueExtension:
"""An extension for the scheduler to manage qu... | dask/distributed | distributed/queues.py | Python | bsd-3-clause | 9,788 | 0.001124 |
#! /usr/bin/env python
# This will run as a production ready server if something like eventlet is installed
import argparse
import json
import os
import threading
import time
import sys
from gevent import ssl
from geventwebsocket import WebSocketServer, WebSocketApplication, Resource
from readscale import set_scale... | sparkfun/usb-scale | scaleServer.py | Python | gpl-3.0 | 3,755 | 0.001065 |
from twisted.internet.defer import inlineCallbacks, fail, succeed
from globaleaks import models
from globaleaks.orm import transact
from globaleaks.tests import helpers
from globaleaks.jobs.delivery_sched import DeliverySchedule
from globaleaks.jobs.notification_sched import NotificationSchedule, MailGenerator
cla... | vodkina/GlobaLeaks | backend/globaleaks/tests/jobs/test_notification_sched.py | Python | agpl-3.0 | 1,811 | 0.000552 |
#
# Copyright 2014 Red Hat, Inc
#
# Author: Chris Dent <chdent@redhat.com>
#
# 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 requi... | ChinaMassClouds/copenstack-server | openstack/src/ceilometer-2014.2.2/ceilometer/tests/ipmi/notifications/ipmi_test_data.py | Python | gpl-2.0 | 30,224 | 0 |
# -*- coding: utf-8 -*-
import os
import re
from django.conf import settings
from django.core import validators
from django.core.exceptions import ValidationError
from django.forms.util import ErrorList
from django.forms.fields import MultiValueField, FilePathField, \
FileField, CharField
from django.utils.transl... | danieljb/django-hybrid-filefield | hybrid_filefield/forms.py | Python | gpl-3.0 | 3,393 | 0.001768 |
from .position import position
class position_nudge(position):
"""
Nudge points
Useful to nudge labels away from the points
being labels.
Parameters
----------
x : float
Horizontal nudge
y : float
Vertical nudge
"""
def __init__(self, x=0, y=0):
self.p... | has2k1/plotnine | plotnine/positions/position_nudge.py | Python | gpl-2.0 | 698 | 0 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'ThreadToGroup.visibility'
db.add_column('askbot_thread_groups', 'visibility',
... | PearsonIOKI/compose-forum | askbot/migrations/0146_auto__add_field_threadtogroup_visibility.py | Python | gpl-3.0 | 33,877 | 0.00797 |
"""
Copyright (C) 2011-2012 Brandon L. Reiss
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish... | blr246/traffic | phone_display_demo.py | Python | mit | 16,853 | 0.002492 |
from ..remote import RemoteModel
class NetworkNetworkExplorerSummariesSummaryGridRemote(RemoteModel):
"""
| ``id:`` none
| ``attribute type:`` string
| ``DeviceID:`` none
| ``attribute type:`` string
| ``DeviceIPNumeric:`` none
| ``attribute type:`` string
| ``DeviceIPDott... | infobloxopen/infoblox-netmri | infoblox_netmri/api/remote/models/network_network_explorer_summaries_summary_grid_remote.py | Python | apache-2.0 | 1,486 | 0 |
from setuptools import setup
# Really only required so setup.cfg can pick up __version__
setup(
name="bruges",
) | agile-geoscience/bruges | setup.py | Python | apache-2.0 | 117 | 0.008547 |
#-*- coding: utf-8 -*-
"""OAuth 2.0 Token Generation"""
from base64 import b64encode
from django.http import HttpResponse
from django.contrib.auth import authenticate
from django.views.decorators.csrf import csrf_exempt
try: import simplejson as json
except ImportError: import json
from .exceptions import OAuth2Exc... | MaplePlan/djwp | oauth2app/token.py | Python | lgpl-3.0 | 16,845 | 0.00089 |
# Copyright 2016 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... | ghchinoy/tensorflow | tensorflow/contrib/distributions/python/ops/bijectors/softplus.py | Python | apache-2.0 | 5,563 | 0.003775 |
# snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.]
# snippet-sourcedescription:[Lambda rotation for AWS Secrets Manager - RDS PostgreSQL with separate Master secret]
# snippet-service:[secretsmanager]
# snippet-keyword:[rotation function]
# snippet-keyword:[python]
# snippet-k... | awsdocs/aws-doc-sdk-examples | lambda_functions/secretsmanager/RDSPostgreSQL-Multiuser.py | Python | apache-2.0 | 16,740 | 0.004421 |
#!/usr/bin/env python
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtXml import *
import sys, os
from ui_cheatsheet import Ui_CSDialog
class CSWindow ( QDialog , Ui_CSDialog):
settings = QSettings('Mte90','LearnHotkeys')
settings.setFallbacksEnabled(False)
theme_path = "./style"
the... | Mte90/LearnHotkeys | cheatsheet.py | Python | gpl-3.0 | 5,629 | 0.007817 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of the Shiboken Python Bindings Generator project.
#
# Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
#
# Contact: PySide team <contact@pyside.org>
#
# This program is free software; you can redistribute it and/or
# modify it under t... | codewarrior0/Shiboken | tests/samplebinding/virtualmethods_test.py | Python | gpl-2.0 | 5,040 | 0.002381 |
# coding=utf-8
# Copyright 2022 The Tensor2Tensor 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... | tensorflow/tensor2tensor | tensor2tensor/data_generators/image_utils.py | Python | apache-2.0 | 14,495 | 0.007934 |
# coding: utf-8
# DJANGO IMPORTS
from django.template.loader import render_to_string
from django.forms.widgets import FileInput as DjangoFileInput
from django.forms.widgets import ClearableFileInput as DjangoClearableFileInput
from django.forms.widgets import CheckboxInput
from django.forms.fields import FilePathField... | yaroslavprogrammer/django-filebrowser-no-grappelli | filebrowser/widgets.py | Python | bsd-3-clause | 3,673 | 0.004901 |
#!/usr/bin/env python2.7
import datetime
import monthdelta
def parse_date(date_str):
return datetime.datetime.strptime(date_str, "%Y-%m-%d")
def unparse_date(date_obj):
return date_obj.strftime("%Y-%m-%d")
class Company(object):
def __init__(self, name):
self.name = name
self.flows = []
... | gkotian/zulip | tools/deprecated/finbot/money.py | Python | apache-2.0 | 7,737 | 0.003231 |
# Copyright (C) 2009 Jeremy S. Sanders
# Email: Jeremy Sanders <jeremy@jeremysanders.net>
#
# 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
# ... | veusz/veusz | veusz/document/emf_export.py | Python | gpl-2.0 | 14,778 | 0.002977 |
"""
Classes for querying the information in a test coverage report.
"""
from __future__ import unicode_literals
from abc import ABCMeta, abstractmethod
from collections import namedtuple, defaultdict
import re
import subprocess
import sys
import six
from diff_cover.git_path import GitPathTool
Violation = namedtuple('... | hugovk/diff-cover | diff_cover/violations_reporter.py | Python | agpl-3.0 | 15,153 | 0.000396 |
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
... | yeyanchao/calibre | src/calibre/devices/mtp/defaults.py | Python | gpl-3.0 | 1,628 | 0.006143 |
from electrum.i18n import _
fullname = 'Joinmarket coinjoins'
description = _(" ".join(["Ability to send payments as coinjoins with counterparties.",
"Paying minimal fees, you can immediately send your coins",
"with much better privacy. See https://github.com/joinmar... | AdamISZ/electrum-joinmarket-plugin | joinmarket/__init__.py | Python | gpl-3.0 | 721 | 0.011096 |
# Copyright 2014, 2015 SAP SE
#
# 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,... | ralhei/PyHDB | pyhdb/auth.py | Python | apache-2.0 | 3,055 | 0 |
# Copyright 2015 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... | dims/glance | glance/async/flows/convert.py | Python | apache-2.0 | 3,951 | 0 |
order = ['','K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y']
class Sizes(object):
_BASE = 1000.
def toSize(self, value, input='', output='K'):
"""
Convert value in other measurement
"""
input = order.index(input)
output = order.index(output)
factor = input - output
... | Jumpscale/jumpscale6_core | lib/JumpScale/baselib/units/units.py | Python | bsd-2-clause | 787 | 0.005083 |
import os
import json
import datetime
from django.http import HttpResponse
from django.views.generic import TemplateView
from django.utils.safestring import mark_safe
from django.utils import timezone
from django.template.loader import render_to_string
from person.models import Person
from document.models import Doss... | openkamer/openkamer | website/views.py | Python | mit | 7,095 | 0.001409 |
# gunicorn configuration
bind = '0.0.0.0:8000'
workers = 3
# These log settings assume that gunicorn log config will be included in the django base.py logging configuration
accesslog = '-'
errorlog = '-'
access_log_format = '{"request": "%(r)s", "http_status_code": "%(s)s", "http_request_url": "%(U)s", "http_query_st... | penzance/hdt_monitor | hdt_monitor/settings/gunicorn_config.py | Python | mit | 530 | 0.003774 |
import spidev
import time
import random
# All set commands set the state only, and so require a write command to be displayed.
class LPD6803_Chain(object):
def __init__(self, ics_in_chain=25, spi_address_hardware=0, spi_address_output=0):
# default to 25 ics in the chain, so it works with no params with the... | rasathus/pigredients | pigredients/ics/lpd6803.py | Python | mit | 7,299 | 0.01932 |
# Copyright 2010, 2011, 2013 (C) Adam Greig
#
# This file is part of habitat.
#
# habitat 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... | ukhas/habitat | habitat/tests/test_parser_modules/test_ukhas_parser.py | Python | gpl-3.0 | 18,589 | 0.000592 |
from __future__ import division
from operator import add, mul
import cProfile
def memo(f):
cache = {}
def _f(*args):
try:
return cache[args]
except KeyError:
result = cache[args] = f(*args)
return result
except TypeError:
return f(*args)
... | m00nlight/hackerrank | algorithm/Number-Theory/nCr/main.py | Python | gpl-2.0 | 7,426 | 0.005252 |
#
# Copyright 2015 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/licenses/LICENSE-2.0
#
# Unless require... | cwolferh/heat-scratch | heat/engine/resources/openstack/neutron/lbaas/listener.py | Python | apache-2.0 | 7,961 | 0 |
# Copyright 2016, Cossack Labs Limited
#
# 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 wri... | cossacklabs/acra | tests/test.py | Python | apache-2.0 | 375,193 | 0.003038 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of GNUWiNetwork,
# Copyright (C) 2014 by
# Pablo Belzarena, Gabriel Gomez Sena, Victor Gonzalez Barbone,
# Facultad de Ingenieria, Universidad de la Republica, Uruguay.
#
# GNUWiNetwork is free software: you can redistribute it ... | vagonbar/GNUnetwork | gwn/blocks/libio/gnuradio/new/gwnChannelqpsk.py | Python | gpl-3.0 | 4,398 | 0.007731 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 OpenStack LLC.
# 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/... | admiyo/keystone | keystone/routers/admin.py | Python | apache-2.0 | 6,755 | 0.009326 |
# Copyright 2016 Mycroft AI, Inc.
#
# This file is part of Mycroft Core.
#
# Mycroft Core 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... | ethanaward/mycroft-core | mycroft/skills/naptime/__init__.py | Python | gpl-3.0 | 1,477 | 0 |
# Copyright 2018 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... | alexgorban/models | research/object_detection/models/ssd_mobilenet_v1_fpn_feature_extractor_test.py | Python | apache-2.0 | 9,782 | 0.002249 |
from constraint_solver import pywrapcp
def main():
solver = pywrapcp.Solver("time limit test")
n = 10
x = [solver.IntVar(1, n, "x[%i]" % i) for i in range(n)]
solver.Add(solver.AllDifferent(x, True))
solution = solver.Assignment()
solution.Add(x)
db = solver.Phase(x,
solver.CHOOSE_... | capturePointer/or-tools | examples/tests/issue4.py | Python | apache-2.0 | 1,031 | 0.022308 |
#!/usr/bin/python
# Copyright (c) 2015 IBM
# 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | mheap/ansible | lib/ansible/modules/cloud/openstack/os_flavor_facts.py | Python | gpl-3.0 | 6,809 | 0.000587 |
# Copyright 2014 CloudFounders NV
#
# 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 writ... | mflu/openvstorage_centos | openstack/tests/__init__.py | Python | apache-2.0 | 694 | 0 |
import os
import gettext as gettext_module
from django import http
from django.conf import settings
from django.utils import importlib
from django.utils.translation import check_for_language, activate, to_locale, get_language
from django.utils.text import javascript_quote
from django.utils.encoding import smart_unicod... | vsajip/django | django/views/i18n.py | Python | bsd-3-clause | 9,782 | 0.002556 |
__author__ = 'leif'
from django.contrib import admin
from models import *
admin.site.register(GameExperiment)
admin.site.register(UserProfile)
admin.site.register(MaxHighScore)
| leifos/boxes | treasure-houses/asg/admin.py | Python | mit | 178 | 0 |
"""Test."""
import pytest
TM_TABLE = [
([0, 1, 1, 0, 1], True),
([0], True),
([1], False),
([0, 1, 0, 0], False),
]
@pytest.mark.parametrize("n, result", TM_TABLE)
def test_is_thue_morse(n, result):
"""Test."""
from is_thue_morse import is_thue_morse
assert is_thue_morse(n) == result
| rrustia/code-katas | src/test_is_thue_morse.py | Python | mit | 318 | 0 |
import getpass
from distutils import log
from distutils.command import upload as orig
class upload(orig.upload):
"""
Override default upload behavior to obtain password
in a variety of different ways.
"""
def run(self):
try:
orig.upload.run(self)
finally:
s... | astaninger/speakout | venv/lib/python3.6/site-packages/setuptools/command/upload.py | Python | mit | 1,493 | 0 |
# -*- encoding: utf-8 -*-
#
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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
#
# ... | varunarya10/ironic | ironic/drivers/fake.py | Python | apache-2.0 | 2,806 | 0 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Weapon()
result.template = "object/weapon/ranged/vehicle/shared_vehicle_atst_ranged.iff"
result.attribute_templat... | anhstudios/swganh | data/scripts/templates/object/weapon/ranged/vehicle/shared_vehicle_atst_ranged.py | Python | mit | 454 | 0.048458 |
# Copyright 2017 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 or agreed to in writing, s... | felixbb/forseti-security | google/cloud/security/common/data_access/violation_dao.py | Python | apache-2.0 | 3,393 | 0 |
'''
Copyright 2017 Dell Inc. or its subsidiaries. All Rights Reserved.
Author(s):
Norton Luo
This test validate the AMQP message send out in the workflow, and node delete and discover.
It also validate the web hook api and node registeration function.
Ths test will choose a node and reset it. After the system... | RackHD/RackHD | test/tests/amqp/test_amqp_node_rediscover.py | Python | apache-2.0 | 18,627 | 0.003382 |
#!/usr/bin/env python
from __future__ import print_function
from collections import Counter
from operator import itemgetter
import os
_path = os.path.abspath(os.path.dirname(__file__))
SOURCE = os.path.join(_path, 'poems_for_wordcount.txt')
DESTINATION = os.path.join(_path, 'poem_words_out.txt')
def sort_word_cou... | clarkkarenl/brautbot | wordcount.py | Python | artistic-2.0 | 1,390 | 0 |
__author__ = 'Nick Apperley'
# -*- coding: utf-8 -*-
#
# Establishes an OpenVPN connection using an OVPN file. Based on a Hacking Lab Python script
# (http://media.hacking-lab.com/largefiles/livecd/z_openvpn_config/backtrack/vpn-with-python.py). Requires Python 3
# and the pexpect library (module).
import pexpect
fro... | napperley/OpenVPN_Tunneler | openvpn.py | Python | apache-2.0 | 1,290 | 0.003101 |
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
from builtins import str
import json, requests
import os, errno
import urllib.request, urllib.parse, urllib.error
def mkdir_p(path):
try:
os.makedirs(path)
except OSError as exc: # Python >2.5
... | chrisfilo/NeuroVault | scripts/prepare_sdr_package.py | Python | mit | 1,853 | 0.013492 |
# Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | esikachev/scenario | sahara/tests/tempest/scenario/data_processing/client_tests/test_jobs.py | Python | apache-2.0 | 2,479 | 0 |
#!/usr/bin/env python3
# Copyright 2021 Anapaya Systems
#
# 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... | netsec-ethz/scion | acceptance/cert_renewal/test.py | Python | apache-2.0 | 9,210 | 0.000326 |
from beerlog import app
app.run(debug=True)
| toddself/beerlog2 | runserver.py | Python | apache-2.0 | 44 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""A twisted UDP interface that is similar to the built-in socket interface."""
import traceback
from twisted.internet import reactor
from twisted.internet.protocol import DatagramProtocol
class UDPSocket(DatagramProtocol):
def __init__(self, host, port):
se... | hiidef/pylogd | pylogd/twisted/socket.py | Python | mit | 1,335 | 0.001498 |
# Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... | cjaymes/pyscap | src/scap/model/oval_5/var/OvalVariablesElement.py | Python | gpl-3.0 | 1,169 | 0.004277 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-07-27 13:08
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('comments', '0003_auto_20170726_1348'),
]
operations... | goyal-sidd/BLT | comments/migrations/0004_auto_20170727_1308.py | Python | agpl-3.0 | 598 | 0.001672 |
"""
fixtures and setup for testing the sim_setup subpackage
"""
import pytest
@pytest.fixture(scope='function') # the created directories should be unique
def molecule(path_test_data, tmp_path):
from paratemp import cd
from paratemp.sim_setup import Molecule
path_gro = path_test_data / 'water.mol2'
... | theavey/ParaTemp | tests/test_sim_setup/conftest.py | Python | apache-2.0 | 584 | 0 |
# -*- encoding: utf-8 -*-
# Copyright (C) 2015 Alejandro López Espinosa (kudrom)
import datetime
import random
class Date(object):
"""
Descriptor for a date datum
"""
def __init__(self, variance, **kwargs):
"""
@param variance is the maximum variance of time
... | kudrom/lupulo | lupulo/descriptors/date.py | Python | gpl-2.0 | 883 | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the timemachine plist plugin."""
import unittest
from plaso.parsers.plist_plugins import timemachine
from tests.parsers.plist_plugins import test_lib
class TimeMachinePluginTest(test_lib.PlistPluginTestCase):
"""Tests for the timemachine plist plugin.""... | Onager/plaso | tests/parsers/plist_plugins/timemachine.py | Python | apache-2.0 | 1,644 | 0.001825 |
# from . import test_partner_import
from . import test_product_import
| iw3hxn/LibrERP | data_migration/tests/__init__.py | Python | agpl-3.0 | 70 | 0 |
"""simpleneed URL Configuration.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Clas... | b3j0f/simpleneed | www/simpleneed/urls.py | Python | mit | 1,471 | 0 |
from django.utils.datastructures import SortedDict
from bencode import bencode, bdecode
def sort_dict(D):
result = SortedDict()
for key in sorted(D.keys()):
if type(D[key]) is dict:
D[key] = sort_dict(D[key])
result[key] = D[key]
return result | abshkd/benzene | torrents/utils/__init__.py | Python | bsd-3-clause | 254 | 0.031496 |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:4496")
else:
access = Ser... | TimMaylon/corecoin | contrib/bitrpc/bitrpc.py | Python | mit | 7,838 | 0.038147 |
from __future__ import unicode_literals
from django.http import Http404
class Resolver404(Http404):
pass
class NoReverseMatch(Exception):
pass
| yephper/django | django/urls/exceptions.py | Python | bsd-3-clause | 167 | 0 |
"""
.. module: lemur.decorators
:copyright: (c) 2015 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
"""
from builtins import str
from datetime import timedelta
from flask import make_response, request, current_app
from functools import update_wrapper
# this is only use... | shaunstanislaus/lemur | lemur/decorators.py | Python | apache-2.0 | 1,945 | 0.000514 |
from models import Event, EventRole
from common.adminForms import CommonAdminForm
class EventAdminForm(CommonAdminForm):
class Meta(CommonAdminForm.Meta):
model = Event
class EventRoleAdminForm(CommonAdminForm):
class Meta(CommonAdminForm.Meta):
model = EventRole
| alfred82santa/tarrabme2 | src/events/adminForms.py | Python | gpl-3.0 | 298 | 0.010067 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.