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 datetime import datetime
from optparse import make_option
import os
import re
import sys
from django.conf import settings
from django.core.management.base import BaseCommand
from cuddlybuddly.storage.s3.exceptions import S3Error
from cuddlybuddly.storage.s3.storage import S3Storage
output_length = 0
def output(t... | kylemacfarlane/django-cb-storage-s3 | src/cuddlybuddly/storage/s3/management/commands/cb_s3_sync_media.py | Python | bsd-3-clause | 5,061 |
from __future__ import absolute_import, unicode_literals
import copy
import os
import re
import sys
from io import BytesIO
from pprint import pformat
from django.conf import settings
from django.core import signing
from django.core.exceptions import DisallowedHost, ImproperlyConfigured
from django.core.files import u... | otherness-space/myProject003 | my_project_003/lib/python2.7/site-packages/django/http/request.py | Python | mit | 19,265 |
class User():
def comparePasswd(self,passwd):
if self.passwd == passwd:
return True
else:
return False
def __init__(self):
"""index变量是指明了当前用户现在看到了哪里"""
self.name = None
self.connection = None
self.logged = False
self.isAdmin = Fal... | FindHao/ChatGroup | Server/user.py | Python | mit | 404 |
import math
import random
import time
import matplotlib.pyplot as pyplot
from matplotlib.pyplot import Figure, subplot
from smallestenclosingcircle import make_circle
K = 0
C = 0
positions = []
def search(Positions, k, c):
global K
global C
K = k
C = c
global positions
positions = Positions... | RaphaelLapierre/INF4215 | TP1/zip1/main.py | Python | mit | 4,116 |
import sys
import os.path
sys.path.insert( 0, os.path.normpath(os.path.join( os.path.dirname( __file__ ), '..') ))
from aql_tests import skip, AqlTestCase, runLocalTests
from aql.utils import fileChecksum, Tempdir, \
disableDefaultHandlers, enableDefaultHandlers, addUserHandler, removeUserHandler
from aql.values ... | menify/sandbox | aql/tests/nodes/aql_test_build_manager.py | Python | mit | 20,380 |
# NamoInstaller ActiveX Control 1.x - 3.x
# CVE-NOMATCH
import logging
log = logging.getLogger("Thug")
def Install(self, arg):
if len(arg) > 1024:
log.ThugLogging.log_exploit_event(self._window.url,
"NamoInstaller ActiveX",
... | pdelsante/thug | thug/ActiveX/modules/NamoInstaller.py | Python | gpl-2.0 | 1,217 |
import textwrap
from ... import command
from ...needy import ConfiguredNeedy
class SyncCommand(command.Command):
def name(self):
return 'sync'
def add_parser(self, group):
parser = group.add_parser(
self.name(),
description=textwrap.dedent('''\
Attempt... | ccbrown/needy | needy/commands/dev/sync.py | Python | mit | 1,086 |
# -*- coding: utf-8 -*-
import models
import wizard | sumihai-tekindo/helpdesk_sicepat | helpdesk_sicepat/__init__.py | Python | gpl-3.0 | 55 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os, sys
from platformcode import config, logger
from core import scrapertools
from core.item import Item
from core import servertools
from core import httptools
from core import tmdb
from core ... | alfa-jor/addon | plugin.video.alfa/channels/tnaflix.py | Python | gpl-3.0 | 6,761 |
from .. import Load
newRocPlotter = Load('PlotROC')
plotter = newRocPlotter()
| dabercro/CrombieTools | python/CrombieTools/PlotTools/PlotROC.py | Python | mit | 85 |
import logging
from monnet.interests.util import reg_representative
log = logging.getLogger(__name__)
CATEGORIES = {
u'I - Professional consultancies/law firms/self-employed consultants': 1,
u'II - In-house lobbyists and trade/professional associations': 2,
u'III - Non-governmental organisations': 3,
... | pudo/transparency-register-scraper | old/categories.py | Python | mit | 1,841 |
from django.conf.urls.defaults import *
#from pinax.apps.account import urls
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
from wangji.sharesite.models import Onesite
info_dict = {
'queryset': Onesite.objects.all(),
}
url... | weaponsjtu/neteye | urls.py | Python | gpl-2.0 | 1,514 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 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.apac... | vichoward/python-neutronclient | neutronclient/openstack/common/strutils.py | Python | apache-2.0 | 7,360 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields
class User(models.Model):
_inherit = ['res.users']
employee_cars_count = fields.Integer(related='employee_id.employee_cars_count')
@property
def SELF_READABLE_FIELDS(se... | jeremiahyan/odoo | addons/hr_fleet/models/res_users.py | Python | gpl-3.0 | 497 |
#
# THIS FILE IS PART OF THE JOKOSHER PROJECT AND LICENSED UNDER THE GPL. SEE
# THE 'COPYING' FILE FOR DETAILS
#
# RecordingView.py
#
# A sub-class of gtk.Frame containing the visual layout of instrument
# tracks, timeline, and horizontal scrollbars.
#
#-----------------------------------------------------------------... | Barbosabyte/bard | Jokosher/RecordingView.py | Python | mpl-2.0 | 21,947 |
# -*- coding: utf-8 -*-
import json
from copy import deepcopy
from django import forms
from django.core.files.storage import default_storage as storage
import mock
from pyquery import PyQuery as pq
import waffle
from olympia import amo
from olympia.amo.tests import TestCase
from olympia.addons.models import Addon, A... | andymckay/addons-server | src/olympia/devhub/tests/test_views_validation.py | Python | bsd-3-clause | 37,835 |
#!/usr/bin/python
import sys, os
import sbpfs
import time
CNode = '59.78.15.46'
def ls():
path = '/'
detail = False
import sys
if len(sys.argv[1:]) > 1:
if sys.argv[2].startswith('/'):
path = sys.argv[2]
if path.endswith('/'):
path = path[:-1]
if "-l" in sys.argv[1:]:
detail = True
fd = sb... | gtxx3600/SBPFS | libpy/sbpfs.py | Python | gpl-2.0 | 6,237 |
from itertools import repeat
from xmodule.course_module import CourseDescriptor
from .exceptions import (ItemNotFoundError, NoPathToItem)
from . import Location
def path_to_location(modulestore, course_id, location):
'''
Try to find a course_id/chapter/section[/position] path to location in
modulestore.... | abhinavp13/IITBX-edx-platform-dev | common/lib/xmodule/xmodule/modulestore/search.py | Python | agpl-3.0 | 4,563 |
# Copyright 2010 http://www.collabq.com
# Copyright 2009 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 ... | CollabQ/CollabQ | common/display.py | Python | apache-2.0 | 7,099 |
from PyQt4.QtCore import *
from PyQt4.QtGui import *
startup_message = r''' '''
class Console(QTextEdit):
def __init__(self, prompt='Moderat@shell$>', parent=None):
QTextEdit.__init__(self, parent)
self.prompt = prompt
self.history = []
self.namespace = {}
self.setGeometry... | Swordf1sh/Moderat | modules/mshell/console.py | Python | gpl-2.0 | 3,752 |
"""
Borrowed from wxPython XML tree demo and modified.
"""
import sys
import string
from xml.parsers import expat
class Element:
'A parsed XML element'
def __init__(self,name,attributes):
'Element constructor'
# The element's tag name
self.name = name
# The element's attribute dictionary
self.attributes =... | aeguana/PyFileMaker | PyFileMaker/xml2obj.py | Python | bsd-3-clause | 2,714 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of ArchSetup.
#
# ArchSetup 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 ... | mame98/ArchSetup | Interface/Windows/NetworkWindow.py | Python | gpl-3.0 | 2,167 |
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
long_desc = '''
This package contains the seqansphinx Sphinx extension.
'''
requires = ['Sphinx>=0.6']
setup(
name='seqansphinx',
version='0.3.0',
url='http://github.com/seqan/seqan-sphinx',
download_url='http://pypi.p... | holtgrewe/seqansphinx | setup.py | Python | mit | 1,130 |
import __builtin__
import maps
from mock import patch
from tendrl.commons.objects.cluster.atoms.check_sync_done import CheckSyncDone
from tendrl.commons.utils.ansible_module_runner import AnsibleRunner
class MockCNC(object):
def __init__(self, node_id=1):
self.first_sync_done = "yes"
def load(self):... | Tendrl/commons | tendrl/commons/tests/objects/cluster/atoms/check_sync_done/test_check_sync_done_init.py | Python | lgpl-2.1 | 1,020 |
## 3. Exercise: Dynamic Arrays ##
# Retrieving an item in an array by index
retrieval_by_index = "constant"
# Searching for a value in an unordered array
search = "linear"
# Deleting an item from an array, and filling the gap
# by shifting all later items back by one
deletion = "linear"
# Inserting an item into... | vipmunot/Data-Analysis-using-Python | Data Structures & Algorithms/Data Structures-94.py | Python | mit | 2,263 |
# Copyright 2009-2015 MongoDB, 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 writin... | pdxwebdev/yadapy | yada/lib/python2.7/site-packages/bson/__init__.py | Python | gpl-3.0 | 33,784 |
#!/usr/bin/env python
import unittest
from Geometry import Line
from libavg import Point2D
def floatEqual (a,b):
print a,b
return abs(a-b) < 1e-6
class TestLine(unittest.TestCase):
def setUp(self):
pass
def test_getLength(self):
a = Line(Point2D(1,2),Point2D(4,2))
self.asse... | libavg/mtc-sponc | sponc/test.py | Python | gpl-3.0 | 1,188 |
##############################################################################
#
# Copyright (C) 2018 Visiotech All Rights Reserved
# $Anthonny Contreras Vargas <acontreras@visiotechsecurity.com>$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero... | Comunitea/CMNT_004_15 | project-addons/crm_claim_update_line/models/__init__.py | Python | agpl-3.0 | 996 |
import announcements, users, corporate, api, volunteer, teams, innovation
def configure_routes(app):
app.add_url_rule('/', 'landing', view_func=users.views.landing, methods=['GET'])
# Signing Up/Registration
app.add_url_rule('/register', 'sign-up', view_func=users.views.sign_up, methods=['GET', 'POST'])
... | rohitdatta/pepper | pepper/routes.py | Python | agpl-3.0 | 7,316 |
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
# file: ara.py
import re
from collections import OrderedDict
from romanize.romanizer import romanizer
has_capitals = False
data = OrderedDict()
# http://en.wikipedia.org/wiki/Abjad_numerals
r = romanizer(data)
def preprocess(string):
"""
Preprocess string to... | markomanninen/abnum | romanize/ara.py | Python | mit | 757 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('location', '0005_auto_20170303_1625'),
]
operations = [
migrations.RemoveField(
... | PARINetwork/pari | location/migrations/0006_auto_20170303_1716.py | Python | bsd-3-clause | 1,196 |
#!/usr/bin/env python
# -*- mode: python; indent-tabs-mode: nil; -*- coding: iso-8859-1 -*-
"""
HTMLChunker.py
Copyright 2009 by Marcello Perathoner
Distributable under the GNU General Public License Version 3 or newer.
Splits a HTML file into chunks.
"""
from __future__ import with_statement
import urlparse
i... | gitenberg-dev/pg-epubmaker | epubmaker/HTMLChunker.py | Python | gpl-3.0 | 9,047 |
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe import _, msgprint
def execute(filters=None):
if not filters: filters = {}
columns = get_columns(filters)
data = get_entries(filters)
return columns, data
def get_c... | frappe/erpnext | erpnext/selling/report/sales_partner_commission_summary/sales_partner_commission_summary.py | Python | gpl-3.0 | 2,567 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apach... | plumgrid/plumgrid-nova | nova/tests/virt/xenapi/test_agent.py | Python | apache-2.0 | 1,978 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Deployment file to facilitate releases of pymatgen.
Note that this file is meant to be run from the root directory of the pymatgen
repo.
"""
__author__ = "Shyue Ping Ong"
__email__ = "ongsp@ucsd.edu"
__dat... | Bismarrck/pymatgen | fabfile.py | Python | mit | 5,048 |
#!/usr/bin/env python3
#python
import time
from os import mkdir, listdir
from os.path import isdir, isfile
from itertools import chain
from pickle import load
from random import choice
#external
import numpy as np
from scipy.optimize import least_squares, minimize, approx_fprime
from scipy.signal import hilbert
from ... | Bhare8972/LOFAR-LIM | LIM_scripts/stationTimings/autoCorrelator3_stochastic_fitter_MC_error.py | Python | mit | 35,828 |
from plotly.graph_objs import Waterfall
| plotly/python-api | packages/python/plotly/plotly/graph_objs/layout/template/data/_waterfall.py | Python | mit | 40 |
__author__ = 'sashgorokhov'
__email__ = 'sashgorokhov@gmail.com' | sashgorokhov/VK-P-P-Music-Project | modules/forms/mainform/components/navmenu/components/__init__.py | Python | mit | 64 |
# 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... | gunan/tensorflow | tensorflow/compiler/tests/ensure_shape_op_test.py | Python | apache-2.0 | 1,973 |
#!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# 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 us... | EmanueleCannizzaro/scons | test/scons-time/help/options.py | Python | mit | 2,071 |
import sys
fam = sys.argv[1]
for l in open(fam):
toks = l.rstrip().replace(" ", "\t").split("\t")
if toks[1].find("Spain")>-1:
ref = "CEU"
else:
ref = "YRI"
sys.stdout.write("\t".join([toks[0],toks[1],
toks[0]+"Henn", "Henn2012", ref]))
sys.stdout.wr... | tiagoantao/mega-analysis | meta/doHenn.py | Python | agpl-3.0 | 330 |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo.tests
from odoo.addons.base.tests.common import HttpCaseWithUserDemo
@odoo.tests.common.tagged('post_install', '-at_install')
class TestUiFeedback(HttpCaseWithUserDemo):
def setUp(self):
super(TestUiFeedback, self).s... | jeremiahyan/odoo | addons/survey/tests/test_survey_ui_feedback.py | Python | gpl-3.0 | 7,524 |
# -*- coding: utf-8 -*-
# Scrapy settings for lagou project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest/t... | zymtech/Scrapiders | lagou/lagou/settings.py | Python | mit | 6,258 |
class LessException(Exception):
pass
| andreyfedoseev/django-less | less/__init__.py | Python | mit | 43 |
# This file is part of Merlin.
# Merlin is the Copyright (C)2008,2009,2010 of Robin K. Hansen, Elliot Rosemarine, Andreas Jacobsen.
# Individual portions may be copyright by individual contributors, and
# are included in this collective work with permission of the copyright
# owners.
# This program is free software; ... | ellonweb/merlin | Hooks/scans/request.py | Python | gpl-2.0 | 7,634 |
#!/home/paulk/software/bin/python
from __future__ import division
from sys import argv,exit,stderr
from random import choice
try:
f = open(argv[1])
g = open(argv[2],'w')
except IndexError:
print >> stderr,"Usage: %s <report_in> <ps_list_out>" % argv[0]
exit(1)
exon2ps = dict()
for row in f:
ps_exon = row.strip()... | polarise/RP-python | remove_duplicate_probesets2.py | Python | gpl-2.0 | 590 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: peer/proposal_response.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import refle... | rameshbabu79/fabric | bddtests/peer/proposal_response_pb2.py | Python | apache-2.0 | 9,608 |
from django.db.models import Model, CharField
class Revision(Model):
"""Represents a code revision."""
class Meta:
app_label = 'core'
db_table = 'norc_revision'
info = CharField(max_length=64, unique=True)
@staticmethod
def create(info):
return Revision.objec... | darrellsilver/norc | core/models/extras.py | Python | bsd-3-clause | 417 |
#!/usr/bin/env python
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | tux-mind/platform_external_subversion | build/strip-po-charset.py | Python | apache-2.0 | 1,303 |
# reference: https://norvig.com/spell-correct.html
import re
from collections import Counter
from . import SpellCorrector
from .editor import compute_set_edits1, compute_set_edits2
class NorvigSpellCorrector(SpellCorrector):
""" Spell corrector described by Peter Norvig in his blog. (https://norvig.com/spell-c... | stephenhky/PyShortTextCategorization | shorttext/spell/norvig.py | Python | mit | 2,030 |
from django.conf.urls.defaults import *
from django.views.generic import DetailView, ListView
# Urls go here!
urlpatterns = patterns('stats.views',
(r'^','display'),
) | blampe/M2M | m2m/stats/urls.py | Python | mit | 190 |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... | dturner-tw/pants | tests/python/pants_test/backend/jvm/tasks/test_bundle_create.py | Python | apache-2.0 | 7,312 |
#
# 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
# ... | rh-s/heat | heat/tests/test_glance_image.py | Python | apache-2.0 | 7,257 |
#!/usr/bin/env python
import base_filters
COPY_GOOGLE_DOC_KEY = '1DTJ2VOeM5alA-dVpWyXOfilg74d1Lb0mZLoWYVwkiRc'
USE_ASSETS = False
# Use these variables to override the default cache timeouts for this graphic
# DEFAULT_MAX_AGE = 20
# ASSETS_MAX_AGE = 300
JINJA_FILTER_FUNCTIONS = base_filters.FILTERS
| onyxfish/dailygraphics | graphic_templates/stacked_bar_chart/graphic_config.py | Python | mit | 305 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import OrderedDict
import gym
from ray.rllib.models.misc import linear, normc_initializer
from ray.rllib.models.preprocessors import get_preprocessor
from ray.rllib.utils.annotations import P... | atumanov/ray | python/ray/rllib/models/model.py | Python | apache-2.0 | 10,512 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Setup file for flintstone.
This file was generated with PyScaffold 2.4.4, a tool that easily
puts up a scaffold for your new Python project. Learn more under:
http://pyscaffold.readthedocs.org/
"""
import sys
from setuptools import setup
def setup_pa... | mahrz/flintstone | setup.py | Python | bsd-3-clause | 653 |
import os, binascii
from dateutil import parser as dateparser
from bottle import run, get, post, delete, install, HTTPError, request
from bottle_sqlite import SQLitePlugin
from dbsetup import init_db
from google_auth import gauth
from app_conf import DBNAME, DEBUG
from app_gcm import send_notification
init_db(DBNAME)
... | vanita5/TwittnukerGCMServer | app.py | Python | gpl-3.0 | 6,900 |
# Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | danakj/chromium | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py | Python | bsd-3-clause | 22,497 |
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | pmisik/buildbot | master/buildbot/test/unit/test_locks.py | Python | gpl-2.0 | 27,588 |
# -*- coding: utf-8 -*-
'''
Connection module for Amazon Data Pipeline
.. versionadded:: 2016.3.0
:depends: boto3
'''
from __future__ import absolute_import
import logging
from salt._compat import string_types
log = logging.getLogger(__name__)
try:
import boto3
import botocore.exceptions
boto3.set_str... | stephane-martin/salt-debian-packaging | salt-2016.3.3/salt/modules/boto_datapipeline.py | Python | apache-2.0 | 7,208 |
# -*- coding: utf-8 -*-
"""
Created on Mon May 16 17:14:41 2016
@author: sdemyanov
"""
import numpy as np
from sklearn import metrics
def get_prob_acc(probs, labels):
return np.mean(np.argmax(probs, axis=1) == labels)
def get_auc_score(scores, labels):
fpr, tpr, thresholds = metrics.roc_curve(labels, scores, p... | sdemyanov/tensorflow-worklab | classes/stats.py | Python | apache-2.0 | 3,985 |
import frappe
from frappe.model.rename_doc import rename_doc
def execute():
if frappe.db.table_exists("Workflow Action") and not frappe.db.table_exists("Workflow Action Master"):
rename_doc('DocType', 'Workflow Action', 'Workflow Action Master')
frappe.reload_doc('workflow', 'doctype', 'workflow_action_master')
| ESS-LLP/frappe | frappe/patches/v11_0/rename_workflow_action_to_workflow_action_master.py | Python | mit | 320 |
#!/usr/bin/env python
import argparse
import collections
import ConfigParser
import gdata.auth
import gdata.spreadsheet
import gdata.spreadsheet.service
import logging
import os
import re
import time
import xml.sax.saxutils
"""
Module for interacting with Google Docs spreadsheets. This has an
intuitive object-orient... | johnhanjukim/gdata_array | gdata_array.py | Python | apache-2.0 | 29,127 |
#!/usr/bin/env python
"""Generate a suitable set of data for the Lab 03 assignment.
"""
import numpy as np
import sys
NUM_LINES = 50
NUM_FEATURES = 3
#print "%d" % NUM_FEATURES
for idx in range(1, NUM_LINES+1):
features = np.random.normal(0.0, 5.0, (NUM_FEATURES,))
for f in features:
prec = np.random.r... | DerekHarter/tamuc-csci515 | assignments/lab03/lab-03-gen-data.py | Python | gpl-2.0 | 507 |
#!/usr/bin/python
# Copyright 2013 Google Inc.
# 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': ['deprecated']... | resmo/ansible | lib/ansible/modules/cloud/google/_gce.py | Python | gpl-3.0 | 27,709 |
# Copyright 2017 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 agreed to in writi... | openstack/manila-ui | manila_ui/dashboards/admin/shares/panel.py | Python | apache-2.0 | 881 |
# import the Flask class from the flask module
from flask import Flask, render_template,session, redirect, url_for, request
import smtplib, imaplib, os, sys, time
from gevent import monkey
from socketio.server import SocketIOServer
from socketio import socketio_manage
from socketio.namespace import BaseNamespace
from s... | abdesslem/flask-chat | app.py | Python | gpl-2.0 | 2,827 |
def make_colorscale_from_colors(colors):
if len(colors) == 1:
colors *= 2
return tuple((i / (len(colors) - 1), color) for i, color in enumerate(colors))
| KwatME/plot | plot/make_colorscale_from_colors.py | Python | mit | 172 |
# Copyright (C) 2011 Governo do Estado do Rio Grande do Sul
#
# Author: Lincoln de Sousa <lincoln@gg.rs.gov.br>
# Author: Rodrigo Sebastiao da Rosa <rodrigo-rosa@procergs.rs.gov.br>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Licens... | gabinetedigital/gd | gd/audience/__init__.py | Python | agpl-3.0 | 7,943 |
from collections import namedtuple
import itertools
import networkx as nx
import numpy as np
from pgmpy.factors import factor_product
from pgmpy.inference import Inference
from pgmpy.models import BayesianModel, MarkovChain, MarkovModel
from pgmpy.utils.mathext import sample_discrete
from pgmpy.extern.six.moves impor... | khalibartan/pgmpy | pgmpy/sampling/Sampling.py | Python | mit | 17,725 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import __future__
import sys
print("===" * 30)
print("SAMPLE INPUT:")
print("===" * 30)
print(open("./challenge_sample_input", 'r').read())
sys.stdin = open("./challenge_sample_input", 'r')
print("===" * 30)
print("SAMPLE OUTPUT:")
print("===" * 30)
print(open("./challenge_... | shollingsworth/HackerRank | python/py-check-strict-superset/main.py | Python | apache-2.0 | 582 |
'''
ÔÚһЩƽ̨ÉÏ, time Ä£¿é°üº¬ÁË strptime º¯Êý, ËüµÄ×÷ÓÃÓë strftime Ïà·´.
¸ø¶¨Ò»¸ö×Ö·û´®ºÍģʽ, Ëü·µ»ØÏàÓ¦µÄʱ¼ä¶ÔÏó, Èç ÏÂÀý Ëùʾ.
'''
import time
# make sure we have a strptime function!
# È·ÈÏÓк¯Êý strptime
try:
strptime = time.strptime
except AttributeError:
from strptime import strptime
print strp... | iamweilee/pylearn | time-example-3.py | Python | mit | 547 |
#!/usr/bin/python
#coding:utf-8
import datetime,re,time
import requests
import MySQLdb
def sendMail(to):
url = "http://sendcloud.sohu.com/webapi/mail.send_template.json"
params = {
"api_user": "ciprun",
"api_key": "kcG3cQAGM0dclty7",
"to": to,
"from": "mail@gbicom.cn",
"f... | ningmo/pynote | sohuMail/sohu.py | Python | agpl-3.0 | 2,248 |
from typing import *
from gi.repository import Gtk
import humanize
from apartcore import ApartCore
def key_and_val(key: str, val: str, visible=False) -> Gtk.Box:
box = Gtk.Box(visible=visible)
key_label = Gtk.Label(key, visible=visible)
key_label.get_style_context().add_class('info-key')
key_label.get... | alexheretic/apart-gtk | src/partinfo.py | Python | gpl-3.0 | 2,930 |
''' Collecting all the anl,f24,f48,...,f168 ctl files and put into
seperate file lists as text files. So that using the output text files
we can create xml file by passing that as input file to cdscan cmd.
'''
import os
datadir = '/NCMRWF/ncmrwf-data-2010'
os.chdir(datadir)
fanl = open('all_anl_ctl_list.txt... | arulalant/mmDiagnosis | diagnosis1/extra/gribfiles/make_all_ctl_files_list.py | Python | gpl-3.0 | 2,002 |
from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchemy import String
from sqlalchemy.ext.hybrid import hybrid_property
from flaskwallet import Base
from flaskwallet import cipher
class Setting(Base):
__tablename__ = 'settings'
# I'm really not sure why the imports create circular import... | nkuttler/flaskwallet | settingsapp/models.py | Python | bsd-3-clause | 974 |
from SimpleCV import Image
import time
# Get the template and image
goBoard = Image('go.png')
black = Image('go-black.png')
black.show()
time.sleep(3)
goBoard.show()
time.sleep(3)
# Find the matches and draw them
matches = goBoard.findTemplate(black)
matches.draw()
# Show the board with matches print the number
goB... | vizcacha/practicalcv | chapter_10/find-black-pieces.py | Python | mit | 426 |
from __future__ import absolute_import
import responses
import six
from six.moves.urllib.parse import parse_qs, urlencode, urlparse
from mock import patch, Mock
from sentry.integrations.gitlab import GitlabIntegrationProvider
from sentry.models import (
Identity,
IdentityProvider,
IdentityStatus,
Int... | mvaled/sentry | tests/sentry/integrations/gitlab/test_integration.py | Python | bsd-3-clause | 6,808 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Item',
fields=[
('id', models.AutoField(verbose... | PeterHo/mysite | lists/migrations/0001_initial.py | Python | apache-2.0 | 420 |
# Copyright 2017 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... | chemelnucfin/tensorflow | tensorflow/python/tpu/device_assignment.py | Python | apache-2.0 | 16,389 |
#!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
import os
OUT_CPP="src/qt/monetaryunitstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' forma... | bankonme/MUE-Src | share/qt/extract_strings_qt.py | Python | mit | 1,915 |
from cbagent.collectors.libstats.psstats import PSStats
from cbagent.collectors import Collector
class PS(Collector):
COLLECTOR = "atop" # Legacy
KNOWN_PROCESSES = ("beam.smp", "memcached", "indexer", "projector",
"cbq-engine", "sync_gateway")
def __init__(self, settings):
... | mikewied/cbagent | cbagent/collectors/ps.py | Python | apache-2.0 | 1,261 |
# -*- coding: utf-8 -*-
# Copyright (C) 2019 - 2020 by Pedro Mendes, Rector and Visitors of the
# University of Virginia, University of Heidelberg, and University
# of Connecticut School of Medicine.
# All rights reserved.
# Copyright (C) 2017 - 2018 by Pedro Mendes, Virginia Tech Intellectual
# Properties, Inc.,... | copasi/COPASI | copasi/bindings/python/unittests/Test_CReport.py | Python | artistic-2.0 | 3,011 |
import os
import glob
import unittest
def create_test_suite():
# Get the relative directory path to this subdirectory
rel_path = os.path.dirname(os.path.relpath(__file__))
test_files = glob.glob('%s/test_*.py' % rel_path)
module_strings = [module.replace('/', '.')[:len(module) - 3] for module in tes... | cboling/xos | xos/synchronizers/base/test/all_tests.py | Python | apache-2.0 | 504 |
"""
hashdd/algorithms/hashdd_sdhash.py
@brad_anton
_sdbf_class.so is from compiling the official SDHash
release. If you're getting errors using this module,
you may need to compile it yourself. To do so, instructions
can be found here:
https://gist.github.com/brad-anton/a5a12eff6b5675c47da07aaffa727985
License:... | hashdd/pyhashdd | hashdd/algorithms/hashdd_sdhash.py | Python | apache-2.0 | 2,858 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-26 14:49
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('work_hours_packages', '0001_initial'),
]
operations = [
migrations.RenameField(
... | diegojromerolopez/djanban | src/djanban/apps/work_hours_packages/migrations/0002_auto_20170526_1649.py | Python | mit | 453 |
from base64 import b64decode
from django.db.models import Q
from rest_framework import permissions
from rest_framework import status
from rest_framework import viewsets
from rest_framework.authtoken.models import Token
from rest_framework.decorators import detail_route, list_route
from rest_framework.generics import C... | mistakes-consortium/igng | images/api.py | Python | bsd-3-clause | 6,537 |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | ueshin/apache-spark | python/pyspark/ml/classification.py | Python | apache-2.0 | 127,289 |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2013 TopCoder Inc., All Rights Reserved.
This is module that represents all the custom filters.
@author: TCSASSEMBLER
@version: 1.0
"""
from django.template.base import Library
register = Library()
@register.filter
def get_attr (obj, args):
""" Try to get an attribute ... | NASA-Tournament-Lab/CoECI-CMS-Healthcare-Fraud-Prevention | study/hfppnetwork/hfppnetwork/sms/templatetags/custom_filters.py | Python | apache-2.0 | 966 |
from __future__ import unicode_literals
import datetime
import uuid
from copy import deepcopy
from django.core.exceptions import FieldError
from django.db import DatabaseError, connection, models, transaction
from django.db.models import TimeField, UUIDField
from django.db.models.aggregates import (
Avg, Count, M... | tbeadle/django | tests/expressions/tests.py | Python | bsd-3-clause | 39,595 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# 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 b... | youkochan/shadowsocks-analysis | shadowsocks/manager.py | Python | apache-2.0 | 12,796 |
# -*- coding: utf-8 -*-
# Scrapy settings for Sneaker_Scraper project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/e... | OrOz77/Sneaker_Scraper_Bot | Bot/Sneaker_Scraper/settings.py | Python | mit | 4,413 |
import unittest
from biothings_explorer.id_resolver import IDResolver
class TestIDResolver(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.idr = IDResolver()
def test_genes_as_input(self):
inputs = [(["CXCR4", "CXCR3", "CXCR2"], "SYMBOL", "Gene")]
res = self.idr.resolve_... | biothings/biothings_explorer | tests/test_id_resolver.py | Python | apache-2.0 | 1,247 |
import unittest
from auto_tagify2 import AutoTagify
class AutoTagifyTestCase(unittest.TestCase):
def testTextNotEmptyStrict(self):
"""Verify strict text returns content, if text is provided and
not null.
"""
a = AutoTagify()
a.text = 'This is a test'
a.css = 'taggab... | ednapiranha/auto-tagify | auto_tagify2/auto_tagify2tests.py | Python | bsd-3-clause | 1,403 |
#SBaaS
from .stage02_physiology_simulatedData_io import stage02_physiology_simulatedData_io
from .stage02_physiology_simulation_query import stage02_physiology_simulation_query
from .stage02_physiology_measuredData_query import stage02_physiology_measuredData_query
from SBaaS_models.models_COBRA_dependencies import mod... | dmccloskey/SBaaS_COBRA | SBaaS_COBRA/stage02_physiology_simulatedData_execute.py | Python | mit | 19,105 |
"""Tests for the AVM Fritz!Box integration."""
from __future__ import annotations
from unittest.mock import Mock, call, patch
from pyfritzhome import LoginError
from requests.exceptions import ConnectionError, HTTPError
from homeassistant.components.fritzbox.const import DOMAIN as FB_DOMAIN
from homeassistant.compon... | jawilson/home-assistant | tests/components/fritzbox/test_init.py | Python | apache-2.0 | 6,804 |
#! /usr/bin/env python
## Support for byteswapping audio streams (needed for AIFF format).
_typecode = {2:'h'}
def _init_typecode():
import array
for t in ('i', 'l'):
a = array.array(t)
if a.itemsize==4:
_typecode[4] = t
return
import sys
print "Can't find array typecode ... | alextingle/autoclapper | autoclapper.py | Python | agpl-3.0 | 7,762 |
import crm_lead
| pepetreshere/odoo-trescloud-tools | trescloud_opportunity_related_meeting/__init__.py | Python | gpl-2.0 | 16 |
import cherrypy
# 這是 CDAG14 類別的定義
class CDAG14(object):
# 各組利用 index 引導隨後的程式執行
@cherrypy.expose
def index(self, *args, **kwargs):
outstring = '''
這是 2014CDA 協同專案下的 cdag14 分組程式開發網頁, 以下為 W12 的任務執行內容.<br />
<!-- 這裡採用相對連結, 而非網址的絕對連結 (這一段為 html 註解) -->
<a href="cube1">cdag14 正方體參數繪圖</a>(尺寸變數 a, b, c)<br... | HatsuneMiku0309/2014cdag10 | wsgi/programs/cdag14/__init__.py | Python | gpl-2.0 | 39,741 |
########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | cloudify-cosmo/cloudify-dsl-parser | dsl_parser/elements/workflows.py | Python | apache-2.0 | 2,717 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.