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 |
|---|---|---|---|---|---|---|
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | pvint/Blender2MS3d | io_mesh_ms3d/export_ms3d.py | Python | gpl-2.0 | 11,954 | 0.03915 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import copy
import astropy.units as u
import numpy as np
from astropy.io import ascii
from astropy.utils import lazyproperty
from scipy.interpolate import splev, splrep
from ._registry import Registry
from .constants import HC_ERG_AA, SPECTRUM_BANDFLUX_... | sncosmo/sncosmo | sncosmo/bandpasses.py | Python | bsd-3-clause | 16,460 | 0 |
#!/usr/bin/env python
from . import memfbf
from numpy import append
import os
import logging
from glob import glob
LOG = logging.getLogger(__name__)
class SlicerFrame(dict):
pass
class FBFSlicer(object):
"""Given a workspace directory of flat binary files, grab all useful filenames and return a record of... | davidh-ssec/pyfbf | pyfbf/slicer.py | Python | gpl-3.0 | 3,928 | 0.003564 |
import json
def jsonSave(data, fileName, indent=True, sort=False, oneLine=False):
f = open(fileName, 'w')
if indent:
f.write(json.dumps(data, indent=4, sort_keys=sort))
else:
f.write(json.dumps(data, sort_keys=sort))
f.close()
def jsonLoad(fileName):
try:
file = open(fileName)
t=file.read()
file.clo... | tannerbohn/ScholarVR | Code/fileIO.py | Python | gpl-2.0 | 368 | 0.05163 |
#
# The Python Imaging Library
# $Id$
#
# map CSS3-style colour description strings to RGB
#
# History:
# 2002-10-24 fl Added support for CSS-style color strings
# 2002-12-15 fl Added RGBA support
# 2004-03-27 fl Fixed remaining int() problems for Python 1.5.2
# 2004-07-19 fl Fixed gray/grey spelling issues
# 2... | Amechi101/concepteur-market-app | venv/lib/python2.7/site-packages/PIL/ImageColor.py | Python | mit | 8,085 | 0.007421 |
#!/bin/python
"""
Lisa just got a new math workbook. A workbook contains exercise problems, grouped into chapters.
There are nn chapters in Lisa's workbook, numbered from 11 to nn.
The ii-th chapter has titi problems, numbered from 11 to titi.
Each page can hold up to kk problems. There are no empty pages or unnecess... | codecakes/algorithms_monk | implementation/lisa_workbook_array_single_iter.py | Python | mit | 2,037 | 0.003939 |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | archifix/settings | sublime/Packages/SublimeCodeIntel/libs/chardet/utf8prober.py | Python | mit | 2,680 | 0.001866 |
from django.core.management import call_command
import pytest
import septentrion
def test_showmigrations_command_override(mocker):
mock_django_handle = mocker.patch(
'django.core.management.commands.showmigrations.Command.handle')
mock_show_migrations = mocker.patch(
'septentrion.show_migrati... | novafloss/django-north | tests/test_showmigrations_command.py | Python | mit | 2,400 | 0 |
# -*- coding: utf-8 -*-
from model.group import Group
def test_add_group(app):
old_groups = app.group.get_group_list()
group = (Group(name="fdsasdaf", header="group", footer="group"))
app.group.create(group)
assert len(old_groups) + 1 == app.group.count()
new_groups = app.group.get_group_list()
... | Coriolan8/python_traning | test/test_add_group.py | Python | apache-2.0 | 824 | 0.01335 |
# coding=utf-8
__all__ = ['admin']
| CSGreater-Developers/HMC-Grader | app/userViews/admin/__init__.py | Python | mit | 36 | 0 |
"""Script to display a collection of paths after inserting one new path
Usage:
add_to_a_path.py [-U] PATHS PATH
add_to_a_path.py [-U] (-s | -i INDEX ) PATHS PATH
Options:
-h, --help Show this help and exit
-v, --version Show version number and exit
-s, --start ... | jalanb/jab | src/python/add_to_a_path.py | Python | mit | 3,399 | 0 |
from __future__ import absolute_import, division, print_function
import _ast
from jaspyx.context.block import BlockContext
from jaspyx.visitor import BaseVisitor
class IfElse(BaseVisitor):
def visit_If(self, node, skip_indent=False):
if not skip_indent:
self.indent()
self.output('if(')... | ztane/jaspyx | jaspyx/visitor/if_else.py | Python | mit | 809 | 0 |
"""
mock_django.signals
~~~~~~~~~~~~~~~~
:copyright: (c) 2012 DISQUS.
:license: Apache License 2.0, see LICENSE for more details.
"""
import contextlib
import mock
@contextlib.contextmanager
def mock_signal_receiver(signal, wraps=None, **kwargs):
"""
Temporarily attaches a receiver to the provided ``signal``... | devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/mock_django/signals.py | Python | agpl-3.0 | 1,028 | 0 |
from couchpotato.core.event import addEvent
from couchpotato.core.logger import CPLog
from couchpotato.core.notifications.base import Notification
import os
import subprocess
log = CPLog(__name__)
class Synoindex(Notification):
index_path = '/usr/syno/bin/synoindex'
def __init__(self):
super(Synoin... | coolbombom/CouchPotatoServer | couchpotato/core/notifications/synoindex/main.py | Python | gpl-3.0 | 1,093 | 0.009149 |
# -*- coding: utf-8 -*-
#
# deluge/ui/common.py
#
# Copyright (C) Damien Churchill 2008-2009 <damoxc@gmail.com>
# Copyright (C) Andrew Resch 2009 <andrewresch@gmail.com>
#
# 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 ... | laanwj/deluge | deluge/ui/common.py | Python | gpl-3.0 | 13,980 | 0.001431 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | forkbong/qutebrowser | qutebrowser/misc/guiprocess.py | Python | gpl-3.0 | 6,787 | 0 |
#First parameter is path for binary file containing instructions to be injected
#Second parameter is Process Identifier for process to be injected to
import binascii
import sys
from ctypes import *
if len(sys.argv) < 3:
print("usage inject.py <shellcodefile.bin> <pid>")
sys.exit(1)
file = open(sys.argv[1],'rb')... | idkwim/snippets | inject.py | Python | mit | 956 | 0.034519 |
""" The SGE TimeLeft utility interrogates the SGE batch system for the
current CPU consumed, as well as its limit.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__RCSID__ = "$Id$"
import os
import re
import time
import socket
from DIRAC import S_... | ic-hep/DIRAC | src/DIRAC/Resources/Computing/BatchSystems/TimeLeft/SGEResourceUsage.py | Python | gpl-3.0 | 4,887 | 0.001432 |
# -*- coding: utf-8 -*-
"""Field classes.
Includes all fields from `marshmallow.fields` in addition to a custom
`Nested` field and `DelimitedList`.
All fields can optionally take a special `location` keyword argument, which tells webargs
where to parse the request argument from. ::
args = {
'active': fie... | daspots/dasapp | lib/webargs/fields.py | Python | mit | 2,488 | 0.00201 |
# Name: undo.py
# Purpose: XRC editor, undo/redo module
# Author: Roman Rolinsky <rolinsky@mema.ucl.ac.be>
# Created: 01.12.2002
# RCS-ID: $Id: undo.py 54812 2008-07-29 13:39:00Z ROL $
from globals import *
import view
from component import Manager
from model import Model
undo... | ktan2020/legacy-automation | win/Lib/site-packages/wx-3.0-msw/wx/tools/XRCed/undo.py | Python | mit | 7,307 | 0.005748 |
"""
Custom-written pure python meterpreter/bind_tcp stager
"""
from tools.evasion.evasion_common import evasion_helpers
from tools.evasion.evasion_common import encryption
class PayloadModule:
def __init__(self, cli_obj):
# required options
self.description = "pure windows/meterpreter/bind_tcp... | Veil-Framework/Veil | tools/evasion/payloads/python/meterpreter/bind_tcp.py | Python | gpl-3.0 | 6,026 | 0.009459 |
#!/usr/bin/env python3
import os
import sys
import re
import tempfile
from subprocess import run
from shutil import copyfile
args = sys.argv[1:]
in_dir = args[0] if len(args) == 1 else os.getcwd()
if not os.path.isabs(in_dir):
in_dir = os.path.abspath(in_dir)
if not os.path.isdir(in_dir):
print('"{}" is not... | kyclark/misc | tacc_manifest_upload/copy_from_manifest.py | Python | mit | 1,866 | 0.001608 |
# configobj.py
# A config file reader/writer that supports nested sections in config files.
# Copyright (C) 2005-2014:
# (name) : (email)
# Michael Foord: fuzzyman AT voidspace DOT org DOT uk
# Nicola Larosa: nico AT tekNico DOT net
# Rob Dennis: rdennis AT gmail DOT com
# Eli Courtwright: eli AT courtwright DOT org
#... | theguardian/JIRA-APPy | lib/configobj/configobj.py | Python | gpl-2.0 | 89,640 | 0.003614 |
import uuid
import json
import urllib
import os
import base64
import time
import string
import random
import oauth2 as oauth
from Crypto.PublicKey import RSA
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
from ... | daafgo/Server_LRS | lrs/tests/OAuthTests.py | Python | apache-2.0 | 161,641 | 0.009385 |
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import re, uuid
from lxml import etree
from urlparse import urlparse
from collection... | sharad/calibre | src/calibre/ebooks/oeb/transforms/structure.py | Python | gpl-3.0 | 13,406 | 0.00358 |
#!/usr/bin/python
import sys, signal, logging, time, RPi.GPIO as GPIO
FLOATSW_HIGH_WL = 26 # high water level float switch
WATER_VALVE = 10 # GPIO port for the Water Electo valve, High by default after boot
VALVE_CHGSTATE_TIMER = 25 ... | aquamonitor/Aquamonitor | rodi.py | Python | lgpl-3.0 | 4,109 | 0.011682 |
from django import template
register = template.Library()
@register.filter
def package_usage(user):
return user.package_set.all()
| miketheman/opencomparison | profiles/templatetags/profile_tags.py | Python | mit | 137 | 0 |
from collections.abc import Mapping
from ctypes import c_int, c_int32, c_double, c_char_p, POINTER, \
create_string_buffer, c_size_t
from weakref import WeakValueDictionary
import numpy as np
from numpy.ctypeslib import as_array
from openmc.exceptions import AllocationError, InvalidIDError
from . import _dll
from... | mit-crpg/openmc | openmc/lib/filter.py | Python | mit | 16,055 | 0.000561 |
# Copyright 2011 Andrew Bogott for the Wikimedia Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | badock/nova | nova/api/openstack/compute/plugins/v3/floating_ip_dns.py | Python | apache-2.0 | 10,441 | 0.000958 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2012 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) a... | Panos512/invenio | modules/webaccess/lib/external_authentication_openid.py | Python | gpl-2.0 | 6,658 | 0.004356 |
#%%
# information extraction: getting meaning from text
import nltk, re, pprint
def preprocess(document):
sents = nltk.sent_tokenize(document)
sents = [nltk.word_tokenize(sent) for sent in sents]
sents = [nltk.pos_tag(sent) for sent in sents]
return sents
#%% chunking
# NP-chunking
# one of most useful... | DoWhatILove/turtle | programming/python/library/nltk/information_extraction.py | Python | mit | 4,285 | 0.018203 |
# Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
#
# 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 conditions... | cattleprod/samsung-kernel-gt-i9100 | external/webkit/WebKitTools/Scripts/webkitpy/style/filter.py | Python | gpl-2.0 | 11,910 | 0.00084 |
#!/usr/bin/env python
import sys
import os
import getopt
import time
import random
from messageQueue import MessageQueue
VERSION = 0.5
REQUEST_EXCHANGE = {"name":"Request", "ex_type":"headers"}
IDENTIFY_EXCHANGE = {"name":"Identify", "ex_type":"headers"}
RESULTS_EXCHANGE = {"name":"Results", "ex_type":"headers"}
TR... | ted-dunstone/ivs | hub_demo/send_msg.py | Python | mit | 11,161 | 0.021862 |
from chula.www.controller.base import Controller
| jmcfarlane/chula | chula/www/controller/__init__.py | Python | gpl-2.0 | 49 | 0 |
from WebAppDIRAC.Lib.WebHandler import WebHandler, asyncGen
from DIRAC.Resources.Catalog.FileCatalog import FileCatalog
from DIRAC.ConfigurationSystem.Client.Helpers.Registry import getVOForGroup
from DIRAC import gConfig, gLogger
from DIRAC.Core.Utilities import Time
from hashlib import md5
class FileCatalogHandler... | zmathe/WebAppDIRAC | WebApp/handler/FileCatalogHandler.py | Python | gpl-3.0 | 12,082 | 0.048088 |
#!/usr/bin/env python3
from erros import NaoConverge
from numpy import matrix
from numpy.linalg import inv
from numpy.linalg import norm
def SolucaoEqNLinearBroyden(xin, bi, tol, niter, F):
xold = xin
bold = matrix(bi)
tolerancia = 1
while (tolerancia > tol and niter != -1):
f = matrix(F... | paulocsanz/algebra-linear | scripts/eq_n_linear_broyden.py | Python | agpl-3.0 | 1,262 | 0.011094 |
"""
Support for exporting database to KeePassX XML format.
"""
from __future__ import absolute_import
from datetime import datetime
from xml.etree import ElementTree as ET
from xml.dom import minidom
from keepassdb import const
class XmlExporter(object):
"""
Class for exporting database to KeePassX XML format... | hozn/keepassdb | keepassdb/export/xml.py | Python | gpl-3.0 | 3,206 | 0.005614 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-2014 OpenERP (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | Codefans-fan/odoo | openerp/fields.py | Python | agpl-3.0 | 70,820 | 0.001525 |
import torch
from . import Distribution, Categorical
from .. import util
class Mixture(Distribution):
def __init__(self, distributions, probs=None):
self._distributions = distributions
self.length = len(distributions)
if probs is None:
self._probs = util.to_tensor(torch.zeros(... | probprog/pyprob | pyprob/distributions/mixture.py | Python | bsd-2-clause | 3,418 | 0.002048 |
# referenciacatastral.py - functions for handling Spanish real state ids
# coding: utf-8
#
# Copyright (C) 2016 David García Garzón
# Copyright (C) 2016-2017 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as publish... | holvi/python-stdnum | stdnum/es/referenciacatastral.py | Python | lgpl-2.1 | 4,360 | 0 |
#!/usr/bin/python2.7
# Compresses the core Blockly files into a single JavaScript file.
#
# Copyright 2012 Google Inc.
# https://developers.google.com/blockly/
#
# 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 o... | kesl-scratch/PopconBot | scratch-blocks/build.py | Python | mit | 18,550 | 0.007978 |
import hashlib
def handle_uploaded_file(f):
img_url = 'media/image/' + CalcMD5(f) + f._name
with open(img_url, 'wb+') as destination:
for chunk in f.chunks():
destination.write(chunk)
return ('/' + img_url, f._name)
def CalcMD5(f):
md5obj = hashlib.md5()
md5obj.update(f.read())... | unixhot/opencmdb | util/util.py | Python | apache-2.0 | 366 | 0.008197 |
# -*- coding: utf-8 -*-
# from pytest import raises
# The parametrize function is generated, so this doesn't work:
#
# from pytest.mark import parametrize
#
import pytest
parametrize = pytest.mark.parametrize
# from duckomatic import metadata
# TODO: Importing this is broken because six.moves.urllib gives
# an im... | morgangalpin/duckomatic | tests/test_main.py | Python | gpl-3.0 | 1,476 | 0 |
# Copyright 2014 Cisco 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/LICENSE-2.0
#
# Unless required by applicable law o... | onecloud/neutron | neutron/tests/functional/agent/linux/base.py | Python | apache-2.0 | 2,637 | 0 |
#!/usr/bin/env python
#
# @license Apache-2.0
#
# Copyright (c) 2018 The Stdlib 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
#
# ... | stdlib-js/stdlib | lib/node_modules/@stdlib/math/base/special/cexp/benchmark/python/benchmark.py | Python | apache-2.0 | 2,220 | 0.00045 |
#!/usr/bin/env python
"""This does HTTP GET requests given a host:port and path and returns
a subset of the headers plus the body of the result."""
from __future__ import absolute_import, print_function
import json
import os
import sys
from edenscm.mercurial import util
httplib = util.httplib
try:
import msv... | facebookexperimental/eden | eden/hg-server/tests/get-with-headers.py | Python | gpl-2.0 | 2,434 | 0.000411 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | mcanthony/nupic | setup.py | Python | agpl-3.0 | 4,025 | 0.00472 |
"""Index interaction code
"""
| RalfBarkow/Zettelkasten | venv/lib/python3.9/site-packages/pip/_internal/index/__init__.py | Python | gpl-3.0 | 30 | 0 |
from typing import List, TypeVar
C = TypeVar('C') # how to constrain to only the closure below?
def color_factory(color_code: str) -> C:
def apply(text: str, format_spec: str = '') -> str:
return color_code + format(text, format_spec) + '\033[0m'
def mix(*colors: C) -> List[C]:
return [colo... | rsalmei/clearly | clearly/utils/colors.py | Python | mit | 1,146 | 0 |
import pytest
from django.contrib.contenttypes.models import ContentType
from addons.osfstorage import settings as osfstorage_settings
from osf.models import BaseFileNode, Folder, File
from osf_tests.factories import (
UserFactory,
ProjectFactory
)
pytestmark = pytest.mark.django_db
@pytest.fixture()
def us... | erinspace/osf.io | osf_tests/test_files.py | Python | apache-2.0 | 2,401 | 0.002499 |
# This file is part of Invenio.
# Copyright (C) 2009, 2010, 2011, 2014, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later v... | ludmilamarian/invenio | invenio/legacy/oairepository/server.py | Python | gpl-2.0 | 34,384 | 0.006893 |
# clustering.py
# cluster yelp and TA data
#
# Rob Churchill
#
# NOTE: IN ORDER TO GET ANY VISUALIZATIONS OUT OF THIS SCRIPT,
# YOU MUST PUT THIS IN AN IPYTHON NOTEBOOK OR SOMETHING SIMILAR
#
# NOTE: I learned to do this in my data science class last semester. If you are looking for plagiarism things, you will a... | rchurch4/georgetown-data-science-fall-2015 | analysis/clusterings/clustering.py | Python | mit | 4,732 | 0.01585 |
# descriptors.__init__
#
# Expose Descriptor, Validated, and all descriptors so they can be
# imported via "from descriptors import ..."
from __future__ import print_function, unicode_literals, division
from descriptors.Descriptor import Descriptor
from descriptors.Validated import Validated
import descriptors.handma... | noutenki/descriptors | descriptors/__init__.py | Python | mit | 631 | 0 |
# Copyright 2008 German Aerospace Center (DLR)
#
# 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 agre... | antont/tundra | src/Application/PythonScriptModule/pymodules_old/lib/webdav/acp/__init__.py | Python | apache-2.0 | 829 | 0 |
from setuptools import setup
setup(
name="mbtapy",
version='0.1.0dev1',
description='Python bindings for the MBTA-REALTIME API (v2)',
author="Joseph Dougherty",
author_email="mbtapy@jwdougherty.com",
url='https://github.com/JDougherty/mbtapy',
install_requires=['requests'],
license='LIC... | JDougherty/mbtapy | setup.py | Python | apache-2.0 | 355 | 0.002817 |
# Copyright 2017 ETH Zurich
#
# 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, sof... | FR4NK-W/osourced-scion | python/lib/rev_cache.py | Python | apache-2.0 | 5,118 | 0.001172 |
__author__ = 'romilly'
v1 = 1.0
v2 = 1.0
n1 = 1
while v2 > 10e-6:
v2 = v2 / n1
v1 = v1 + v2
n1 = n1 + 1
print v1
| romilly/pegasus-autocode | autocode/firstprog.py | Python | mit | 126 | 0 |
#!/usr/bin/env python3
"""inject_repos.py - CI secret repos injection.
"""
import yaml
from lxml import etree
from lxml.etree import ElementTree as ET
import argparse
from six import iteritems
def main():
repos_file, beaker_file = parse_args()
repos = load_secret_data(repos_file)
inject_repos(repos, beaker... | oVirt/jenkins | stdci_libs/inject_repos.py | Python | gpl-3.0 | 1,611 | 0.003724 |
########################################################################################################################
# VECNet CI - Prototype
# Date: 03/21/2014
# Institution: University of Notre Dame
# Primary Authors:
# Robert Jones <Robert.Jones.428@nd.edu>
######################################################... | vecnet/vnetsource | ts_emod/views/DownloadView.py | Python | mpl-2.0 | 1,812 | 0.004415 |
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
setup(
cmdclass = {'build_ext' : build_ext},
ext_modules=[Extension("_snaphu",
sources=["_snaphu.pyx",
"../src/snaphu.c",
"../src/snaphu_solver.c",
"../src/snaphu_util.... | bosmanoglu/adore-doris | lib/ext/snaphu-v1.4.2/cython/setup.py | Python | gpl-2.0 | 550 | 0.027273 |
"""
JsonCli: Library for CLI based on JSON
--------------------------------------
+------------------------+-------------+
| This is the JsonCli common library. |
+------------------------+-------------+
"""
import argparse
from collections import OrderedDict
from argcomplete import autocomplete
from botocore import ... | henrysher/opslib | opslib/icsutils/jsoncli.py | Python | apache-2.0 | 2,568 | 0 |
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Author: Kiall Mac Innes <kiall@managedit.ie>
#
# 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/lice... | grahamhayes/designate | designate/tests/test_api/test_v2/test_limits.py | Python | apache-2.0 | 2,306 | 0 |
def test_connect(client, connect):
"""Connect client triggers client_connect"""
connect()
assert client.triggers['CLIENT_CONNECT'] == 1
def test_ping_pong(client, server, connect, flush):
connect()
server.write("PING :ping-message")
client.send("PONG")
# Protocol doesn't advance until loo... | numberoverzero/bottom | tests/integ/test_local.py | Python | mit | 546 | 0 |
# coding: utf-8
from __future__ import unicode_literals
from __future__ import absolute_import
import configparser
import six
from .base import Opener
from .registry import registry
from ..subfs import ClosingSubFS
from ..errors import FSError, CreateFailed
__license__ = "LGPLv2+"
__copyright__ = "Copyright (c) 201... | althonos/fs.sshfs | fs/opener/sshfs.py | Python | lgpl-2.1 | 1,998 | 0.002002 |
"""
Copyright 2011-2014-2012 Kyle Lancaster
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 later version.
This program is distributed in the... | EdFarrell/MilkMachine | src/MilkMachine/simplekml/styleselector.py | Python | gpl-3.0 | 6,912 | 0.002315 |
# Programmer friendly subprocess wrapper.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: March 2, 2020
# URL: https://executor.readthedocs.io
"""
Miscellaneous TCP networking functionality.
The functionality in this module originated in the :class:`executor.ssh.server`
module with the purpose of faci... | xolox/python-executor | executor/tcp.py | Python | mit | 6,803 | 0.003675 |
from typing import Any
from argparse import ArgumentParser
from zerver.lib.actions import do_rename_stream
from zerver.lib.str_utils import force_text
from zerver.lib.management import ZulipBaseCommand
from zerver.models import get_stream
import sys
class Command(ZulipBaseCommand):
help = """Change the stream ... | amanharitsh123/zulip | zerver/management/commands/rename_stream.py | Python | apache-2.0 | 1,181 | 0.000847 |
# This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | prezi/prezi-suds | suds/client.py | Python | lgpl-3.0 | 28,017 | 0.002498 |
##############################################################################
#
# Swiss localization Direct Debit module for OpenERP
# Copyright (C) 2014 Compassion (http://www.compassion.ch)
# @author: Cyril Sester <cyril.sester@outlook.com>
#
# This program is free software: you can redistribute it... | ndtran/l10n-switzerland | l10n_ch_lsv_dd/wizard/lsv_export_wizard.py | Python | agpl-3.0 | 21,814 | 0 |
from __future__ import absolute_import, unicode_literals
import pickle
from io import StringIO, BytesIO
from kombu import version_info_t
from kombu import utils
from kombu.five import python_2_unicode_compatible
from kombu.utils.text import version_string_as_tuple
from kombu.tests.case import Case, Mock, patch, moc... | Elastica/kombu | kombu/tests/utils/test_utils.py | Python | bsd-3-clause | 10,301 | 0 |
from mongoengine import *
from models.zips import Zips
from geopy import distance
from geopy import Point
connect('scratch', host='mongodb://142.133.150.180/scratch')
# zipins = Zips(zipcode=999999, city="testlocation", loc=[1.0,1.0],pop=12345, state="ZZ").save()
locationList = []
location = {}
distanceList = []
fo... | rainmakeross/python-dataanalysis | app.py | Python | apache-2.0 | 871 | 0.005741 |
from setuptools import setup
license = open('LICENSE.txt').read()
setup(
name='iloveck101',
version='0.5.2',
author='tzangms',
author_email='tzangms@gmail.com',
packages=['iloveck101'],
url='https://github.com/tzangms/iloveck101',
license=license,
description='Download images from ck10... | tzangms/iloveck101 | setup.py | Python | mit | 662 | 0.006042 |
#pylint: disable=C0301, C0103, W0212, W0401
"""
.. module:: pilot
:platform: Unix
:synopsis: RADICAL-Pilot is a distributed Pilot-Job framework.
.. moduleauthor:: Ole Weidner <ole.weidner@rutgers.edu>
"""
__copyright__ = "Copyright 2013-2014, http://radical.rutgers.edu"
__license__ = "MIT"
# --------------... | JensTimmerman/radical.pilot | src/radical/pilot/__init__.py | Python | mit | 1,882 | 0.020723 |
# -*- coding: utf-8 -*-
import unittest
from unittest.mock import patch
from hypothesis import given
from hypothesis.strategies import integers
from pokebase import APIResource, loaders
from pokebase.common import ENDPOINTS
def builder(func, func_name):
@given(id_=integers(min_value=1))
@patch('pokebase.i... | GregHilmes/pokebase | tests/test_module_loaders.py | Python | bsd-3-clause | 1,399 | 0.004289 |
from __future__ import print_function
import os
import sys
import importlib
import mxnet as mx
from dataset.iterator import DetRecordIter
from config.config import cfg
from evaluate.eval_metric import MApMetric, VOC07MApMetric
import logging
from symbol.symbol_factory import get_symbol
def evaluate_net(net, path_imgre... | zhreshold/mxnet-ssd | evaluate/evaluate_net.py | Python | mit | 3,901 | 0.003076 |
import sys, os, multiprocessing, subprocess, time
src = os.path.abspath(os.path.join(os.path.dirname(__file__), 'src', 'sakia'))
res = os.path.abspath(os.path.join(os.path.dirname(__file__), 'res'))
pro_file_template = """
FORMS = {0}
SOURCES = {1}
TRANSLATIONS = {2}
"""
def generate_pro():
sources = []
form... | ucoin-io/cutecoin | update_ts.py | Python | mit | 1,724 | 0.00174 |
from soba.models.continuousModel import ContinuousModel
import soba.visualization.ramen.mapGenerator as ramen
import soba.run
from collections import OrderedDict
import json
from time import time
import sys
from model import SEBAModel
from visualization.back import Visualization
import datetime as dt
aStar = False
... | gsi-upm/soba | projects/seba/run.py | Python | mit | 3,404 | 0.016745 |
#!/usr/bin/env python
"""
Copyright (c) 2012, Aaron Meier
All rights reserved.
See LICENSE for more information.
"""
from distutils.core import setup
import os
from gitgate import __version__
setup(name='gitgate',
version = __version__,
description = 'Dead simple gatekeeping code review for Git',
long_de... | webgovernor/gitgate | setup.py | Python | mit | 856 | 0.031542 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
from builtins import zip
import pycrfsuite
def compareTaggers(model1, model2, string_list, module_name):
"""
Compare two models. Given a list of strings, prints out tokens & tags
whenever the two taggers parse a string differe... | et-al-Health/parserator | parserator/spotcheck.py | Python | mit | 3,434 | 0.004659 |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
import unittest
sys.path.insert(0, os.path.abspath('..'))
import dxpad._contest as _contest
class SignalMonitor:
signal_received = False
signal_value = None
def __init__(self, signal):
signal.connect(self.signal_receiver)
... | ftl/dxpad | tests/test_contest.py | Python | mit | 3,821 | 0.001309 |
#!/usr/bin/env python
# https://github.com/svenkreiss/PyROOTUtils/blob/master/PyROOTUtils/Graph.py
__author__ = "Kyle Cranmer <kyle.cranmer@nyu.edu"
__version__ = "0.1"
'''
This is a research work in progress.
Define model mu_s*Gaus(x|alpha,sigma)+mu_b*flat(x)
Generate {x} for several {alpha}
Calculate power (expec... | cranmer/parametrized-learning | ttbar_resonance.py | Python | bsd-2-clause | 11,616 | 0.037965 |
import oauth.oauth as oauth
import httplib
import json
import sys
class BaseClient:
def __init__(self, baseURL, key, secret):
self.url = baseURL
self.connection = httplib.HTTPConnection(baseURL)
self.consumer = oauth.OAuthConsumer(key, secret)
def _execute(self, httpmethod, path, body):
request = oauth.... | stackmob/stackmob-python-examples | stackmob/client.py | Python | apache-2.0 | 1,397 | 0.030064 |
from django.conf.urls.defaults import patterns, include, url
from django.utils.functional import curry
from django.views.defaults import server_error, page_not_found
from tracker.api import MemberResource, ReportResource
from tastypie.api import Api
v1_api = Api(api_name='v1')
v1_api.register(MemberResource())
v1_api.... | dwillis/socialcongress | tracker/urls.py | Python | unlicense | 1,173 | 0.00682 |
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (C) 2008 EVO Sistemas Libres <central@evosistemas.com>
# 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 F... | R3v1L/evogtk | evogtk/gui/widgetlib/dbcombobox.py | Python | mit | 4,770 | 0.012159 |
# (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... | alvaroaleman/ansible | lib/ansible/executor/stats.py | Python | gpl-3.0 | 2,779 | 0.009356 |
import math
import random
import re
import socket
import sys
import threading
import time
import types
import xml.dom.minidom
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
try:
import ssl
from ssl import SSLError
DEFAULT_SSL_VERSION = ssl.PROTOCOL_SSLv3
except Imp... | StratusLab/client | api/code/src/main/python/stomp/connect.py | Python | apache-2.0 | 37,671 | 0.007884 |
import warnings
from . import utils
from . import timeseries
from . import pos
from . import txn
from .tears import * # noqa
from .plotting import * # noqa
try:
from . import bayesian
except ImportError:
warnings.warn(
"Could not import bayesian submodule due to missing pymc3 dependency.",
... | dursk/pyfolio | pyfolio/__init__.py | Python | apache-2.0 | 416 | 0 |
#!/usr/bin/env python
"""This module has tests for the pvl decoder functions."""
# Copyright 2019-2021, Ross A. Beyer (rbeyer@seti.org)
#
# 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
#
# ... | planetarypy/pvl | tests/test_decoder.py | Python | bsd-3-clause | 10,166 | 0 |
from django.core.urlresolvers import reverse
from bakery.views import BuildableDetailView, BuildableListView
from core.views import get_build_path
from .models import BirthCertificate
class ListView(BuildableListView):
def __init__(self, **kwargs):
super(ListView, self).__init__(**kwargs)
ListV... | ginabythebay/iddocs | bcs/views.py | Python | apache-2.0 | 827 | 0 |
import numpy
import cv2
import time
print "Starting demo"
frameTimerDuration = 1
# This is the desired resolution of the Pi camera
resolution = (320, 240)
# This is the desired maximum framerate, 0 for maximum possible throughput
framerate = 0
# These are the resolution of the output display, set these
displayWidth ... | raygeeknyc/skinner | frameprocessordemo.py | Python | gpl-3.0 | 3,056 | 0.017997 |
# -*- coding: utf-8 -*-
# Natural Language Toolkit: IBM Model 3
#
# Copyright (C) 2001-2013 NLTK Project
# Authors: Chin Yee Lee, Hengfeng Li, Ruxin Hou, Calvin Tanujaya Lim
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Translation model that considers how a word can be aligned to
multiple w... | nelango/ViralityAnalysis | model/lib/nltk/translate/ibm3.py | Python | mit | 13,875 | 0.000865 |
"""
:class:`PyBusyInfo` constructs a busy info window and displays a message in it.
Description
===========
:class:`PyBusyInfo` constructs a busy info window and displays a message in it.
This class makes it easy to tell your user that the program is temporarily busy.
Just create a :class:`PyBusyInfo` object, and w... | garrettcap/Bulletproof-Backup | wx/lib/agw/pybusyinfo.py | Python | gpl-2.0 | 9,862 | 0.005983 |
#This is a cell with a custom comment as marker
x=10
y=11
print(x+y)
| HugoGuillen/nb2py | tutorial_files/custom.py | Python | mit | 70 | 0.057143 |
#!/usr/bin/python
# TODO: issues with new oauth2 stuff. Keep using older version of Python for now.
# #!/usr/bin/env python
import subprocess
import praw
import datetime
import pyperclip
from hashlib import sha1
from flask import Flask
from flask import Response
from flask import request
from cStringIO import StringI... | foobarbazblarg/stayclean | stayclean-2017-may/serve-challenge-with-flask.py | Python | mit | 10,823 | 0.003326 |
"""Config file for the emojis that Chiaki will use.
RENAME THIS FILE TO emojis.py OTHERWISE IT WON'T WORK.
By default it uses the unicode emojis. However, you can specify
server emojis in one of the two possible ways:
1. The raw string of the emoji. This is the format <:name:id>. You can find this
by placing a ba... | Ikusaba-san/Chiaki-Nanami | emojistemplate.py | Python | mit | 2,702 | 0.00037 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at yo... | jmartinm/invenio | modules/miscutil/lib/urlutils_unit_tests.py | Python | gpl-2.0 | 18,616 | 0.004835 |
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 17 19:41:46 2015
@author: deep
"""
from graph import weightedGraph
import heapq
def djikstra(a,S):
N = len(a.adjLst)
Visited = [False for i in xrange(N)]
Distance = [float('inf') for i in xrange(N)]
Distance[S] = 0
heap = []
heapq.heappush(heap,(0,... | ddeepak6992/Algorithms | Graph/Dijkstra.py | Python | gpl-2.0 | 935 | 0.019251 |
# 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.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | Brocade-OpenSource/OpenStack-DNRM-Nova | nova/tests/scheduler/test_scheduler_options.py | Python | apache-2.0 | 5,241 | 0.001145 |
"""
Init
"""
from __future__ import unicode_literals
import datetime
import os
import subprocess
VERSION = (2, 2, 13, 'final', 0)
def get_version(version=None):
"""
Returns a PEP 386-compliant version number from VERSION.
"""
if not version:
version = VERSION
else:
assert len(ver... | RyanNoelk/ClanLadder | django_ajax/__init__.py | Python | mit | 1,900 | 0 |
# -*- coding: utf-8 -*-
import pandas as pd
from itertools import izip
import numpy as np
import glob
from facebook import FacebookCompetition
print('Loading test data')
bids = pd.read_csv(FacebookCompetition.__data__['bids'])
test = pd.read_csv(FacebookCompetition.__data__['test'])
te = pd.merge(test, bids, how='lef... | ldamewood/kaggle | facebook/combine.py | Python | mit | 1,058 | 0.005671 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.