text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
#!/usr/bin/env python
# Small wrapper script for weeder2, which needs the FreqFiles directory
# where it is executed. This script allows running weeder2 from anywhere.
import os
import sys
import argparse
import subprocess as sp
# Weeder install dir
weeder_dir = os.path.realpath(os.path.join(os.path.dirname(__file__),... | roryk/recipes | recipes/weeder/weeder2.py | Python | mit | 833 | 0.0012 |
# Copyright 2017 Cloudbase Solutions Srl
#
# 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 l... | ader1990/cloudbase-init | cloudbaseinit/metadata/services/azureservice.py | Python | apache-2.0 | 18,702 | 0 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 Citrix Systems, 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/L... | KarimAllah/nova | nova/tests/test_xenapi.py | Python | apache-2.0 | 69,840 | 0.00126 |
# Copyright (C) 2014 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
import os
import json
import platform
from collections import defaultdict
from anaconda_go.lib import go
from anaconda_go.lib.plugin import typing
cachepath = {
'linux': os.path.join('~... | DamnWidget/anaconda_go | lib/cache.py | Python | gpl-3.0 | 2,829 | 0.000707 |
# ubuntuone.syncdaemon.hash_queue - hash queues
#
# Authors: Facundo Batista <facundo@canonical.com>
# Guillermo Gonzalez <guillermo.gonzalez@canonical.com>
# Alejandro J. Cura <alecu@canonical.com>
#
# Copyright 2009-2011 Canonical Ltd.
#
# This program is free software: you can redistribute it and/o... | Alberto-Beralix/Beralix | i386-squashfs-root/usr/share/pyshared/ubuntuone-client/ubuntuone/syncdaemon/hash_queue.py | Python | gpl-3.0 | 9,720 | 0.000412 |
''' Provide functions to embed Bokeh models (e.g., plots, widget, layouts)
in various different ways.
There are a number of different combinations of options when embedding
Bokeh plots. The data for the plot can be contained in the document,
or on a Bokeh server, or in a sidecar JavaScript file. Likewise, BokehJS
may ... | gpfreitas/bokeh | bokeh/embed.py | Python | bsd-3-clause | 20,330 | 0.005804 |
# -*- coding: utf-8 -*-
from test_settings import Settings
class TestCase(Settings):
def test_sidebar(self):
# Ayarlari yapiyor.
self.do_settings()
# Genel'e tikliyor.
self.driver.find_element_by_css_selector(
'li.ng-binding:nth-child(3) > a:nth-child(1) > span:nth-chil... | zetaops/ulakbus | selenium_tests/test_ogrenci_iletisim_bilgileri.py | Python | gpl-3.0 | 1,614 | 0.006196 |
from __future__ import unicode_literals
import json
from datetime import timedelta
from django.core.urlresolvers import reverse
from django.utils import timezone
from mock import patch
from temba.contacts.models import ContactField
from temba.flows.models import RuleSet
from temba.orgs.models import Language
from tem... | reyrodrigues/EU-SMS | temba/values/tests.py | Python | agpl-3.0 | 20,151 | 0.00263 |
# written in python 3.6.1
#-*- coding: utf-8 -*-
from urllib.request import urlopen
import json
import string
import re
from bs4 import BeautifulSoup
import logging
import time
FILE_PATH = "./boxofficemojo.com/movie_data.txt"
LOG_PATH = "./boxofficemojo.com/scraping.log"
logging.basicConfig(filename=LOG_PATH,level=... | softinus/Movie_DataMiner | boxofficemojo.com/BoxOfficeMojo_Scraping_Code.py | Python | apache-2.0 | 13,739 | 0.011427 |
import booby
from booby import fields
from booby.inspection import get_fields, is_model
from booby.validators import Required
from pydoc import locate
from collections import OrderedDict
from collections import OrderedDict
from tabulate import tabulate
import readline
MODEL_MAP = {}
class tabCompleter(object):
... | makkus/pyclist | pyclist/model_helpers.py | Python | apache-2.0 | 8,972 | 0.000892 |
import urllib2, json, time, sys
from datetime import date, datetime
from dateutil.rrule import rrule, DAILY
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-f", dest="fahrenheit", action="store", default=False, type="string", help="Convert to FAHRENHEIT")
parser.add_option("-e", dest="end"... | heatseeknyc/data-science | src/wunderground.py | Python | mit | 2,014 | 0.036743 |
import logging
def init_logger():
formatter = logging.Formatter('%(asctime)s %(levelname)s: %(message)s [in %(pathname)s:%(lineno)d]')
logger = logging.getLogger('redberry')
logger.setLevel(logging.DEBUG)
console = logging.StreamHandler()
console.setFormatter(formatter)
logger.addHandler(co... | michaelcho/redberry | redberry/utils/logger.py | Python | apache-2.0 | 327 | 0.003058 |
from __future__ import absolute_import, unicode_literals
import pytest
from case import Mock, patch
from vine import promise
from amqp.abstract_channel import AbstractChannel
from amqp.exceptions import AMQPNotImplementedError, RecoverableConnectionError
from amqp.serialization import dumps
class test_AbstractChann... | pexip/os-python-amqp | t/unit/test_abstract_channel.py | Python | lgpl-2.1 | 4,759 | 0 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2018-01-24 07:34
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('appauth', '0016_userprofile_numq'),
]
operations = [
migrations.AddField(
... | PrefPy/opra | compsocsite/appauth/migrations/0017_userprofile_exp_data.py | Python | mit | 453 | 0 |
#!/usr/bin/python
# vim: set expandtab tabstop=4 shiftwidth=4:
# -*- coding: utf-8 -*-
# gen_cacert <http://rhizomatik.net/>
# Python functions for generate a X509 CA certificate
#
# Copyright (C) 2010 duy at rhizomatik dot net
#
# This program is free software; you can redistribute it and/or modify
# it under the te... | duy/python-foafcert | foafcert/gen_cacert.py | Python | gpl-2.0 | 4,578 | 0.008301 |
import six
from unittest import TestCase
from dark.reads import Read, Reads
from dark.score import HigherIsBetterScore
from dark.hsp import HSP, LSP
from dark.alignments import (
Alignment, bestAlignment, ReadAlignments, ReadsAlignmentsParams,
ReadsAlignments)
class TestAlignment(TestCase):
"""
Tests... | bamueh/dark-matter | test/test_alignments.py | Python | mit | 7,278 | 0 |
import cv2
import logging
import numpy as np
import os
import sys
from lib.warping import ImageBlobWarping
from lib.singleton import Singleton
from logging import FileHandler, StreamHandler
from multiprocessing import Pool
from ocr import Ocr
from timeit import default_timer as timer
from vlogging import VisualRecord
... | MirichST/patchcap | src/daemon/platedetector.py | Python | gpl-2.0 | 11,192 | 0.028145 |
__all__ = ["wordlists", "roles", "bnc", "processes", "verbs",
"uktous", "tagtoclass", "queries", "mergetags"]
from corpkit.dictionaries.bnc import _get_bnc
from corpkit.dictionaries.process_types import processes
from corpkit.dictionaries.process_types import verbs
from corpkit.dictionaries.roles import ro... | interrogator/corpkit | corpkit/dictionaries/__init__.py | Python | mit | 774 | 0.002584 |
from django.contrib import admin
from simulation.models import SimulationStage, SimulationStageMatch, SimulationStageMatchResult
class SimulationStageAdmin(admin.ModelAdmin):
list_display = ["number", "created_at"]
list_filter = ["created_at"]
class SimulationStageMatchAdmin(admin.ModelAdmin):
list_disp... | bilbeyt/ituro | ituro/simulation/admin.py | Python | mit | 972 | 0.007202 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import scipy as sp
#Nome do arquivo em que está os dados da posição
arq = 'CurvaGiro/pos.dat'
#Limites dos eixos
v = [-10,1000, 0, 1000]
#Título eixo x
xl = r'y metros'
#Título do eixo y
yl = r'x metros'
x = sp.genfromtxt('CurvaGiro/pos.dat... | asoliveira/NumShip | scripts/entrada/padrao/plot-1cg.py | Python | gpl-3.0 | 489 | 0.02686 |
#!/usr/bin/env python3
import os
import re
import itertools
from functools import reduce
from .version import __version__
sep_regex = re.compile(r'[ \-_~!@#%$^&*\(\)\[\]\{\}/\:;"|,./?`]')
def get_portable_filename(filename):
path, _ = os.path.split(__file__)
filename = os.path.join(path, filename)
retur... | elektito/finglish | finglish/f2p.py | Python | mit | 6,952 | 0.002158 |
"""The IPython kernel implementation"""
import getpass
import sys
import traceback
from IPython.core import release
from IPython.html.widgets import Widget
from IPython.utils.py3compat import builtin_mod, PY3
from IPython.utils.tokenutil import token_at_cursor, line_at_cursor
from IPython.utils.traitlets import Insta... | mattvonrocketstein/smash | smashlib/ipy3x/kernel/zmq/ipkernel.py | Python | mit | 13,151 | 0.000912 |
# -*- coding: utf-8 -*-
#
# phys_pkg.py
#
# Copyright (C) 2013 Steve Canny scanny@cisco.com
#
# This module is part of opc-diag and is released under the MIT License:
# http://www.opensource.org/licenses/mit-license.php
"""Interface to a physical OPC package, either a zip archive or directory"""
import os
import shut... | pombredanne/opc-diag | opcdiag/phys_pkg.py | Python | mit | 5,859 | 0 |
try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
from ckanext.geonetwork.harvesters.geonetwork import GeoNetworkHarvester
from ckanext.geonetwork.harvesters.utils import GeoNetworkClient
| geosolutions-it/ckanext-geonetwork | ckanext/geonetwork/harvesters/__init__.py | Python | gpl-3.0 | 309 | 0 |
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | google/in-silico-labeling | isl/augment_test.py | Python | apache-2.0 | 2,507 | 0.002792 |
import pytest
from webdriverwrapper.exceptions import InfoMessagesException
def test_check_info_messages(driver_info_msgs):
with pytest.raises(InfoMessagesException) as excinfo:
driver_info_msgs.check_infos(expected_info_messages=('some-info',))
def test_check_expected_info_messages(driver_info_msgs):
... | horejsek/python-webdriverwrapper | tests/test_info.py | Python | mit | 735 | 0.004082 |
from yowsup.structs import ProtocolEntity, ProtocolTreeNode
from .iq import IqProtocolEntity
class PingIqProtocolEntity(IqProtocolEntity):
'''
Receive
<iq type="get" xmlns="urn:xmpp:ping" from="s.whatsapp.net" id="1416174955-ping">
</iq>
Send
<iq type="get" xmlns="w:p" to="s.whatsapp.net" id="1... | felix-dumit/campusbot | yowsup2/yowsup/layers/protocol_iq/protocolentities/iq_ping.py | Python | mit | 555 | 0.030631 |
#!/usr/bin/env python3
import math, logging, threading, concurrent.futures
import numpy
import simplespectral
from soapypower import threadpool
logger = logging.getLogger(__name__)
class PSD:
"""Compute averaged power spectral density using Welch's method"""
def __init__(self, bins, sample_rate, fft_windo... | xmikos/soapy_power | soapypower/psd.py | Python | mit | 4,040 | 0.001733 |
import os
import pandas as pd
from igf_data.utils.seqrunutils import get_seqrun_date_from_igf_id
def _count_total_reads(data,seqrun_list):
'''
An internal function for counting total reads
required params:
:param data, A dictionary containing seqrun ids a key an read counts as values
:param seqrun_list, ... | imperial-genomics-facility/data-management-python | igf_data/utils/project_data_display_utils.py | Python | apache-2.0 | 8,493 | 0.01672 |
"""
Classes for using robotic or other hardware using Topographica.
This module contains several classes for constructing robotics
interfaces to Topographica simulations. It includes modules that read
input from or send output to robot devices, and a (quasi) real-time
simulation object that attempts to maintain a cor... | ioam/topographica | topo/hardware/robotics.py | Python | bsd-3-clause | 4,844 | 0.010735 |
#!/usr/bin/env python
'''
A/V control for System76 laptop using Unity
'''
import os
from execute import returncode
# check for the existence of /dev/video0 which is used currently for webcam
webcam = lambda: os.path.exists('/dev/video0') == False
def webcam_toggle():
if webcam():
returncode('sudo /sbin/m... | mgmtech/sys76_unity_webmic | unity_avindicator/webmic.py | Python | gpl-3.0 | 751 | 0.011984 |
"""
PHP date() style date formatting
See http://www.php.net/date for format strings
Usage:
>>> import datetime
>>> d = datetime.datetime.now()
>>> df = DateFormat(d)
>>> print df.format('jS F Y H:i')
7th October 2003 11:39
>>>
"""
import re
import time
import calendar
from django.utils.dates import MONTHS, MONTHS_3, ... | ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/django-1.2/django/utils/dateformat.py | Python | bsd-3-clause | 8,796 | 0.002046 |
#!/usr/bin/env python
# Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | ctiller/grpc | tools/run_tests/artifacts/distribtest_targets.py | Python | apache-2.0 | 17,548 | 0.000399 |
# -*- test-case-name: calendarserver.tap.test.test_caldav -*-
##
# Copyright (c) 2005-2014 Apple 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.apach... | trevor/calendarserver | calendarserver/tap/util.py | Python | apache-2.0 | 38,773 | 0.00227 |
from __future__ import print_function
from .patchpipette import PatchPipette
| pbmanis/acq4 | acq4/devices/PatchPipette/__init__.py | Python | mit | 77 | 0 |
"""Models for the util app. """
import cStringIO
import gzip
import logging
from config_models.models import ConfigurationModel
from django.db import models
from django.utils.text import compress_string
from opaque_keys.edx.django.models import CreatorMixin
logger = logging.getLogger(__name__) # pylint: disable=inv... | ahmedaljazzar/edx-platform | common/djangoapps/util/models.py | Python | agpl-3.0 | 1,962 | 0.001019 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016-2018, Eric Jacob <erjac77@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | erjac77/ansible-module-f5bigip | library/f5bigip_ltm_profile_sip.py | Python | apache-2.0 | 8,676 | 0.003112 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUME... | 2ndQuadrant/ansible | lib/ansible/modules/cloud/ovirt/ovirt_auth.py | Python | gpl-3.0 | 11,230 | 0.002048 |
"""
Application entry point
"""
def main():
pass
if __name__ == "__main__":
# delegates to main_debug during construction
try:
import main_debug
main_debug.main()
except ImportError:
main()
| davidveen/nolava | src/main.py | Python | gpl-3.0 | 234 | 0.004274 |
"""
XING OAuth1 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/xing.html
"""
from social.backends.oauth import BaseOAuth1
class XingOAuth(BaseOAuth1):
"""Xing OAuth authentication backend"""
name = 'xing'
AUTHORIZATION_URL = 'https://api.xing.com/v1/authorize'
REQUEST_TOKEN_URL = 'ht... | GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/social/backends/xing.py | Python | agpl-3.0 | 1,519 | 0 |
#!/usr/bin/env python
import pytest
from pyxenon_snippets import slurm_queues_getter_with_props
def test_slurm_queues_getter_with_props():
slurm_queues_getter_with_props.run_example()
| NLeSC/Xenon-examples | readthedocs/code-tabs/python/tests/test_slurm_queues_getter_with_props.py | Python | apache-2.0 | 192 | 0.005208 |
"""
byceps.services.shop.article.dbmodels.article
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from datetime import datetime
from decimal import Decimal
from typing import Optional
from sqlalchemy.ext.hybrid import... | homeworkprod/byceps | byceps/services/shop/article/dbmodels/article.py | Python | bsd-3-clause | 3,124 | 0.00128 |
# Copyright 2017 Battelle Energy Alliance, 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 t... | idaholab/raven | framework/SupervisedLearning/ScikitLearn/LinearModel/LassoLarsCV.py | Python | apache-2.0 | 6,473 | 0.00896 |
import numpy as np
from bokeh.io import curdoc, show
from bokeh.models import ColumnDataSource, Grid, LinearAxis, Plot, Triangle
N = 9
x = np.linspace(-2, 2, N)
y = x**2
sizes = np.linspace(10, 20, N)
source = ColumnDataSource(dict(x=x, y=y, sizes=sizes))
plot = Plot(
title=None, plot_width=300, plot_height=300... | ericmjl/bokeh | examples/reference/models/Triangle.py | Python | bsd-3-clause | 749 | 0.001335 |
#!/usr/bin/env python
import pynotify
'''
No purpose here other than creating a callable library for system notifications
'''
class message:
def __init__(self, messagex):
pynotify.init('EventCall')
m = pynotify.Notification("RSEvent Notification", "%s" % messagex)
m.show()
| krazybean/message_agent_abandoned | lin/lin_notify_lib.py | Python | apache-2.0 | 282 | 0.01773 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-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.
"""Admin model views for records."""
import json
from flask import flash
from flask... | tiborsimko/invenio-records | invenio_records/admin.py | Python | mit | 2,051 | 0.000488 |
import hashlib as md5
class Palette:
def __init__(self, palette={}, colors=[]):
self.job_status_palette = {
'Received': '#D9E7F8',
'Checking': '#FAFAFA',
'Staging': '#6190CD',
'Waiting': '#004EFF',
'Matched': '#FEF7AA',
'Running': '#FDEE65',
'Stalled': '#BC5757'... | zmathe/WebAppDIRAC | WebApp/handler/Palette.py | Python | gpl-3.0 | 3,496 | 0.016304 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
orm.MonitorItem.objects.filter(pk='users_reported').delete()
def backwards(self, orm):
raise RuntimeError("C... | tanglu-org/tgl-misago | misago/migrations/0015_remove_users_reported.py | Python | gpl-3.0 | 33,856 | 0.008034 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import connection
from django.utils.translation import ugettext as _
from modoboa.lib.exceptions import InternalError
def db_table_exists(table):
"""Check if table exists."""
return table in conn... | tonioo/modoboa | modoboa/lib/db_utils.py | Python | isc | 848 | 0 |
from base import *
class Test (TestBase):
def __init__ (self):
TestBase.__init__ (self, __file__)
self.name = "Broken header entry III"
self.expected_error = 200
self.request = "GET / HTTP/1.0\r\n" +\
"Entry:value\r\n"
| lmcro/webserver | qa/014-Broken-Key3.py | Python | gpl-2.0 | 294 | 0.013605 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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) an... | mcltn/ansible | lib/ansible/inventory/__init__.py | Python | gpl-3.0 | 28,850 | 0.00357 |
"""Library for performing speech recognition with the Google Speech Recognition API."""
__author__ = 'Anthony Zhang (Uberi)'
__version__ = '1.0.4'
__license__ = 'BSD'
import io, subprocess, wave, shutil
import math, audioop, collections
import json, urllib.request
#wip: filter out clicks and other too short parts
c... | bizalu/sImulAcre | core/lib/speech_recognition/__init__.py | Python | gpl-2.0 | 10,485 | 0.010205 |
#!/usr/bin/env python3
import os
import sys
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'models/research/slim'))
import time
import datetime
import logging
from tqdm import tqdm
import numpy as np
import cv2
import simplejson as json
from sklearn.met... | aaalgo/cls | train-slim-fcn.py | Python | mit | 13,078 | 0.005811 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 2 17:52:19 2017
Author: Peiyong Jiang : jiangpeiyong@impcas.ac.cn
Function:
______________________________________________________
"""
from numpy.random import multivariate_normal as npmvn
from numpy import diag
def PartGen(emitT,numPart):
... | iABC2XYZ/abc | DM_RFGAP_3/PartGen.py | Python | gpl-3.0 | 516 | 0.05814 |
"""This *was* the parser for the current HTML format on parl.gc.ca.
But now we have XML. See parl_document.py.
This module is organized like so:
__init__.py - utility functions, simple parse interface
common.py - infrastructure used in the parsers, i.e. regexes
current.py - parser for the Hansard format used from 200... | twhyte/openparliament | parliament/imports/hans_old/current.py | Python | agpl-3.0 | 11,722 | 0.006398 |
# 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 under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIE... | kubeflow/pipelines | components/gcp/container/component_sdk/python/tests/google/bigquery/test__query.py | Python | apache-2.0 | 5,793 | 0.005351 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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) an... | wulczer/ansible | lib/ansible/inventory/ini.py | Python | gpl-3.0 | 7,628 | 0.003146 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2016 Eugene Frolov <eugene@frolov.net.ru>
#
# 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
#
# ... | phantomii/restalchemy | restalchemy/tests/functional/restapi/sa_based/microservice/db.py | Python | apache-2.0 | 1,082 | 0 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2010-2013 Elico Corp. All Rights Reserved.
# Author: Yannick Gouin <yannick.gouin@elico-corp.com>
#
# This program is free software: you c... | udayinfy/openerp-7.0 | gap_analysis_project/gap_analysis_project.py | Python | agpl-3.0 | 13,460 | 0.008915 |
#!/usr/bin/env python
"""Contains the Data Model for a cool Resource.
"""
__author__ = "Sanjay Joshi"
__copyright__ = "IBM Copyright 2017"
__credits__ = ["Sanjay Joshi"]
__license__ = "Apache 2.0"
__version__ = "1.0"
__maintainer__ = "Sanjay Joshi"
__email__ = "joshisa@us.ibm.com"
__status__ = "Prototype"
schema = {
... | joshisa/mistub | mistub/models/concepts.py | Python | apache-2.0 | 833 | 0 |
import astra
def gpu_fp(pg, vg, v):
v_id = astra.data2d.create('-vol', vg, v)
rt_id = astra.data2d.create('-sino', pg)
fp_cfg = astra.astra_dict('FP_CUDA')
fp_cfg['VolumeDataId'] = v_id
fp_cfg['ProjectionDataId'] = rt_id
fp_id = astra.algorithm.create(fp_cfg)
astra.algorithm.run(fp_id)
out = astra.data... | buzmakov/tomography_scripts | tomo/yaivan/dispersion/alg.py | Python | mit | 1,930 | 0.031088 |
# Copyright 2019 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | quantumlib/Cirq | dev_tools/import_test.py | Python | apache-2.0 | 8,158 | 0.000981 |
from flask import jsonify
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import Table, Column, Integer, ForeignKey
from src.webservice.base import Base
from src.webservice._action import Action
db = SQLAlchemy()
Base.query = db.session.query_property()
class Input(Base):
__tablename__ = 'tbl_InputPin'
... | deklungel/iRulez | src/webservice/_inputPin.py | Python | mit | 1,909 | 0.001572 |
from distutils.core import setup
setup(
name='Chroma',
version='0.2.0',
author='Seena Burns',
author_email='hello@seenaburns.com',
url='https://github.com/seenaburns/Chroma',
license=open('LICENSE.txt').read(),
description='Color handling made simple.',
long_description=open('README.rst... | seenaburns/Chroma | setup.py | Python | bsd-3-clause | 768 | 0.001302 |
"""
Python wrappers for Orthogonal Distance Regression (ODRPACK).
Classes
=======
Data -- stores the data and weights to fit against
RealData -- stores data with standard deviations and covariance matrices
Model -- stores the model and its related information
Output -- stores all of the output from an ODR run
ODR... | ygenc/onlineLDA | onlineldavb_new/build/scipy/scipy/odr/odrpack.py | Python | gpl-3.0 | 39,749 | 0.001157 |
# -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol #
# ... | CLVsol/odoo_addons | clv_medicament_template/wkf/__init__.py | Python | agpl-3.0 | 1,439 | 0.011814 |
#
# [The "BSD license"]
# Copyright (c) 2012 Terence Parr
# Copyright (c) 2012 Sam Harwell
# Copyright (c) 2014 Eric Vergnaud
# 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. Redis... | sidhart/antlr4 | runtime/Python2/src/antlr4/dfa/DFASerializer.py | Python | bsd-3-clause | 3,848 | 0.002339 |
import requests
import json
class DisqusAPI(object):
"""
Lightweight solution to make API calls to Disqus:
More info:
https://disqus.com/api/docs
"""
def __init__(self,
api_key,
api_secret,
version='3.0',
formats='json'
):
self.api_k... | shalakhin/disqus-api | disqus_api/api.py | Python | mit | 1,082 | 0.005545 |
#!/usr/bin/env python2
# Copyright (c) 2015 The Aureus Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test mulitple rpc user config option rpcauth
#
from test_framework.test_framework import AureusTestFramewo... | hideoussquid/aureus-12-bitcore | qa/rpc-tests/multi_rpc.py | Python | mit | 4,609 | 0.005424 |
# Copyright NuoBiT Solutions, S.L. (<https://www.nuobit.com>)
# Eric Antones <eantones@nuobit.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
from odoo import fields, models
class ResPartner(models.Model):
_inherit = "res.partner"
sale_journal_id = fields.Many2one(
"account.journ... | nuobit/odoo-addons | partner_default_journal/models/res_partner.py | Python | agpl-3.0 | 511 | 0.001957 |
import os
import pysam
import unittest
from TestUtils import checkFieldEqual
import copy
SAMTOOLS = "samtools"
WORKDIR = "pysam_test_work"
DATADIR = "pysam_data"
class ReadTest(unittest.TestCase):
def buildRead(self):
'''build an example read.'''
a = pysam.AlignedSegment()
a.query_name ... | nlhepler/pysam | tests/AlignedSegment_test.py | Python | mit | 17,059 | 0.000117 |
from django import views
from django.shortcuts import render, get_object_or_404
from django.views.generic import TemplateView
from django.views.generic.edit import CreateView
from .models import *
from .forms import *
import requests
import http
from django.urls import reverse_lazy
from django.views.decorators.csrf imp... | pclubuiet/website | home/views.py | Python | gpl-3.0 | 3,396 | 0.008539 |
import sys
r, c = map(int, input().split())
while r and c:
lines = [input().strip() for i in range(r)]
rotatedLines = []
for i in range(c):
rotatedLines.append("".join([lines[j][i] for j in range(r)]))
rotatedLines.sort(key=lambda s: s.lower())
for i in range(r):
print("".join([rotatedLines[j][i] for j in ran... | SirDavidLudwig/KattisSolutions | problems/sidewayssorting/sidewayssorting.py | Python | gpl-3.0 | 372 | 0.024194 |
import json
import sqlite3
def get_room(id, dbfile):
ret = None
con = sqlite3.connect(dbfile)
for row in con.execute("select json from rooms where id=?",(id,)):
jsontext = row[0]
# Outputs the JSON response
#print("json = " + jsontext)
d = json.loads(jsontext)... | mbramr/My-Zork | room.py | Python | mit | 1,035 | 0.017391 |
# Generated by Django 2.0.5 on 2018-05-10 22:56
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("studies", "0001_initial")]
operations = [migrations.AlterModelOptions(name="extension", options={"ordering": ("-id",)})]
| mozilla/normandy | normandy/studies/migrations/0002_auto_20180510_2256.py | Python | mpl-2.0 | 272 | 0.003676 |
from markupsafe import escape
import re
from pymongo.objectid import ObjectId
from pymongo.errors import InvalidId
from app.people.people_model import People
from app.board.board_model import BoardTopic, BoardNode
from beaker.cache import CacheManager
from beaker.util import parse_cache_config_options
from lib.fi... | feilaoda/FlickBoard | project/cache/files.py | Python | mit | 3,576 | 0.007271 |
# Copyright (c) 2018 PaddlePaddle 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 app... | tensor-tang/Paddle | python/paddle/fluid/tests/unittests/test_program_code.py | Python | apache-2.0 | 2,769 | 0 |
__authors__ = ""
__copyright__ = "(c) 2014, pymal"
__license__ = "BSD License"
__contact__ = "Name Of Current Guardian of this file <email@address>"
USER_AGENT = 'api-indiv-0829BA2B33942A4A5E6338FE05EFB8A1'
HOST_NAME = "http://myanimelist.net"
DEBUG = False
RETRY_NUMBER = 4
RETRY_SLEEP = 1
SHORT_SITE_FORMAT_TIME = ... | pymal-developers/pymal | pymal/consts.py | Python | bsd-3-clause | 496 | 0 |
from unittest import TestCase
import os
from opencog.atomspace import AtomSpace, TruthValue, Atom, types
from opencog.bindlink import stub_bindlink, bindlink, single_bindlink,\
first_n_bindlink, af_bindlink, \
satisfaction_link, satisfying_set, \
... | inflector/atomspace | tests/cython/bindlink/test_bindlink.py | Python | agpl-3.0 | 7,002 | 0.001285 |
#!/usr/bin/env python
# -*- coding: <encoding name> -*-
__author__ = "i_pogorelko"
__email__ = "i.pogorelko@gmail.com"
__date__ = "2014-11-16"
text='Proin eget tortor risus. Cras ultricies ligula sed magna dictum porta.\
Donec rutrum congue leo eget malesuada.'
def percentage_1(text):
print ''
print 'input:... | pybursa/homeworks | i_pogorelko/hw4_i_pogorelko/hw4_solution1.py | Python | gpl-2.0 | 804 | 0.008706 |
#parser_testing.py
import os, sys, re, StringIO
sys.path.append('/Users/Jason/Dropbox/JournalMap/scripts/GeoParsers')
#from jmap_geoparser_re import *
from jmap_geoparser import *
#def test_parsing():
test = "blah blah blah 45º 23' 12'', 123º 23' 56'' and blah blah blah 32º21'59''N, 115º 23' 14''W blah blah blah"
co... | JournalMap/GeoParsers | pyparser_geoparser_testing.py | Python | gpl-2.0 | 3,064 | 0.011624 |
import binascii
def b2h(the_bytes):
return binascii.hexlify(the_bytes).decode("utf8")
def b2h_rev(the_bytes):
return binascii.hexlify(bytearray(reversed(the_bytes))).decode("utf8")
| maraoz/proofofexistence | pycoin/serialize/__init__.py | Python | mit | 200 | 0.01 |
# -*- coding: utf-8 -*-
__author__ = 'frank'
from flask import Flask, request, url_for, render_template, g, session, flash
from flask_wtf.csrf import CsrfProtect
from flask_debugtoolbar import DebugToolbarExtension
from flask.ext.login import LoginManager
from flask.ext.moment import Moment
from . import filters, pe... | Fansion/sharefun | sharefun/__init__.py | Python | mit | 5,284 | 0.000593 |
from django.http import HttpResponse, HttpRequest
from typing import Optional
import ujson
from django.utils.translation import ugettext as _
from zerver.lib.actions import do_mute_topic, do_unmute_topic
from zerver.lib.request import has_request_variables, REQ
from zerver.lib.response import json_success, json_erro... | dhcrzf/zulip | zerver/views/muting.py | Python | apache-2.0 | 2,792 | 0.005372 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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) an... | woltage/ansible | lib/ansible/cli/__init__.py | Python | gpl-3.0 | 20,703 | 0.007149 |
# -*- coding: utf-8 -*-
import datetime
from django.conf import settings
from django.test import TestCase, override_settings
from django.utils import timezone
from django_dynamic_fixture import G
from apps.events.models import AttendanceEvent, Event
class EventOrderedByRegistrationTestCase(TestCase):
def setUp... | dotKom/onlineweb4 | apps/events/tests/all_tests.py | Python | mit | 3,574 | 0.003637 |
from __future__ import absolute_import
from django import forms
from django.contrib import messages
from django.core.urlresolvers import reverse
from sentry.models import Project, Team
from sentry.web.forms.add_project import AddProjectForm
from sentry.web.frontend.base import OrganizationView
from sentry.utils.http ... | nicholasserra/sentry | src/sentry/web/frontend/create_project.py | Python | bsd-3-clause | 2,910 | 0.002062 |
import os
os.environ["PYSDL2_DLL_PATH"] = os.getcwd()
import sdl2
import win32gui
def get_windows_bytitle(title_text, exact = False):
"""
Gets window by title text. [Windows Only]
"""
def _window_callback(hwnd, all_windows):
all_windows.append((hwnd, win32gui.GetWindowText(hwnd))... | tpainter/df_everywhere | df_everywhere/test/sdltest/StackOverflow_Question_Code.py | Python | gpl-2.0 | 1,568 | 0.017857 |
#!/usr/bin/python
# Exploit toolkit using shodan module for search exploit & host lookup
# Code : by jimmyromanticdevil
#
# Download :
# Before you run this code you must install shodan lib.
# $ wget [url]http://pypi.python.org/packages/source/s/shodan/shodan-0.4.tar.gz[/url]
# $ tar xvf shodan-0.2.tar.gz
# $ c... | ArioX/tools | shodan.py | Python | gpl-2.0 | 9,697 | 0.028359 |
# importing wxPython library, see the reference here :
# http://www.wxpython.org/docs/api/wx-module.html
# and an excelent step by step tutorial there :
# http://zetcode.com/wxpython
import wx
from Controller import *
# main function
def main():
# each wx application must have a wx.App object
app = wx.App()
... | jonathanlurie/BLANK_PY2WX | src/main.py | Python | mit | 492 | 0.006098 |
import sys
from fabric.api import *
from fabric.contrib import *
from fabric.contrib.project import rsync_project
from defaults import fab
from config import ssh, sudoers
import {%= name %}
@task
def prepare_vm():
sudoers.setup_sudoers_on_vm()
@task(default=True)
def system():
print 'start here'
| haimich/knick-knack | doc/folderstructure/v3.2/ .knick-knack/python-fabric/files/setup.py | Python | mit | 309 | 0.02589 |
# -*- coding: utf-8 -*-
#----------------------------------------------------------------------------
# Menu for quickly adding waypoints when on move
#----------------------------------------------------------------------------
# Copyright 2007-2008, Oliver White
#
# This program is free software: you can redistribute... | ryfx/modrana | modules/_mod_clickMenu.py | Python | gpl-3.0 | 2,761 | 0.002898 |
from __future__ import unicode_literals
import copy
import sys
from functools import update_wrapper
from django.utils.six.moves import zip
import django.db.models.manager # Imported to register signal handler.
from django.conf import settings
from django.core.exceptions import (ObjectDoesNotExist,
MultipleObject... | havard024/prego | venv/lib/python2.7/site-packages/django/db/models/base.py | Python | mit | 44,041 | 0.002021 |
# -*- coding: utf-8 -*-
#
# This file is part of HyperSpy.
#
# HyperSpy 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.
#
# HyperSpy... | ericpre/hyperspy | hyperspy/io_plugins/sur.py | Python | gpl-3.0 | 49,142 | 0.01691 |
from .base_executor import ScriptExecutor
from judgeenv import env
class RubyExecutor(ScriptExecutor):
ext = '.rb'
name = 'RUBY'
address_grace = 65536
fs = ['.*\.(?:so|rb$)', '/etc/localtime$', '/dev/urandom$', '/proc/self', '/usr/lib/ruby/gems/']
test_program = 'puts gets'
@classmethod
d... | buhe/judge | executors/ruby.py | Python | agpl-3.0 | 393 | 0.005089 |
import attr
from navmazing import NavigateToAttribute
from navmazing import NavigateToSibling
from cfme.common import Taggable
from cfme.common import TagPageView
from cfme.containers.provider import ContainerObjectAllBaseView
from cfme.containers.provider import ContainerObjectDetailsBaseView
from cfme.containers.pro... | nachandr/cfme_tests | cfme/containers/service.py | Python | gpl-2.0 | 4,417 | 0.002264 |
import sys
import gzip
import logging
from csv import DictReader
from datetime import datetime
from . import app, connect_db
from ..constants import DEFAULT_GENOME_BUILD, BENIGN, UNCERTAIN, UNKNOWN, PATHOGENIC
from ..extensions import mongo
from ..backend import build_variant_doc, get_variant_category, update_variant... | buske/variant-subscription-service | vss/scripts/import.py | Python | gpl-3.0 | 2,871 | 0.002438 |
"""
Lateral distribution functions that can be used for simulating particle
densities and for fitting to data.
Example usage::
>>> import tables
>>> from sapphire import NkgLdfSimulation, ScienceParkCluster
>>> data = tables.open_file('/tmp/test_ldf_simulation.h5', 'w')
>>> cluster = ScienceParkClus... | HiSPARC/sapphire | sapphire/simulations/ldf.py | Python | gpl-3.0 | 16,510 | 0 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2017 University of Oxford
#
# This file is part of msprime.
#
# msprime 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 ... | ashander/msprime | msprime/trees.py | Python | gpl-3.0 | 89,405 | 0.001455 |
import pymongo
from flask import g
from flask import current_app as app
def get_db():
if not hasattr(g, 'conn'):
print(app.config)
g.conn = pymongo.MongoClient(
app.config['MONGODB_HOST'],
int(app.config['MONGODB_PORT'])
)
if not hasattr(g, 'db'):
g.db... | patrykomiotek/seo-monitor-api | app/db.py | Python | mit | 524 | 0.003817 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.