code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
from DistributedObjectUD import DistributedObjectUD
from direct.directnotify.DirectNotifyGlobal import directNotify
import sys
class DistributedObjectGlobalUD(DistributedObjectUD):
notify = directNotify.newCategory('DistributedObjectGlobalUD')
doNotDeallocateChannel = 1
isGlobalDistObj = 1
def __i... | mgracer48/panda3d | direct/src/distributed/DistributedObjectGlobalUD.py | Python | bsd-3-clause | 2,339 |
# RNA Splicing
# rosalind.info/problems/splc/
import sys
class splc:
codons = {
'TTT': 'F', 'CTT': 'L', 'ATT': 'I', 'GTT': 'V',
'TTC': 'F', 'CTC': 'L', 'ATC': 'I', 'GTC': 'V',
'TTA': 'L', 'CTA': 'L', 'ATA': 'I', 'GTA': 'V',
'TTG': 'L', 'CTG': ... | yuriyshapovalov/Prototypes | Rosalind/splc.py | Python | apache-2.0 | 1,917 |
#
# 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... | Acehaidrey/incubator-airflow | airflow/example_dags/example_python_operator.py | Python | apache-2.0 | 3,269 |
# Generated by Django 2.0.5 on 2018-06-11 11:27
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | matija94/show-me-the-code | learning_django/player/migrations/0001_initial.py | Python | mit | 1,195 |
"""
Demo platform that has a couple of fake sensors.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/demo/
"""
from blumate.const import ATTR_BATTERY_LEVEL, TEMP_CELSIUS
from blumate.helpers.entity import Entity
# pylint: disable=unused-argument
def setup_... | bdfoster/blumate | blumate/components/sensor/demo.py | Python | mit | 1,564 |
import os
import glob
subdir = os.listdir('Images')
for d in subdir:
if d != 'Images':
path = os.path.join('Images', d)
if os.path.isdir(path):
dogname = ''.join(d.split('-')[1:])
if dogname != '':
dogdir = os.listdir(path)
for i in ... | nilrogen/UML-ML-MDR | scripts/rename-images.py | Python | gpl-2.0 | 618 |
# Copyright 2015 ARM 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 writin... | freedomtan/workload-automation | wlauto/result_processors/notify.py | Python | apache-2.0 | 2,244 |
#! /bin/env python
# -*- coding: utf-8 -*-
import sys
import datetime
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
_fromUtf8 = lambda s: s
############################################################################################
## Messa... | Fritzip/SMS-Viewer | sms-viewer.py | Python | gpl-2.0 | 7,977 |
# Copyright (C) 2010-2011 Richard Lincoln
#
# 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... | rwl/PyCIM | CIM14/IEC61970/Core/Unit.py | Python | mit | 5,881 |
def extractQuillofkarnikaWordpressCom(item):
'''
Parser for 'quillofkarnika.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('Top Giants: Rebirth of the Black-Bellied Wife', '... | fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractQuillofkarnikaWordpressCom.py | Python | bsd-3-clause | 708 |
from .autocomplete import bp as autocomplete_bp
from .tables import bp as tables_bp
from .transactions import bp as transactions_bp
__all__ = [
autocomplete_bp,
tables_bp,
transactions_bp
]
| atomberg/transaction-organizer | app/blueprints/__init__.py | Python | mit | 203 |
"""
The LDBDClient module provides an API for connecting to and making requests of
a LDBDServer.
This module requires U{pyGlobus<http://www-itg.lbl.gov/gtg/projects/pyGlobus/>}.
This file is part of the Grid LSC User Environment (GLUE)
GLUE is free software: you can redistribute it and/or modify it under the
terms ... | ligo-cbc/pycbc-glue | pycbc_glue/LDBDClient.py | Python | gpl-3.0 | 11,113 |
#!/home/pi/.virtualenvs/cv2/bin/python
from picamera.array import PiRGBArray
from picamera import PiCamera
import picamera
from time import sleep
import time
import cv2
import numpy as np
import sys
import datetime
import boto3
import subprocess
import os
import pyowm
import commands
import multiprocessing
import thr... | tangowhisky37/RaspiPythonProjects | OpenCV/CaptureVideoStream/CaptureVideoStream_v0.21.py | Python | gpl-3.0 | 10,532 |
# 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 ... | ebagdasa/tempest | tempest/api/data_processing/test_job_binary_internals.py | Python | apache-2.0 | 3,285 |
# -*- Mode: python; coding: utf-8; tab-width: 8; indent-tabs-mode: t; -*-
#
# Copyright (C) 2009 John Iacona
#
# 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, or (at your optio... | dardevelin/rhythmbox-shuffle | plugins/context/ArtistTab.py | Python | gpl-2.0 | 13,087 |
#!/usr/bin/python
import argparse
import numpy as np
import matplotlib.pyplot as plt
from pylab import *
from column import getColumn
def createParser ():
parser = argparse.ArgumentParser()
parser.add_argument ('--dist', action='store_const', const=True)
parser.add_argument ('--apr', action='store... | zhekan/MDrun | src/distance.py | Python | agpl-3.0 | 2,447 |
'''
Import command for Winthrop team's spreadsheet. It can be invoked using::
python manage.py import_nysql [--justsammel] /path/to/csv
The ``--justsammel`` flag skips import of records to avoid
reproducing duplicates, but rebuilds the ``is_sammelband`` flag set and
produces an output list.
The expect behavior i... | Princeton-CDH/winthrop-django | winthrop/books/management/commands/import_nysl.py | Python | apache-2.0 | 12,753 |
# coding=utf-8
# Copyright 2016 Flowdas Inc. <prospero@flowdas.com>
#
# 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 pkg_resources import get_distribution
__autho... | flowdas/meta | flowdas/meta/__init__.py | Python | mpl-2.0 | 563 |
import json
import pytest
from awx.main.models.credential import CredentialType, Credential
from awx.api.versioning import reverse
@pytest.mark.django_db
def test_list_as_unauthorized_xfail(get):
response = get(reverse('api:credential_type_list'))
assert response.status_code == 401
@pytest.mark.django_db
... | wwitzel3/awx | awx/main/tests/functional/api/test_credential_type.py | Python | apache-2.0 | 12,160 |
import json
from pathlib import Path
from i3configger import config
from i3configger.build import persist_results
def test_initialization(tmp_path, monkeypatch):
"""Given empty sources directory a new config is created from defaults"""
monkeypatch.setattr(config, "get_i3wm_config_path", lambda: tmp_path)
... | obestwalter/i3configger | tests/test_config.py | Python | mit | 1,387 |
# -*- coding: utf-8 -*-
'''
Genesis Add-on
Copyright (C) 2015 lambda
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 ... | marnnie/Cable-buenaventura | plugin.video.genesis/modules/resolvers/novamov.py | Python | gpl-2.0 | 1,447 |
# -*- coding: utf-8 -*-
# Copyright 2022 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... | googleapis/python-memcache | samples/generated_samples/memcache_v1beta2_generated_cloud_memcache_update_instance_async.py | Python | apache-2.0 | 1,779 |
#!/usr/bin/python
#: ----------------------------------------------------------------------------
#: Copyright (C) 2017 Verizon. All Rights Reserved.
#: All Rights Reserved
#:
#: file: transform.py
#: details: memsql pipline transform python script
#: author: Mehrdad Arshad Rad
#: date: 04/27/2017
#:
#: License... | VerizonDigital/vflow | consumers/memsql/transform.py | Python | apache-2.0 | 4,027 |
# -*- coding: utf-8 -*-
import datetime
from factory import Sequence, Faker, SubFactory
from factory.alchemy import SQLAlchemyModelFactory
from liebraryrest.database import db
from liebraryrest.models import Author, Book, User
class BaseFactory(SQLAlchemyModelFactory):
"""Base factory."""
class Meta:
... | gekorob/liebraryrest | tests/factories.py | Python | bsd-3-clause | 1,354 |
from . import idnadata
import bisect
import unicodedata
import re
import sys
from .intranges import intranges_contain
_virama_combining_class = 9
_alabel_prefix = b'xn--'
_unicode_dots_re = re.compile('[\u002e\u3002\uff0e\uff61]')
class IDNAError(UnicodeError):
""" Base exception for all IDNA-encoding related pro... | google/material-design-icons | update/venv/lib/python3.9/site-packages/pip/_vendor/idna/core.py | Python | apache-2.0 | 11,849 |
"""
This scipt generates a noisy activation image image
and applies the bayesian structural analysis on it
Author : Bertrand Thirion, 2009
"""
#autoindent
print __doc__
import numpy as np
import scipy.stats as st
import matplotlib.pylab as mp
import nipy.neurospin.graph.field as ff
import nipy.neurospin.utils.simul_2... | yarikoptic/NiPy-OLD | examples/neurospin/bayesian_structural_analaysis.py | Python | bsd-3-clause | 6,285 |
#!/usr/bin/env python
import string
from AOR.Statements import Call
from AOR.BasicStatement import BasicStatement
from AOR.Do import Do,EndDo
from AOR.If import If,ElseIf,Else,EndIf,IfOnly
def GenerateFileCallTree(objFile,sFilename):
bDoLoops = 1
bIf = 1
nLevel = 3
lIgnore = ['']
mystring = "... | hiker/stan | Analyser/CallTree.py | Python | gpl-3.0 | 3,312 |
"""
Copyright (c) 2008-2015, Jesus Cea Avion <jcea@jcea.es>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of... | quentinlautischer/291MiniProject2 | lib/python3.5/site-packages/bsddb3/tests/test_lock.py | Python | apache-2.0 | 7,824 |
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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 versio... | GISPPU/GrenadaLandInformation | geonode/catalogue/views.py | Python | gpl-3.0 | 1,844 |
from channels.routing import route, include
channel_routing = [
#UNLIKE urls.py, path starts with /
include('voxel_globe.websockets.routing.channel_routing', path=r'^/ws')
] | ngageoint/voxel-globe | voxel_globe/vip/routing.py | Python | mit | 178 |
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, unicode_literals)
"""
===========================
Regulatory Control Measures
===========================
:Authors:
Moritz Emanuel Beber
:Date:
2013-05-10
:Copyright:
Copyright(c) 2013 Jacobs University of Bremen. All rights reserved.
:Fi... | Midnighter/pyorganism | pyorganism/regulation/control.py | Python | bsd-3-clause | 21,060 |
from __future__ import absolute_import
import logging
from django.conf import settings
from sentry.cache.redis import RedisClusterCache, RbCache
from .base import BaseAttachmentCache
logger = logging.getLogger(__name__)
class RedisClusterAttachmentCache(BaseAttachmentCache):
def __init__(self, **options):
... | mvaled/sentry | src/sentry/attachments/redis.py | Python | bsd-3-clause | 993 |
import os.path as op
import warnings
from nose.tools import assert_true, assert_equal
from numpy.testing import assert_array_almost_equal
import numpy as np
from ...io import Raw
from ...io.proj import make_projector, activate_proj
from ..ssp import compute_proj_ecg, compute_proj_eog
warnings.simplefilter('always') ... | trachelr/mne-python | mne/preprocessing/tests/test_ssp.py | Python | bsd-3-clause | 4,662 |
# -*- coding: utf-8 -*-
# Copyright (C) 2012-2013 Yahoo! Inc. 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/LICE... | junneyang/taskflow | taskflow/examples/wrapped_exception.py | Python | apache-2.0 | 4,732 |
"""empty message
Revision ID: 4986e64643f4
Revises: 175003d01257
Create Date: 2015-04-15 12:16:41.965765
"""
# revision identifiers, used by Alembic.
revision = '4986e64643f4'
down_revision = '175003d01257'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
def upgrade():
... | justinwp/croplands | migrations/versions/4986e64643f4_.py | Python | mit | 1,023 |
"""Implementation of magic functions for matplotlib/pylab support.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 The IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distri... | sserrot/champion_relationships | venv/Lib/site-packages/IPython/core/magics/pylab.py | Python | mit | 6,448 |
#!/usr/bin/env python
#
# GrovePi Example for using the Grove - I2C ADC(http://www.seeedstudio.com/depot/Grove-I2C-ADC-p-1580.html)
#
# The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http://www.dexterindustries.com/GrovePi
#
# Have a question about this example? Ask o... | penoud/GrovePi | Software/Python/grove_i2c_adc/i2c_adc_example.py | Python | mit | 1,840 |
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
import unittest, time, re
class EtlExport(unittest.TestCase):
# TODO Add class docstring
# TODO Add method docstring(s)
t... | vecnet/vnetsource | datawarehouse/tests/Selenium_Tests/etlExport.py | Python | mpl-2.0 | 2,274 |
#!/usr/bin/env python
from optparse import OptionParser
import glob
from multiprocessing import Array, Pool
import os
import pdb
import h5py
import numpy as np
from scipy.stats import cauchy
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import seaborn as sns
from basenji.plots import jointp... | calico/basenji | bin/archive/basenji_sad_norm.py | Python | apache-2.0 | 5,985 |
#!/usr/bin/env python
from __future__ import absolute_import
import sys
import os
import unittest
import numpy
# Need to temporarily append to the PYTHONPATH in order to import the
# newly built bytscl function
sys.path.append(os.getcwd())
from idl_functions import bytscl
class IDL_bytscl_Tester(unittest.TestCase)... | sixy6e/idl-functions | tests/unit_test_idl_bytscl.py | Python | bsd-2-clause | 2,479 |
import os
import tensorflow as tf
from tensorflow.core.protobuf import saver_pb2
import driving_data
import model
LOGDIR = './save'
sess = tf.InteractiveSession()
L2NormConst = 0.001
train_vars = tf.trainable_variables()
loss = tf.reduce_mean(tf.square(tf.sub(model.y_, model.y))) + tf.add_n([tf.nn.l2_loss(v) for v... | UvinduW/RCAutopilot | PC/Training Scripts/train.py | Python | mit | 1,973 |
"""
mbed SDK
Copyright (c) 2011-2013 ARM 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 wr... | Willem23/mbed | workspace_tools/export/uvision4.py | Python | apache-2.0 | 4,031 |
# Copyright 2015 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... | cg31/tensorflow | tensorflow/python/ops/linalg_ops.py | Python | apache-2.0 | 11,252 |
"""A POP3 client class.
Based on the J. Myers POP3 draft, Jan. 96
"""
# Author: David Ascher <david_ascher@brown.edu>
# [heavily stealing from nntplib.py]
# Updated: Piers Lauder <piers@cs.su.oz.au> [Jul '97]
# String method conversion and test jig improvements by ESR, February 2001.
# Added the POP3_SSL clas... | batermj/algorithm-challenger | code-analysis/programming_anguage/python/source_codes/Python3.5.9/Python-3.5.9/Lib/poplib.py | Python | apache-2.0 | 14,717 |
"""
Provide the function doxygen comment in impl file.
It check if there is doxygen sytle comment in front of each function definition.
It only check none static and none private funcions definition.
Unfortunately, this rule can not determine the method is private or not,
if the function definition is located in a cpp ... | codingpoets/tigl | thirdparty/nsiqcppstyle/rules/RULE_5_3_A_provide_doxygen_function_comment_on_function_in_impl.py | Python | apache-2.0 | 4,364 |
from django.db import models
from django.conf import settings
from sita.core.db.models import CatalogueMixin
# Create your models here.
class PatientManager(models.Manager):
def register(self, data, fields, user, **extra_fields):
print data
for key in data:
print key
if any... | Fabfm4/Sita-BackEnd | src/sita/patients/models.py | Python | apache-2.0 | 1,589 |
#!/usr/bin/env python
# Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia 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 (FSF), e... | NadineKroher/essentia | test/src/unittest/sfx/test_maxtototal_streaming.py | Python | agpl-3.0 | 1,940 |
"""
Customizations of sphinx for gnuradio use.
"""
from sphinx.ext.autodoc import py_ext_sig_re
from sphinx.ext.autodoc import ClassDocumenter, FunctionDocumenter, members_option
from sphinx.ext.autodoc import bool_option, members_set_option, identity
from sphinx.ext.autodoc import ALL
# A dictionary of the number of... | chiotlune/ext | gnuradio-3.7.0.1/docs/sphinx/gnuradio_sphinx.py | Python | gpl-2.0 | 7,553 |
from os.path import basename
import logging
from inspect import stack
import numpy as np
from larray_editor.utils import (get_font, to_text_string,
is_float, is_number, LinearGradient, SUPPORTED_FORMATS, scale_to_01range,
Product, is_number_value, get_sa... | larray-project/larray-editor | larray_editor/arraymodel.py | Python | gpl-3.0 | 21,336 |
#!/usr/bin/env python
#
import pytest
# pytestmark = pytest.mark.skipif(False, reason="only run mannually")
pytestmark = pytest.mark.needs_mantid
interactive = False
import os
here = os.path.abspath(os.path.dirname(__file__))
datadir = os.path.join(here, '..', "data")
import imp
dataurls = imp.load_source('dataurls... | sns-chops/multiphonon | tests/ui/batch_TestCase.py | Python | mit | 1,833 |
__author__ = 'VinceVi83'
# !/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
from Gestion import Ctes
from Gestion.Enum import *
class AlarmMusicClock:
'''
TODO : change right on cron file
Launch crontab -e avant use this oart of the code
Feature to rec
'''
@staticmethod
def back... | VinceVi83/MultiRoom | Command/AlarmMusicClock.py | Python | gpl-3.0 | 2,106 |
#!/usr/bin/env python
# Copyright (c) 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import absolute_import
import argparse
import logging
import os
import platform
import shutil
import stat
import su... | catapult-project/catapult | third_party/vinn/vinn/_vinn.py | Python | bsd-3-clause | 13,524 |
# -*- coding: utf-8 -*-
"""
main.py
Jan 14, 2014
Copyright (C) 2014 Baris Sencan
"""
import os
import redis
from flask import Flask, render_template, url_for
from flask.ext.compress import Compress
app = Flask(__name__)
# Enable gzip compression.
Compress(app)
# Static file loading helper.
app.jinja_env.globals['s... | isair/youtubekapatildimi | main.py | Python | apache-2.0 | 1,063 |
import sys
def setup(core, object):
object.setStfFilename('static_item_n')
object.setStfName('item_bracelet_r_set_spy_utility_a_01_01')
object.setDetailFilename('static_item_d')
object.setDetailName('item_bracelet_r_set_spy_utility_a_01_01')
object.setIntAttribute('required_combat_level', 85)
object.setStringAtt... | ProjectSWGCore/NGECore2 | scripts/object/tangible/wearables/bracelet/item_bracelet_r_set_spy_utility_a_01_01.py | Python | lgpl-3.0 | 1,078 |
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Frappe Technologies and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class WorkspaceShortcut(Document):
pass
| mhbu50/frappe | frappe/desk/doctype/workspace_shortcut/workspace_shortcut.py | Python | mit | 235 |
"""
Svg reader.
"""
from __future__ import absolute_import
#Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module.
import __init__
from fabmetheus_utilities.geometry.creation import lineation
from fabmetheus_utilit... | natetrue/ReplicatorG | skein_engines/skeinforge-40/fabmetheus_utilities/geometry/creation/_svg.py | Python | gpl-2.0 | 2,230 |
# coding=utf-8
"""Provider code for Torrenting."""
from __future__ import unicode_literals
import logging
from medusa import tv
from medusa.bs4_parser import BS4Parser
from medusa.helper.common import (
convert_size,
try_int,
)
from medusa.logger.adapters.style import BraceAdapter
from medusa.providers.torr... | pymedusa/Medusa | medusa/providers/torrent/html/torrenting.py | Python | gpl-3.0 | 5,376 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('mps_v2', '0011_group_displayed'),
]
operations = [
migrations.AddField(
model_name='group',
name='lo... | ManoSeimas/manoseimas.lt | manoseimas/mps_v2/migrations/0012_group_logo.py | Python | agpl-3.0 | 431 |
#!/home/paulk/software/bin/python
import sys
import random
try:
fn = sys.argv[1]
col = int(sys.argv[2])
no = int(sys.argv[3])
except IndexError:
print >> sys.stderr,"Script to print a random number of items from a column."
print >> sys.stderr,"Usage: %s <file> <column> <number>" % sys.argv[0]
sys.exit(0)
f = op... | polarise/RP-python | pick_random_from_col.py | Python | gpl-2.0 | 470 |
# This file was created automatically by SWIG 1.3.29.
# Don't modify this file, modify the SWIG interface instead.
"""
Classes for a simple HTML rendering window, HTML Help Window, etc.
"""
import _html
import new
new_instancemethod = new.instancemethod
def _swig_setattr_nondynamic(self,class_type,name,value,static=1... | DaniilLeksin/gc | wx/html.py | Python | apache-2.0 | 86,366 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
"""
This module implements a friendly (well, friendlier) interface between the raw JSON
responses from JIRA and the Resource/dict abstractions provided by this library. Users
will construct a JIRA ob... | awurster/jira | jira/client.py | Python | bsd-2-clause | 100,625 |
"""Clears the Cache"""
from django.core.cache import cache
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""
Clears the Cache
"""
help = "Clears the Cache"
def handle(self, **options):
"""Clears the Cache"""
cache.clear()
self.stdout.... | podiobooks/podiobooks | podiobooks/management/commands/clear_cache.py | Python | gpl-3.0 | 345 |
# -*- coding: utf-8 -*-
SFDC_COUNTRIES = {
'af': 'Afghanistan',
'ax': 'Aland Islands',
'al': 'Albania',
'dz': 'Algeria',
'as': 'American Samoa',
'ad': 'Andorra',
'ao': 'Angola',
'ai': 'Anguilla',
'aq': 'Antarctica',
'ag': 'Antigua and Barbuda',
'ar': 'Argentina',
'am': 'Armenia',
'aw': 'Aruba... | glogiotatidis/basket | basket/news/country_codes.py | Python | mpl-2.0 | 10,229 |
# -*- coding: utf-8 -*-
"""The :class:`Schema` class, including its metaclass and options (class Meta)."""
from __future__ import absolute_import, unicode_literals
from collections import defaultdict, Mapping
import copy
import datetime as dt
import decimal
import inspect
import json
import types
import uuid
import wa... | VladimirPal/marshmallow | marshmallow/schema.py | Python | mit | 34,135 |
#!/usr/bin/env python
import sys
import argparse
import regrws.convert
import regrws.payload.org
import regrws.method.org
try:
from apikey import APIKEY
except ImportError:
APIKEY = None
description = 'Create ARIN recipient ORG from template'
epilog = 'API key can be omitted if APIKEY is defined in apikey.py... | RhubarbSin/arin-reg-rws | org_create.py | Python | mit | 1,557 |
import bisect
import difflib
import sys
import warnings
import rope.base.oi.doa
import rope.base.oi.objectinfo
import rope.base.oi.soa
from rope.base import ast, exceptions, taskhandle, utils, stdmods
from rope.base.exceptions import ModuleNotFoundError
from rope.base.pyobjectsdef import PyModule, PyPackage, PyClass
i... | JetChars/vim | vim/bundle/python-mode/pymode/libs3/rope/base/pycore.py | Python | apache-2.0 | 15,520 |
import sys
import dl
sys.setdlopenflags(dl.RTLD_GLOBAL|dl.RTLD_NOW)
import ascpy
import gtkbrowser
print "python: creating new library object\n";
#----errror callback function-----
def error_reporter(sev,filename,line,msg):
if(sev==1):
leftstr = ""
rightstr = "\n"
typestr = "Note: "
elif(sev==2):
leftstr... | georgyberdyshev/ascend | pygtk/librarytest.py | Python | gpl-2.0 | 3,626 |
from django.conf import settings
from django.utils.safestring import SafeString
from django import template
register = template.Library()
def dfp(slot):
html = SafeString()
data = settings.DFP_SLOTS
data = data[slot]
html+='<div class="dfp-ads" data-slot="%s" data-account="%s" >' % (data['slot'],data... | divadrei/django-responsive-dfp | dfp/templatetags/dfp.py | Python | mit | 636 |
import re
n = int(input())
s = ' ' + input().replace(' ', ' ') + ' '
p = re.compile(r'(\s\d+\s)\1{2,}')
while True:
c = len(s)
s = re.sub(p, '', s, count=1)
if len(s) == c:
break
print(n - len(s.split()))
| altg0x0/info_tasks | 18/f1.py | Python | unlicense | 228 |
from flask import Flask
from flask_restful import Api
from services import OrderService, OrderListService
app = Flask(__name__)
api = Api(app)
api.add_resource(OrderListService, '/rest/orders/')
api.add_resource(OrderService, '/rest/orders/<int:id>')
if __name__ == '__main__':
app.run(debug=True)
| LukasRychtecky/wa2 | 2_RESTful/python/app/server.py | Python | mit | 307 |
"""
Utility methods for bokchoy database manipulation.
"""
from __future__ import print_function
import os
import tarfile
import boto
from paver.easy import BuildFailure, sh
from pavelib.prereqs import compute_fingerprint
from pavelib.utils.envs import Env
CACHE_FOLDER = 'common/test/db_cache'
FINGERPRINT_FILEPATH =... | hastexo/edx-platform | pavelib/utils/db_utils.py | Python | agpl-3.0 | 7,787 |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Common library methods used by both coordinator and task machines."""
import argparse
import logging
import os
import socket
import xmlrpclib
LOGGING_LE... | SaschaMester/delicium | testing/legion/common_lib.py | Python | bsd-3-clause | 1,225 |
from django.utils.translation import ugettext_lazy as _, ugettext
from .common import *
class NewswallDateNavigationExtension(NavigationExtension):
"""
Navigation extension for FeinCMS which shows a year and month Breakdown:
2012
April
March
February
January
2011
20... | michaelkuty/django-newswall | newswall/navigation_extensions/treeinfo.py | Python | bsd-3-clause | 1,250 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | nathanielvarona/airflow | airflow/providers/tableau/operators/tableau_refresh_workbook.py | Python | apache-2.0 | 3,881 |
#
# Copyright 2017 University of Southern California
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
#
from distutils.core import setup
setup(
name="youtubeUploader",
description="Script for uploading a video to YouTube",
version="0.1-prerelease",
scripts=[
"youtubeU... | informatics-isi-edu/microscopy | youtube/youtubeUploader/setup.py | Python | apache-2.0 | 777 |
"""Test the dxf matplotlib backend.
Copyright (C) 2014 David M Kent
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, modi... | dmkent/mpldxf | mpldxf/test_backend_ezdxf.py | Python | mit | 2,665 |
# -*- coding: utf-8 -*-
"""
Custom serializers suitable to translated models.
"""
from __future__ import absolute_import, unicode_literals
from rest_framework import serializers
# Similar to DRF itself, expose all fields in the same manner.
from parler_rest.fields import TranslatedFieldsField, TranslatedField, Transla... | AdrianLC/django-parler-rest | parler_rest/serializers.py | Python | apache-2.0 | 2,014 |
# linux kernel version plugin by ine (2020)
from util import hook
from utilities import request
import re
@hook.command(autohelp=False)
def kernel(inp, reply=None):
data = request.get("https://www.kernel.org/finger_banner")
lines = data.split('\n')
versions = []
old_versions = []
for line in line... | FrozenPigs/Taigabot | plugins/kernel.py | Python | gpl-3.0 | 865 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-28 17:02
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('testManage', '0003_auto_20161025_1503'),
]
operati... | qinggeng/ceShiGuanLiXiTong | site/ceShiGuanLiSite/apps/testManage/migrations/0004_auto_20161028_1702.py | Python | mit | 1,127 |
import sublime, sublime_plugin
from Default.exec import ExecCommand
# Related reading:
# http://stackoverflow.com/questions/41768673/let-sublime-choose-among-two-similar-build-systems
# This is very similar to shebanger.py. This uses the same method, only here the
# idea is that the build system holds the possi... | STealthy-and-haSTy/SublimeScraps | build_enhancements/python_build.py | Python | mit | 2,325 |
#!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet keypool and interaction with wallet encryption/locking."""
from test_framework.test_fr... | vergecurrency/VERGE | test/functional/wallet_keypool.py | Python | mit | 3,535 |
#!/usr/bin/env python2
import math,copy
"""PARAMETERS"""
shoulder_offset=37.5
hub_offset=50
arm_length=200
screw_spacing=300
screw_angles=[150,270,30]
start_positions=[253.2,252.9,253.2] #G92 X253.75 Y253.75 Z253.75
delta_radius=screw_spacing/3.0*math.sqrt(3)
screw_positions=[(delta_radius*math.cos(math.pi*screw_angl... | pjoyce42/ConceptFORGE | LISA Simpson/GCODE PREPROCESSOR/simpson segmentize.py | Python | gpl-3.0 | 3,954 |
# -*- coding: utf-8 -*-
import os
import sys
import setuptools
from flake8.engine import get_parser, get_style_guide
from flake8.util import is_flag, flag_on
if sys.platform.startswith('win'):
DEFAULT_CONFIG = os.path.expanduser(r'~\.flake8')
else:
DEFAULT_CONFIG = os.path.join(
os.getenv('XDG_CONFIG... | WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/flake8/main.py | Python | bsd-3-clause | 4,526 |
from collections import defaultdict
from itertools import chain
class CyclicGraphError(ValueError):
"""
This exception is raised if the graph is Cyclic (or rather, when the
sorting algorithm *knows* that the graph is Cyclic by hitting a snag
in the top-sort)
"""
pass
class Network(object):
... | influence-usa/pupa | pupa/utils/topsort.py | Python | bsd-3-clause | 4,925 |
import io
from fixtures import *
import tarfile
import gzip
def test_backing_up_config_dir():
compressed_tar_blob = manager.backup.config_dir()
tar = tarfile.open(fileobj=io.BytesIO(compressed_tar_blob), mode='r:*')
# The configuration directory has 9 files in it, plus the config directory
assert len... | Jumpscale/openwrt-remote-manager | tests/backup_test.py | Python | mit | 346 |
"""
OAI INTEGRATION
"""
| dcosentino/edx-platform | lms/djangoapps/oai/__init__.py | Python | agpl-3.0 | 24 |
"""API to expose the latest Liberation Pledge pledgers."""
import datetime
from oauth2client.client import SignedJwtAssertionCredentials
import os
import gspread
from flask import Flask, jsonify, request
from werkzeug.contrib.cache import SimpleCache
SHEET_ID = os.environ["LIBERATION_PLEDGE_SHEET_ID"]
NUM_PLEDGERS_LI... | directactioneverywhere/server | latest_pledgers/latest_pledgers.py | Python | gpl-3.0 | 3,486 |
from django.db import migrations
from django.db.backends.postgresql.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
def clear_analytics_tables(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
UserCount = apps.get_model('analytics', 'UserCount')
StreamCount = a... | showell/zulip | analytics/migrations/0011_clear_analytics_tables.py | Python | apache-2.0 | 954 |
from django.conf.urls import patterns, url
from polls import views
urlpatterns = patterns('',
# ex: /polls/
url(r'^$', views.IndexView.as_view(), name='index'),
# ex: /polls/5/
url(r'^(?P<pk>\d+)/$', views.DetailView.as_view(), name='detail'),
# ex: /polls/5/results/
url(r'^(?P<pk>\d+)/result... | ooffeerr/free-games | polls/urls.py | Python | apache-2.0 | 465 |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
from future.moves.urllib.parse import quote
import logging
from flexget import plugin
from flexget.event import event
log = logging.getLogger("stmusic")
class UrlRewriteSTMu... | qvazzler/Flexget | flexget/plugins/urlrewrite/stmusic.py | Python | mit | 819 |
# -*- encoding: utf-8 -*-
from pathlib import Path
from os import PathLike
from typing import (
Any,
AnyStr,
ByteString,
Dict,
Generator,
Iterable,
List,
Mapping,
NamedTuple,
Optional,
Sequence,
SupportsInt,
Text,
Tuple,
Type,
TypeVar,
Union,
NewT... | kchawla-pi/united-states-of-browsers | united_states_of_browsers/db_merge/imported_annotations.py | Python | gpl-3.0 | 617 |
def to_cpp(version_info):
return _CppFormatter().format(version_info)
def to_python(version_info):
return _PythonFormatter().format(version_info)
class _Formatter(object):
def __init__(self):
pass
def format(self, version_info):
return self.main_formatter(version_info,
... | smessmer/gitversion | src/gitversionbuilder/versioninfooutputter.py | Python | gpl-3.0 | 3,980 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from rest_framework import serializers
from .models import CompareRequest
class CompareRequestSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = CompareRequest
fields = ('id', 'repo', 'pull_request_num', 'base_r... | Wikia/sparrow | apps/compare_requests/serializers.py | Python | mit | 606 |
# Copyright 2013 Google Inc. 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 applicable law or ... | ram8647/gcb-mobilecsp | modules/upload/upload_tests.py | Python | apache-2.0 | 10,543 |
#!/usr/bin/env python
# [SublimeLinter pep8-max-line-length:150]
# -*- coding: utf-8 -*-
"""
black_rhino is a multi-agent simulator for financial network analysis
Copyright (C) 2016 Co-Pierre Georg (co-pierre.georg@keble.ox.ac.uk)
Pawel Fiedor (pawel@fiedor.eu)
This program is free software: you can redistribute it a... | cogeorg/BlackRhino | examples/solow/src/transaction.py | Python | gpl-3.0 | 9,256 |
import os
import pandas as pd
#import seaborn as sns
total_reads = pd.read_csv('../data/sample_info/sample_read_counts.tsv', sep='\t', names = ['fastq filename', 'number of reads'])
total_reads['cryptic metagenome name'] = total_reads['fastq filename'].str.strip('.fastq.gz')
sample_info = pd.read_csv('../data/sample_... | dacb/assembly_and_binning | assess_unbinned_reads_across_samples/assess_unbinned_reads_across_samples.py | Python | mit | 858 |
from __future__ import print_function, division, absolute_import
import functools
import locale
import weakref
import llvmlite.llvmpy.core as lc
import llvmlite.llvmpy.passes as lp
import llvmlite.binding as ll
import llvmlite.ir as llvmir
from numba import config, utils
from numba.runtime.atomicops import remove_re... | stefanseefeld/numba | numba/targets/codegen.py | Python | bsd-2-clause | 20,232 |
import _plotly_utils.basevalidators
class MarkerValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="marker", parent_name="scattermapbox.selected", **kwargs
):
super(MarkerValidator, self).__init__(
plotly_name=plotly_name,
parent_... | plotly/python-api | packages/python/plotly/plotly/validators/scattermapbox/selected/_marker.py | Python | mit | 769 |
import nltk
import re
import pickle
import json
import os.path as path
def LoadData(datalist):
database = []
for datafile in datalist:
f = open(datafile)
line = f.readline()
f.close()
raw_data = json.loads(str(line.strip()))
database = PushData(raw_data, database)
return database
def PushData(data, databa... | leahrnh/ticktock_text_api | make_dictionary.py | Python | gpl-2.0 | 740 |
# vim:set fileencoding=utf-8
import unittest
import gi
gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
from mock import Mock
import blivet
from blivet.errors import BTRFSValueError
from blivet.errors import DeviceError
from blivet.devices import BTRFSSnapShotDevice
from blive... | kellinm/blivet | tests/devices_test/device_properties_test.py | Python | gpl-2.0 | 31,599 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.