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 |
|---|---|---|---|---|---|
# coding: utf-8
#
# Copyright 2010-2014 Ning, Inc.
# Copyright 2014-2020 Groupon, Inc
# Copyright 2020-2021 Equinix, Inc
# Copyright 2014-2021 The Billing Project, LLC
#
# The Billing Project, LLC licenses this file to you under the Apache License, version 2.0
# (the "License"); you may not use this file except in com... | killbill/killbill-client-python | killbill/models/tenant_key_value.py | Python | apache-2.0 | 4,248 |
import random
from settings import *
from mongoengine import *
from faker import Faker
from models import UserModel, StoryModel
connect('timehighway', host=MONGO_HOST, port=MONGO_PORT,
username=MONGO_USERNAME, password=MONGO_PASSWORD)
fake = Faker()
USER_NUMBERS = 100
STORY_NUMBERS = 1000
STORIES = [
StoryM... | meahmadi/time-highway | time-highway/api/test_data.py | Python | gpl-2.0 | 963 |
from __future__ import division
from collections import OrderedDict
import numpy as np
from mbuild import Box
from mbuild.utils.conversion import RB_to_OPLS
from mbuild.utils.sorting import natural_sort
__all__ = ['write_lammpsdata']
def write_lammpsdata(structure, filename):
"""Output a LAMMPS data file.
... | ctk3b/mbuild | mbuild/formats/lammpsdata.py | Python | mit | 8,356 |
import os
import lmdb
import logging
import functools
import contextlib
import synapse.exc as s_exc
import synapse.common as s_common
import synapse.reactor as s_react
import synapse.lib.lmdb as s_lmdb
import synapse.lib.tufo as s_tufo
import synapse.lib.cache as s_cache
import synapse.lib.const as s_const
import syn... | vivisect/synapse | synapse/lib/auth.py | Python | apache-2.0 | 27,384 |
# proxy module
from __future__ import absolute_import
from blockcanvas.function_tools.function_library import *
| enthought/etsproxy | enthought/block_canvas/function_tools/function_library.py | Python | bsd-3-clause | 112 |
from tkinter import *
from math import *
import constantes
menuBas = False
menuHaut = False
selectPrecedent = 0
select = 0
def gestionMenu(fen, affichage, boutons):
global select, menuBas, menuHaut, selectPrecedent
# Changements dans le menu
if menuBas:
if select <= 2:
select += 1
elif menuHaut:
if sel... | TheOneDarkling/PAC-MAN-python-project | menu.py | Python | apache-2.0 | 1,134 |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
# This file is part of Guadalinex
#
# This software 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, ... | gecos-team/gecos-firstboot | firstboot/pages/linkToChef/LinkToChefConfEditorPage.py | Python | gpl-2.0 | 7,126 |
# $Id: 125_sdp_with_multi_audio_0.py 2081 2008-06-27 21:59:15Z bennylp $
import inc_sip as sip
import inc_sdp as sdp
# Multiple good m=audio lines! The current algorithm in pjsua-lib will
# select the last audio (which should be okay, as we're entitled to
# select any of them)
sdp = \
"""
v=0
o=- 0 0 IN IP4 127.0.0.1
... | wenxinguo/xisip | tests/pjsua/scripts-sendto/125_sdp_with_multi_audio_0.py | Python | gpl-2.0 | 825 |
from lavendeux import Types, Errors
import time
def call(args):
# Check number of arguments
if len(args) != 0:
return (Types.ERROR, Errors.INVALID_ARGS)
return(Types.INT, int(time.time()))
def decorate(value):
return time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime(value))
def help():
return """A func... | rscarson/Lavendeux | bin/extensions/unixtime.py | Python | mit | 426 |
import os
import uuid
from io import StringIO
from django import forms
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.core.files.uploadedfile import InMemoryUploadedFile
from django.template import defaultfilters as filters
from .utils import scale_and_crop
from .... | melbic/django-markdownx | markdownx/forms.py | Python | gpl-2.0 | 2,143 |
import Util
import time
import unittest
import tAnimator
import selectBrowser
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.u... | pfederl/CARTAvis | carta/html5/common/skel/source/class/skel/simulation/tAnimatorTapeDeck.py | Python | gpl-2.0 | 19,807 |
import os
from setuptools import setup, find_packages
import systemjs
def read_file(name):
with open(os.path.join(os.path.dirname(__file__), name)) as f:
return f.read()
readme = read_file('README.rst')
requirements = [
'django-appconf>=0.6'
]
test_requirements = [
'mock',
'coverage',
]
s... | gannetson/django-systemjs | setup.py | Python | mit | 1,414 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Ver... | sparkslabs/kamaelia | Sketches/MPS/HTTP/KamaeliaWebServer.py | Python | apache-2.0 | 8,676 |
# 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/VariableIdPattern.py | Python | gpl-3.0 | 978 |
from __future__ import absolute_import
from .._hook import import_hook
@import_hook(__name__)
def value_processor(name, raw_name, raw_value):
return raw_value
del import_hook
del value_processor
| tonyseek/python-envcfg | envcfg/raw/__init__.py | Python | mit | 204 |
#!/usr/bin/env python
"""
ffmpeg-normalize
ffmpeg / avconv macro for normalizing audio
Audio normalization script, normalizing media files to WAV output
This program normalizes audio to a certain dB level. The default is an RMS-based
normalization where the mean is lifted. Peak normalization is possible wit... | mvbattista/audio-normalize | ffmpeg_normalize/__main__.py | Python | mit | 7,614 |
from __future__ import division
from sklearn import mixture, metrics
import pylab as pl
import csv
import numpy as np
def inc_avg(currAvg=None, currNumElem=None, newElem=None):
if not currAvg is None and not currNumElem is None and not newElem is None:
newAvg = currAvg + (newElem - currAvg) / (currNumE... | smorante/continuous-goal-directed-actions | simulated-CGDA/generalization/generalization_test2.py | Python | mit | 2,527 |
from lib.actions import BaseAction
__all__ = [
'CreatePoolMemberAction'
]
class CreatePoolMemberAction(BaseAction):
api_type = 'loadbalancer'
def run(self, region, pool_id, node_id, port):
driver = self._get_lb_driver(region)
pool = driver.ex_get_pool(pool_id)
node = driver.ex_ge... | armab/st2contrib | packs/dimensiondata/actions/create_pool_member.py | Python | apache-2.0 | 449 |
"""
Copyright (C) 2009 Hiroaki Kawai <[email protected]>
"""
_base32 = "0123456789bcdefghjkmnpqrstuvwxyz"
_base32_map = {_base32[i]: i for i in range(len(_base32))}
LONG_ZERO = 0
def _float_hex_to_int(f):
if f < -1.0 or f >= 1.0:
return None
if f == 0.0:
return 1, 1
h = f.hex()
x = h.... | aiven/journalpump | journalpump/geohash.py | Python | apache-2.0 | 1,883 |
# utility, wrappers, convenience and helper functions
# some are dna related
import random
from sys import *
import os, logging
import re
import shutil, tarfile
import math, socket
import urllib
import urllib2
from math import *
from ftplib import FTP
import unicodedata
import array, copy, posixpath
from posixpath im... | maximilianh/maxtools | lib/util.py | Python | gpl-2.0 | 27,667 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import mock
from exam import fixture
from sentry.testutils import TestCase
from sentry.interfaces.user import User
from sentry.models import Event
class UserTest(TestCase):
@fixture
def event(self):
return mock.Mock(spec=Event())
@... | jean/sentry | tests/sentry/interfaces/test_user.py | Python | bsd-3-clause | 1,453 |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import json
import os
import subprocess
import sys
from kubos_build import KubosBuild
import utils
this_dir = os.path.abspath(os.path.dirname(__file__))
root_dir = os.path.dirname(this_dir)
class KubosBuilder(object):
def __init__(self):
... | Psykar/kubos | tools/build.py | Python | apache-2.0 | 6,337 |
from django.conf import settings
from django.core.cache import cache
from django.http import Http404
from django.utils.encoding import smart_unicode
import redis
#Thanks to debug-toolbar for the response-replacing code.
_HTML_TYPES = ('text/html', 'application/xhtml+xml')
OUR_CODE = """
<hr> <!-- End original user c... | alex/readthedocs.org | readthedocs/core/middleware.py | Python | mit | 4,693 |
import json
from Crypto.PublicKey import RSA
from decimal import Decimal
class Util:
@staticmethod
def construct_key_from_data(rsa_data):
k = json.loads(rsa_data['whole'])
key = RSA.construct((
long(k['n']),
long(k['e']),
long(k['d']),
long(k['p']),
long(k['q']),
... | orisi/orisi | src/oracle/handlers/bounty_contract/util.py | Python | mit | 1,107 |
#!/usr/bin/python
import sys
import re
import codecs
argc = len(sys.argv)
if argc != 3:
sys.stderr.write('error: wrong number of arguments.\n')
exit(1)
input = sys.argv[1]
output = sys.argv[2]
locre = re.compile(r'^"(.*)" = "(.*)";$')
commentre = re.compile(r'^(/\*.*\*/)|(//.*)$')
inputfile = codecs.o... | JackieXie168/skim | postprocess-xib-strings.py | Python | bsd-3-clause | 1,458 |
# -*- coding: utf-8 -*-
import datetime
import functools
import logging
import markdown
import pytz
from addons.base.models import BaseNodeSettings
from bleach.callbacks import nofollow
from bleach import Cleaner
from functools import partial
from bleach.linkifier import LinkifyFilter
from django.db import models
from... | binoculars/osf.io | addons/wiki/models.py | Python | apache-2.0 | 19,644 |
from django.core.context_processors import csrf
from django.contrib.auth.models import User
from identity_providers.models import Cas
from openid_provider.models import *
def getUser(user):
values = {}
values['username'] = str(user)
try:
student = Cas.objects.get(user=user)
values['student_id'] = str(stude... | RaduGatej/SensibleData-Platform | sensible_data_platform/accounts/manager.py | Python | mit | 383 |
# Generated by Django 3.0.7 on 2020-08-08 07:15
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('company', '0022_auto_20200613_1045'),
]
operations = [
migrations.AlterModelOptions(
name='company',
options={'ordering': ['... | inventree/InvenTree | InvenTree/company/migrations/0023_auto_20200808_0715.py | Python | mit | 346 |
# Copyright (c) 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 required by applicab... | nikesh-mahalka/cinder | cinder/tests/unit/test_api_urlmap.py | Python | apache-2.0 | 12,846 |
#!/usr/bin/env python2
# Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.
import argparse
import logging
import os
import sys
import PIL.Image
# Add path for DIGITS package
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
import digits.config # noqa
... | gheinrich/DIGITS-GAN | digits/tools/resize_image.py | Python | bsd-3-clause | 4,054 |
# Zulip's OpenAPI-based API documentation system is documented at
# https://zulip.readthedocs.io/en/latest/documentation/api.html
#
# This file contains helper functions for generating cURL examples
# based on Zulip's OpenAPI definitions, as well as test setup and
# fetching of appropriate parameter values to use whe... | eeshangarg/zulip | zerver/openapi/curl_param_value_generators.py | Python | apache-2.0 | 11,845 |
from base64 import b64decode, b64encode
from collections import Container, Mapping, OrderedDict, Sequence
import math
from sh import chmod, Command, mkdir, tar
import six
from ..decorators import signature
from ..err import Err
from .core import onepath, Source, twopaths
class Inline(Source):
@onepath
def c... | drcloud/arx | arx/sources/inline.py | Python | mit | 5,118 |
#!/usr/bin/python
#
# Copyright Friday Film Club. All Rights Reserved.
"""Usersearch unit tests."""
__author__ = '[email protected] (Adam McGrath)'
import unittest
from google.appengine.api import search
from google.appengine.ext import ndb
import base
import helpers
import usersearch
class TasksTestCase(b... | adamjmcgrath/fridayfilmclub | src/tests/test_usersearch.py | Python | mpl-2.0 | 1,099 |
# -*- coding: utf-8 -*-
from __future__ import division
'''Test for checking variation of initial prestress force along a
post-tensioned member.
Data and rough calculation are taken from
Example 4.3 of the topic 4 of course "Prestressed Concrete Design
(SAB 4323) by Baderul Hisham Ahmad
ocw.utm.my
Problem stateme... | lcpt/xc | verif/tests/materials/prestressing/test_short_term_loss_prestress_01.py | Python | gpl-3.0 | 3,985 |
# -*- coding: utf-8 -*-
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, get_object_or_404
from django.urls import reverse
from spirit.core.utils.http import safe_redirect
from spirit.core.utils.views import is_post, post_data, is_ajax
from spirit.core.utils import json_r... | nitely/Spirit | spirit/comment/like/views.py | Python | mit | 1,843 |
'''
Performs both local sequence alignment given a list of
user-provided input sequences as a FASTA file.
'''
from parameter import PairwiseAlignmentArgumentValidator, PairwiseAlignmentCommandParser, InputWrapperState
from pairwise import PairwiseDriver
from random import shuffle
from score_converter import ScoreConv... | tgillet1/PASTA | spaghetti.py | Python | mit | 1,632 |
from .api import (process_pc_neighborhood,
process_pc_pathsbetween,
process_pc_pathsfromto,
process_owl,
process_model)
| pvtodorov/indra | indra/sources/biopax/__init__.py | Python | bsd-2-clause | 192 |
from formula.Formula import EMA
# MACD
class DATA():
def __init__(self, diff, dea):
self.Set(diff, dea)
def Set(self, diff, dea):
self.diff = diff;
self.dea = dea;
self.macd = 2 * (self.diff - self.dea);
def __str__(self):
return 'diff={0},dea={1},macd... | WaitGodot/peatio-client-python | formula/MACD.py | Python | cc0-1.0 | 1,349 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012, Nachi Ueno, NTT MCL, 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... | trunglq7/horizon | openstack_dashboard/dashboards/project/routers/ports/forms.py | Python | apache-2.0 | 5,612 |
import logging
from horoscope_parser.hs_parser import (
DailyCommonHoroscopeReceiver, DailyCommonHoroscopeParser
)
from horoscope_parser.hs_saver import DailyCommonHoroscopeDBSaver
from .constants import ANIMALS_DICT
logger = logging.getLogger(__name__)
class DailyCommonHoroscopeCollectorManager(object):
d... | adiletmaratov/horoscope-bot | src/horoscope_parser/clients.py | Python | mit | 1,341 |
"""
Current driven domain-wall motion with constant current and spin accumulation.
"""
# Copyright (C) 2011-2015 Claas Abert
#
# This file is part of magnum.fe.
#
# magnum.fe is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Fre... | micromagnetics/magnum.fe | examples/current_wall_motion/run.py | Python | lgpl-3.0 | 2,142 |
# 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 requ... | dims/nova | nova/tests/unit/virt/xenapi/test_vmops.py | Python | apache-2.0 | 66,102 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Serialization response factories.
Responsible for creating a HTTP response given ... | tiborsimko/invenio-records-rest | invenio_records_rest/serializers/response.py | Python | mit | 2,527 |
import os
def sect_from_bracket_file(infile, get_section = 'atoms', skip = ';'):
intt = open(infile,'r')
table = []
section = 'GLOBAL'
for ln in intt.readlines():
ln = ln.replace('\t',' ')
sp = ln.split()
if sp == [] or skip in sp[0] or skip in sp[0][0]:
continue
if '[' and ']' in ln:
... | 12AngryMen/votca-scripts | lib/Carlstuff/evaporation2/__proptions__.py | Python | apache-2.0 | 1,993 |
import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... | batxes/4Cin | SHH_WT_models/SHH_WT_models_final_output_0.1_-0.1_11000/mtx1_models/SHH_WT_models7948.py | Python | gpl-3.0 | 17,578 |
# -*- coding: utf8 -*-
# Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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... | tzpBingo/github-trending | codespace/python/tencentcloud/iot/v20180123/models.py | Python | mit | 107,334 |
# coding: utf-8
# PYTHON IMPORTS
from tempfile import NamedTemporaryFile
# DJANGO IMPORTS
from django.utils.translation import ugettext as _
from django.contrib import messages
from django.http import HttpResponseRedirect
from django.core.files import File
# FILEBROWSER IMPORTS
from filebrowser.settings import *
# ... | yaroslavprogrammer/django-filebrowser-no-grappelli | filebrowser/actions.py | Python | bsd-3-clause | 2,643 |
# encoding: 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):
# Deleting field 'ProjectImage.desc'
db.delete_column('portfolio_projectimage', 'desc')
def backward... | olofsj/tokotoko-portfolio | portfolio/migrations/0008_auto__del_field_projectimage_desc.py | Python | bsd-3-clause | 3,139 |
######################################################################
#
# Copyright (C) 2013
# Associated Universities, Inc. Washington DC, USA,
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published by
# the Free Software Fo... | e-koch/VLA_Lband | 16B/pipeline4.7.1_custom/EVLA_pipe_fluxgains.py | Python | mit | 6,065 |
from django.db import models
# Create your models here.
class MissingLog(models.Model):
font_name = models.CharField(max_length=256)
sys_font = models.BooleanField()
def __unicode__(self):
return '[%s] %s' % (self.sys_font and 'sys' or 'cad', self.font_name)
class Meta:
o... | Xiongpq/FontCenter | trunk/src/Web/Warrentech_FontCenter_Web/Warrentech_FontCenter_Web/models/MissingLog.py | Python | mit | 448 |
# coding=utf-8
import os
import sys
import pytest
import virtual_environments
from diff_test_tools import SCRIPT, expected_messages
from service_messages import ServiceMessage, assert_service_messages, match
from test_util import run_command, get_teamcity_messages_root
@pytest.fixture(scope='module', params=["nose=... | throwable-one/teamcity-messages | tests/integration-tests/nose_integration_test.py | Python | apache-2.0 | 20,505 |
"""Copyright 2009:
Isaac Carroll, Kevin Clement, Jon Handy, David Carroll, Daniel Carroll
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any ... | Donkyhotay/MoonPy | client/tileset.py | Python | gpl-3.0 | 13,461 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# acertmgr - various support functions
# Copyright (c) Markus Hauschild & David Klaftenegger, 2016.
# Copyright (c) Rudolf Mayerhofer, 2019.
# available under the ISC license, see LICENSE
import base64
import datetime
import io
import os
import re
import stat
import sys
i... | davidklaftenegger/acertmgr | acertmgr/tools.py | Python | isc | 18,859 |
#!/usr/bin/env python
# Copyright 2010-2012 RethinkDB, all rights reserved.
import sys, subprocess, os, time, signal
from vcoptparse import *
control_user = "rethinkdb@deadshot"
class VM(object):
def __init__(self, name, uuid, host, control):
self.name = name
self.uuid = uuid
self.host = h... | Qinusty/rethinkdb | scripts/VirtuaBuild/vm_access.py | Python | agpl-3.0 | 6,357 |
#!/usr/bin/env python
from numpy import array
from pyspark.mllib.recommendation import ALS
from pyspark import SparkConf, SparkContext
if __name__ == '__main__':
conf = SparkConf().setMaster("local[*]").setAppName("Dating Recommendations")
sc = SparkContext(conf=conf)
# Load and parse the Rating data
... | nvoron23/hadoop-fundamentals | recommender/recommendations.py | Python | mit | 1,038 |
import re
from datetime import datetime
from os.path import join
from urllib.parse import urlencode
import dateutil.parser
import magic
import requests
from django.conf import settings
from django.core.management.base import BaseCommand
from django.db import transaction
from candidates.models import PartySet
from pop... | DemocracyClub/yournextrepresentative | ynr/apps/elections/uk/management/commands/uk_update_parties_from_ec_data.py | Python | agpl-3.0 | 5,626 |
#!~/Documents/pysam_consensus/venv/bin/python3
import argparse
from Bio import SeqIO
def message(case, variables=None):
if case == "duplicate_accessions":
to_add, seq_list_file
message="""
$s is a duplicate accession in
file : %s
please remove duplicate accession.\n\n""" %( t... | NDHall/pysam_tools | fasta_ghost/fasta_ghost.py | Python | mit | 3,564 |
# 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 urlparse import urlparse
from django.forms import CheckboxSelectMultiple, MultiWidget, URLField
from django.forms i... | adini121/oneanddone | oneanddone/base/widgets.py | Python | mpl-2.0 | 3,122 |
issues=[
dict(name='Habit',number=5,season='Winter 2012',
description='commit to a change, experience it, and record'),
dict(name='Interview', number=4, season='Autumn 2011',
description="this is your opportunity to inhabit another's mind"),
dict(name= 'Digital Presence', number= 3, season= ... | adamgreenhall/openreviewquarterly | builder/config.py | Python | mit | 879 |
# -*- coding: utf-8 -*-
#
# testpy documentation build configuration file, created by
# sphinx-quickstart on Tue Sep 16 10:15:21 2014.
#
# 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
# autogenerated file.
#
# Al... | quchunguang/test | testpy/conf.py | Python | mit | 8,262 |
# encoding: utf-8
from __future__ import absolute_import, unicode_literals
import os
import shutil
import tempfile
import unittest
import glib
from mopidy import compat, exceptions
from mopidy.internal import path
import tests
class GetOrCreateDirTest(unittest.TestCase):
def setUp(self): # noqa: N802
... | diandiankan/mopidy | tests/internal/test_path.py | Python | apache-2.0 | 14,675 |
"""
This module contains functionality for navigation/browsing through text without selecting.
"""
from . import commands
from logging import debug
from .contract import pre, post
def movehalfpagedown(doc):
"""Move half a page down."""
width, height = doc.ui.viewport_size
offset = doc.ui.viewport_offset
... | Chiel92/fate | fate/navigation.py | Python | mit | 6,003 |
"""
Views related to the video upload feature
"""
from boto import s3
import csv
from uuid import uuid4
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseNotFound
from django.utils.translation import ugettext as _, ugettext_noop... | sameetb-cuelogic/edx-platform-test | cms/djangoapps/contentstore/views/videos.py | Python | agpl-3.0 | 12,545 |
""" rewrite of lambdify - This stuff is not stable at all.
It is for internal use in the new plotting module.
It may (will! see the Q'n'A in the source) be rewritten.
It's completely self contained. Especially it does not use lambdarepr.
It does not aim to replace the current lambdify. Most importantly it will never... | sahilshekhawat/sympy | sympy/plotting/experimental_lambdify.py | Python | bsd-3-clause | 25,111 |
import re
import navi_alphabet
from string import Template
word_path = 'word_list.txt'
output_path = 'poster/words.tex'
word_template = Template(r'\wordtype{$wtype} \wordgroup{$wgroups} \naviword{$word}')
word_group_template = Template(r'\wordgroup{$wgroup}')
def main():
def sub(w):
word, wtype, wgroups = w
... | EyeOfPython/navi-poster | navi_poster.py | Python | cc0-1.0 | 947 |
#!/usr/bin/env python
#
# Add
## Upvote
## Downvote
# Remove
#
#
import webapp2
import logging, json
from datetime import datetime
from src import rank, config
from webapp2_extras import jinja2, sessions
from src.entities import post as post1
from src.jinja2_factory import jinja2_factory
import random
class BaseHandl... | posibyte/wilsonrankgaetest | main.py | Python | mit | 4,464 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: David BEAL, Copyright 2014 Akretion
#
# 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 ... | hbrunn/server-tools | __unported__/configuration_helper/config.py | Python | agpl-3.0 | 4,900 |
"formatted string with args: {<ref>fst}".format(fst=12) | asedunov/intellij-community | python/testData/resolve/FormatStringKWArgs.py | Python | apache-2.0 | 55 |
# -*- coding: utf-8 -*-
"""
flask.testsuite.regression
~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests regressions.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import gc
import sys
import flask
import threading
import unittest
from werkzeug.exceptions impor... | abhishekgahlot/flask | flask/testsuite/regression.py | Python | bsd-3-clause | 3,198 |
from yowsup.common import YowConstants
from yowsup.layers import YowLayerEvent, YowProtocolLayer, EventCallback
from .keystream import KeyStream
from yowsup.common.tools import TimeTools
from .layer_crypt import YowCryptLayer
from yowsup.layers.network import YowNetworkLayer
from .autherror import AuthError
from .proto... | maruen/yowsup.jlguardi | yowsup/layers/auth/layer_authentication.py | Python | gpl-3.0 | 6,656 |
import networkx as nx
import matplotlib.pyplot as plt
if __name__ == "__main__":
print("Verify that Networkx version is 1.9.1 and above.")
print("Networkx version is: %s" % nx.__version__)
# === Helper functions ===
# Scroll down to network definition
def edges_to_labels(G, flow_dict={}):
d = dict()
... | PeterSR/DM554 | LP/netflows.py | Python | mit | 2,816 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Base class for QryForms
"""
__docformat__ = 'restructuredtext en'
### IMPORTS ###
from django.forms.util import ErrorList
from django import forms
from relais.dev import mountpoint, enum
from relais.dev.common import *
from relais.webviz.html.simpletag import *
i... | agapow/relais.webviz | relais/webviz/forms/baseform.py | Python | mit | 5,186 |
# 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 applicab... | tensorflow/tensorflow | tensorflow/python/kernel_tests/collective_ops_multi_worker_test.py | Python | apache-2.0 | 12,067 |
from __future__ import unicode_literals
from alliance_auth.celeryapp import app
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from notifications import notify
from .manager import IPBoardManager
from .models import IpboardUser
impor... | iAddz/allianceauth | services/modules/ipboard/tasks.py | Python | gpl-2.0 | 2,144 |
# -*- coding: utf-8 -*-
from pyload.plugin.internal.DeadCrypter import DeadCrypter
class NetfolderIn(DeadCrypter):
__name = "NetfolderIn"
__type = "crypter"
__version = "0.73"
__pattern = r'http://(?:www\.)?netfolder\.(in|me)/(folder\.php\?folder_id=)?(?P<ID>\w+)(?(1)|/\w+)'
__config = []... | ardi69/pyload-0.4.10 | pyload/plugin/crypter/NetfolderIn.py | Python | gpl-3.0 | 550 |
# Copyright 2017 AT&T Corporation.
# 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... | vedujoshi/tempest | tempest/tests/lib/services/volume/v2/test_scheduler_stats_client.py | Python | apache-2.0 | 3,040 |
from django.db import models
def content_file_name(request, filename):
return '/'.join([request.POST['dirName'], filename])
class Document(models.Model):
dirPath = models.CharField(max_length=1000, default="abc")
docfile = models.FileField(upload_to=content_file_name)
| draperlaboratory/stout | uploads/models.py | Python | apache-2.0 | 274 |
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google/tink | testing/cross_language/deterministic_aead_test.py | Python | apache-2.0 | 8,200 |
from __future__ import print_function
import os
from flask import Flask, render_template, url_for, request, jsonify
app = Flask(__name__)
@app.route('/',)
def homepage():
viewer = 'clinician'
description = 'This is the clinician version.'
return render_template('index.html', viewer=viewer, description=description... | daviszhou/ascvd-webapp | __init__.py | Python | mit | 898 |
from django.contrib import admin
from .models import ItemLink
class ItemLinkAdmin(admin.ModelAdmin):
search_fields = ["title", "description", "link"]
admin.site.register(ItemLink, ItemLinkAdmin)
| daviferreira/leticiastallone.com | leticiastallone/links/admin.py | Python | mit | 202 |
import os
import cPickle as pickle
home_dir = os.path.expanduser('~')
DATA_DIR = os.path.join(home_dir, '.tax_resolve')
if not os.path.exists(DATA_DIR):
try:
os.mkdir(DATA_DIR)
except: DATA_DIR = os.getcwd()
cache_path = lambda name: os.path.join(DATA_DIR, '%s.cache' % name)
def get_cache(name):
... | bendmorris/tax_resolve | caching.py | Python | mit | 464 |
from kentauros.context import KtrContext
from kentauros.package import KtrPackage
from kentauros.result import KtrResult
from .module import KtrModule
class PackageModule(KtrModule):
NAME = "Package"
def __init__(self, package: KtrPackage, context: KtrContext):
super().__init__(package, context)
... | decathorpe/kentauros | kentauros/modules/package.py | Python | gpl-2.0 | 1,177 |
"""
The MIT License
Copyright (c) 2007 Leah Culver
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, publis... | chilitechno/barrioSquare | oauth.py | Python | gpl-3.0 | 23,750 |
import enlighten
# prevent name shadowing
__enumerate = enumerate
def iterate(iterable):
return Progress(iterable)
def enumerate(iterable):
return __enumerate(iterate(iterable))
class Progress:
def __init__(self, iterable):
try:
total = len(iterable)
except (TypeError, Attrib... | grade-it/assigner | assigner/progress.py | Python | mit | 633 |
"""
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
distributed ... | dddomodossola/gui | examples/widgets_overview_app.py | Python | apache-2.0 | 14,647 |
import os, sys, subprocess, threading, cherrypy, webbrowser, sqlite3
import datetime
from lib.configobj import ConfigObj
from lib.apscheduler.scheduler import Scheduler
import threading
from lazylibrarian import logger, postprocess, searchnzb
FULL_PATH = None
PROG_DIR = None
ARGS = None
SIGNAL = None
LOGLEVEL ... | casanovainformationservices/LazyLibrarian | lazylibrarian/__init__.py | Python | gpl-3.0 | 14,102 |
'''
Created on 13-09-2013
@author: kamil
'''
from django.contrib import admin
from officetune.models import Song, Vote
admin.site.register(Vote)
admin.site.register(Song)
| karolmajta/officetune | server/src/officetune/officetune/admin.py | Python | mit | 175 |
import re, sre
class Nth(object):
def __init__(self, repl, n=0):
self.n = n
self.repl = repl
def __call__(self, match):
if self.n == 0:
self.n -= 1
return match.expand(self.repl)
else:
self.n -= 1
return match.group(0)
rex = re... | rik0/rk-exempla | misc/python/match_nth.py | Python | mit | 394 |
import json
import execjs._exceptions as exceptions
from execjs._abstract_runtime import AbstractRuntime
from execjs._abstract_runtime_context import AbstractRuntimeContext
from execjs._misc import encode_unicode_codepoints
try:
import PyV8
except ImportError:
_pyv8_available = False
else:
_pyv8_available... | doloopwhile/PyExecJS | execjs/_pyv8runtime.py | Python | mit | 2,669 |
# Copyright (c) 2003, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory (subject to receipt of
# any required approvals from the U.S. Dept. of Energy). All rights
# reserved.
#
"""Logging"""
ident = "$Id: logging.py 1395 2007-06-14 06:49:35Z boverhof $"
import os, sys
WARN ... | rameshg87/pyremotevbox | pyremotevbox/ZSI/wstools/logging.py | Python | apache-2.0 | 8,235 |
# Generated by Django 2.0.6 on 2018-07-19 15:41
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('iati', '0009_auto_20180710_1747'),
]
operations = [
migrations.AddField(
model_name='documentli... | zimmerman-zimmerman/OIPA | OIPA/iati/migrations/0010_documentlink_result.py | Python | agpl-3.0 | 480 |
#! /usr/bin/env python
from FXPy.fox import *
import os
class ShutterWindow(FXMainWindow):
def __init__(self, app):
FXMainWindow.__init__(self, app, "Shutter Widget Test", w=800, h=600)
foldericon = FXPNGIcon(self.getApp(),
open(os.path.join('icons', 'shutter1.png'), 'rb').read())
... | lylejohnson/FXPy | examples/shutter.py | Python | lgpl-2.1 | 4,680 |
#!/usr/bin/env python2
# -*- coding:utf-8 -*-
"""老赵的Python代码碎片之一
文件: pycode0x001B-server.py
功能: socket通讯小例子(服务器端)
许可: General Public License
作者: Zhao Xin (赵鑫) <[email protected]>
时间: 2013.08.31
"""
import sys
import socket
HOST = '127.0.0.1'
PORT = 8001
SOCK = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
SO... | archtaurus/laozhao-python-codes | src/pycode0x001B-server.py | Python | gpl-3.0 | 1,319 |
import os
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from config import configure_app
from flask_login import LoginManager
from flask_session import Session
app = Flask(__name__)
configure_app(app)
db = SQLAlchemy(app)
lm = LoginManager(app)
ss = Session(app)
directory = os.path.join(app.config... | zadiran/DataworksOnline | main.py | Python | mit | 400 |
#!/usr/bin/env python3
# Event Manager for Uzbl
# Copyright (c) 2009-2010, Mason Larobina <[email protected]>
# Copyright (c) 2009, Dieter Plaetinck <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published... | marklee77/uzbl | uzbl/event_manager.py | Python | gpl-3.0 | 15,573 |
# coding: utf-8
import ConfigParser
import os
def main():
code, begin, end = None, None, None
try:
config = ConfigParser.RawConfigParser(allow_no_value=True)
config.read('info.ini')
code = config.get('config', 'code')
begin = config.get('config', 'begin')
end = config.... | sundiontheway/landchina-spider | manage.py | Python | mit | 680 |
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Romain Bignon
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... | sputnick-dev/weboob | modules/youporn/module.py | Python | agpl-3.0 | 2,482 |
#!/usr/bin/env python
"""
Easy Install
------------
A tool for doing automatic download/extract/build of distutils-based Python
packages. For detailed documentation, see the accompanying EasyInstall.txt
file, or visit the `EasyInstall home page`__.
__ https://pythonhosted.org/setuptools/easy_install.html
"""
from... | darkwing/kuma | vendor/packages/setuptools/command/easy_install.py | Python | mpl-2.0 | 87,197 |
#!/usr/bin/env python
import threading
import dns
from dnsdisttests import DNSDistTest
class TestTrailing(DNSDistTest):
# this test suite uses a different responder port
# because, contrary to the other ones, its
# responders allow trailing data and we don't want
# to mix things up.
_testServerPor... | grahamhayes/pdns | regression-tests.dnsdist/test_Trailing.py | Python | gpl-2.0 | 2,718 |
"""
This module contains Python triggers for Cobbler.
With Cobbler one is able to add custom actions and commands after many events happening in Cobbler. The Python modules
presented here are an example of what can be done after certain events. Custom triggers may be added in any language as
long as Cobbler is allowed ... | cobbler/cobbler | cobbler/modules/installation/__init__.py | Python | gpl-2.0 | 717 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.