code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
#
# 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
#... | danielvdende/incubator-airflow | airflow/operators/druid_check_operator.py | Python | apache-2.0 | 3,563 |
#!/usr/bin/env python3
import os
import sys
import socket
import time
try:
from urllib.parse import urlparse # Python 3
except ImportError:
from urlparse import urlparse # Python 2
import posixpath
import json
from hashlib import sha1
from base64 import b64encode
import requests
import classad
TOKEN_DIR_ENV... | htcondor/htcondor | src/condor_scripts/box_plugin.py | Python | apache-2.0 | 21,731 |
# coding: utf-8
"""
Wavefront REST API Documentation
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the W... | wavefrontHQ/python-client | wavefront_api_client/models/alert_source.py | Python | apache-2.0 | 12,593 |
"""Define nghttp2 ABI."""
# We will populate __all__ with the "declare" functions below
__all__ = [
'Nghttp2Error',
]
from ctypes import (
CFUNCTYPE,
POINTER,
Structure,
Union,
cdll,
c_char_p,
c_int,
c_int32,
c_size_t,
c_ssize_t,
c_uint32,
c_uint8,
c_void_p,
)
... | clchiou/garage | py/http2/http2/nghttp2.py | Python | mit | 12,085 |
import requests
import settings
import json
import logging
import os
import datetime
def run_collect(company):
logger.info(company + " started")
# files and vars
today = datetime.date(2017, 3, 31)
yesterday = today - datetime.timedelta(1)
two_days_ago = today - datetime.timedelta(2)
file_name... | bromjiri/Presto | crawler/manual/stwits/stwits-all.py | Python | mit | 2,521 |
"""The test for the min/max sensor platform."""
import unittest
from homeassistant.bootstrap import setup_component
from homeassistant.const import (
STATE_UNKNOWN, ATTR_UNIT_OF_MEASUREMENT, TEMP_CELSIUS, TEMP_FAHRENHEIT)
from tests.common import get_test_home_assistant
class TestMinMaxSensor(unittest.TestCase):... | xifle/home-assistant | tests/components/sensor/test_min_max.py | Python | mit | 8,489 |
## @file
# This file is used to define each component of the build database
#
# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. ... | miguelinux/vbox | src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Workspace/BuildClassObject.py | Python | gpl-2.0 | 15,123 |
import datetime
from haystack import indexes
from blog.models import Post, Comment
""" Every SearchIndex requires there be one (and only one) field with document=True. """
""" This indicates to both Haystack and the search engine about which field is the primary field for searching within. """
""" RealTimeSearchIndex... | LighthouseHPC/lighthouse | src/lighthouseProject/blog/search_indexes.py | Python | mit | 1,794 |
from fabric.api import env
import site_config
from develop import *
from production import *
from settings import *
from docker_local import *
# ssh config
env.use_ssh_config = True
env.user = 'root'
env.port = 22
# roledefs
env.roledefs = site_config.ROLEDEFS | FuckAll/fab | fabfile.py | Python | apache-2.0 | 264 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from urlparse import urlparse
from marionette_driver import expected, Wait
from firefox_ui_harness.decorators import s... | Motwani/firefox-ui-tests | firefox_ui_tests/functional/security/test_no_certificate.py | Python | mpl-2.0 | 3,543 |
from django import forms
from django.contrib.comments.forms import CommentForm
from kamu.comments.models import KamuComment
class KamuCommentForm(CommentForm):
email = forms.EmailField(required=False)
def get_comment_model(self):
# Use our custom comment model instead of the built-in one.
retu... | kansanmuisti/kamu | comments/forms.py | Python | agpl-3.0 | 535 |
#!/usr/bin/env python
import re
import os
#import UPhO
from sys import argv
"""A Script for changing names of OTUS in phylogenetic files (or any other text file). In case of fasta files, it replaces the whole identifier line with the new name. For newick, nexus or other files it only changes matching names.
Replacing... | ballesterus/PhyloUtensils | this4that.py | Python | agpl-3.0 | 2,319 |
#!/usr/bin/env python
'''======================================================
Created by: Ishmaal Erekson
Last updated: January 2015
File name: Ishmaalsplots.py
Organization: RISC Lab, Utah State University
======================================================'''
import roslib; roslib.load_ma... | riscmaster/risc_maap | risc_visual/src/Ishmaalsplots.py | Python | bsd-2-clause | 2,444 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: anchen
# @Date: 2016-10-19 17:11:32
# @Last Modified by: anchen
# @Last Modified time: 2016-11-14 14:10:54
import os,re
import sys
for paramIndex in range(0,len(sys.argv)):
if sys.argv[paramIndex] == "-i":
input_file=sys.argv[paramIndex+1]
f1=op... | ablifedev/ABLIRC | ABLIRC/bin/public/clip_xiaoshu.py | Python | mit | 797 |
"""Unit tests for the measurement routes."""
import unittest
from unittest.mock import Mock, patch
from external.routes import get_measurements, set_entity_attribute, stream_nr_measurements
from ...fixtures import JOHN, METRIC_ID, REPORT_ID, SOURCE_ID, SUBJECT_ID, create_report
class GetMeasurementsTest(unittest.T... | ICTU/quality-time | components/server/tests/external/routes/test_measurement.py | Python | apache-2.0 | 5,805 |
from Data.Events import ChangeEvent
from Data.Objects import ObservableObject
__author__ = 'mamj'
class MeshDefinition(ObservableObject):
EdgeElementDivisionDefinition = 1
EdgeElementSizeDefinition = 2
AreaElementSizeDefinition = 3
GlobalElementSizeDefinition = 4
def __init__(self):
ObservableObject.__init__... | pracedru/PracedruDesign | Data/Mesh.py | Python | bsd-3-clause | 4,840 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Trading As Brands
# Copyright (C) 2015 OpusVL (<http://opusvl.com/>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | OpusVL/odoo-trading-as | trading_as/__openerp__.py | Python | agpl-3.0 | 1,741 |
import unittest
import tempfile
import os
import logging
from unittest.mock import patch
from auxiclean import Selector
from collections import OrderedDict
from openpyxl import Workbook
class TestBase(unittest.TestCase):
# Cours (nom),Cours (code),Dispo,Programme
courses = {}
# Nom,Premier Choix,Deuxieme ... | physumasso/auxiclean | auxiclean/unittests/test_selector.py | Python | mit | 24,778 |
#!/usr/bin/env python
###############################################################################
# $Id: vsicurl_streaming.py 32166 2015-12-13 19:29:52Z goatbar $
#
# Project: GDAL/OGR Test Suite
# Purpose: Test /vsicurl_streaming
# Author: Even Rouault <even dot rouault at mines dash paris dot org>
#
#########... | nextgis-extra/tests | lib_gdal/gcore/vsicurl_streaming.py | Python | gpl-2.0 | 5,055 |
#
# 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... | mistercrunch/airflow | airflow/utils/process_utils.py | Python | apache-2.0 | 11,252 |
# Copyright 2014-2016 Ivan Kravets <me@ikravets.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/LICENSE-2.0
#
# Unless required by applicable law or... | valeros/platformio | platformio/platforms/atmelsam.py | Python | apache-2.0 | 1,522 |
# This file is part of Indico.
# Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | nop33/indico-plugin-chat | indico_chat/controllers/management.py | Python | gpl-3.0 | 7,282 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Kongsea/tensorflow | tensorflow/python/ops/sparse_ops.py | Python | apache-2.0 | 79,830 |
__author__ = "Reuven Deray"
def censor(text, word):
"""return text with word censored out
returns string"""
if text == '' or word == '':
result = "Did you fill everything in?"
else:
result = ("*" * len(word)).join(text.split(word))
return result
if __name__ == "__main__":
my... | reuvenderay/PythonProjects | censor.py | Python | mit | 601 |
from math import *
import pygame as pg
import datetime, os
import os.path
import subprocess
import numpy as np
import bluesky as bs
from bluesky.tools import geo
from bluesky.tools.areafilter import areas
from bluesky.tools.aero import ft, kts, nm
from bluesky.tools.misc import tim2txt
from bluesky import MSG_OK
fr... | ethertricity/bluesky | bluesky/ui/pygame/screen.py | Python | gpl-3.0 | 48,696 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'TreeItem.access_loggedin'
db.add_column('sitetree_treeitem', 'access_loggedin', self.gf('d... | RamezIssac/django-sitetree | sitetree/south_migrations/0003_auto__add_field_treeitem_access_loggedin.py | Python | bsd-3-clause | 4,280 |
import pytest
import pandas as pd
import pandas.util.testing as tm
from pandas.io.sas.sasreader import read_sas
import numpy as np
import os
# CSV versions of test xpt files were obtained using the R foreign library
# Numbers in a SAS xport file are always float64, so need to convert
# before making comparisons.
de... | kdebrab/pandas | pandas/tests/io/sas/test_xport.py | Python | bsd-3-clause | 4,892 |
import argparse
import fileinput
import os
import sys
from scripts.support.mirnas.update_mirnas_helpers import get_rfam_accs
from scripts.support.mirnas.config import UPDATE_DIR
field_options = {
'AU': 'AU Griffiths-Jones SR; 0000-0001-6043-807X\n',
'SE': 'SE Griffiths-Jones SR\n',
'SS': 'SS Predict... | Rfam/rfam-production | scripts/support/mirnas/update_desc.py | Python | apache-2.0 | 2,074 |
#!/usr/bin/python
import requests
import json
r = requests.get("http://api.fixer.io/latest?symbols=CHF,EUR")
resp = json.loads(r.content)
print resp["rates"]["CHF"] | streetturtle/AwesomeWM3 | RatesWidget/rates.py | Python | mit | 167 |
"""Connect base url definitions."""
# pylint: disable=no-value-for-parameter,invalid-name
from urlparse import urljoin
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.staticfiles.urls im... | lpatmo/actionify_the_news | connect/urls.py | Python | mit | 2,509 |
#-*- coding: utf-8 -*-
import sys
sys.path.append('D:/github-release')
import unittest
import json
# Other
import uasio.os_io.io_wrapper as iow
# App
import _http_requester as http_request
def _split_url(url):
""" http://www.dessci.com/en/products/mathplayer/ to
www.dessci.com /en/products/mathplayer/ - д... | zaqwes8811/micro-apps | matlab_ext/code-miners/projects/mkt-processors/data_str_to_json/coursera_title_parser.py | Python | mit | 4,890 |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | flgiordano/netcash | +/google-cloud-sdk/lib/surface/emulators/datastore/env_init.py | Python | bsd-3-clause | 1,208 |
import factory
from zds.gallery.models import Image, Gallery, UserGallery
from zds.utils import slugify
# Don't try to directly use UserFactory, this didn't create Profile then
# don't work!
class ImageFactory(factory.DjangoModelFactory):
FACTORY_FOR = Image
title = factory.Sequence(lambda n: u"titre de l\'... | Florianboux/zds-site | zds/gallery/factories.py | Python | gpl-3.0 | 1,610 |
from collections import Callable
from PyQt4.QtGui import QTextBrowser, QStatusTipEvent, QWhatsThisClickedEvent
from PyQt4.QtCore import QObject, QCoreApplication, QEvent, QTimer, QUrl
from PyQt4.QtCore import pyqtSignal as Signal
class QuickHelp(QTextBrowser):
#: Emitted when the shown text changes.
textCha... | jlegendary/orange | Orange/OrangeCanvas/gui/quickhelp.py | Python | gpl-3.0 | 3,731 |
from datetime import datetime
from flask import json
import moto
import boto3
from app.connectors.access_queue import send_messages_to_queue, get_messages_from_queue
from app.models import Notification, Job
notification = Notification(to='mock@example.com',
message='notification message'... | alphagov/notify-api | tests/app/connectors/test_access_queue.py | Python | mit | 2,758 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# MIT License
#
# Copyright (c) 2018 Miha Purg <miha.purg@gmail.com>
#
# 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, ... | mpurg/qtools | qscripts-cli/q_mapper.py | Python | mit | 7,577 |
# dr14_t.meter: compute the DR14 value of the given audiofiles
# Copyright (C) 2011 Simone Riva
#
# 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... | simon-r/dr14_t.meter | dr14tmeter/database_utils.py | Python | gpl-3.0 | 10,687 |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Rahul Handay <rahulha@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import (
MagicMock,... | stephane-martin/salt-debian-packaging | salt-2016.3.3/tests/unit/modules/saltcloudmod_test.py | Python | apache-2.0 | 1,868 |
# Copyright Bruno da Silva de Oliveira 2003. Use, modification and
# distribution is subject to the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
from SingleCodeUnit import SingleCodeUnit
import os
import utils
from SmartFile ... | alexa-infra/negine | thirdparty/boost-python/libs/python/pyste/src/Pyste/MultipleCodeUnit.py | Python | mit | 5,019 |
##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2013 Stanford University and the Authors
#
# Authors: Christoph Klein
# Contributors:
#
# MDTraj is free software: y... | casawa/mdtraj | mdtraj/geometry/tests/test_rdf.py | Python | lgpl-2.1 | 3,066 |
from sympy.core.basic import Basic
from sympy import (sympify, eye, sin, cos, rot_axis1, rot_axis2,
rot_axis3, ImmutableMatrix as Matrix, Symbol)
from sympy.core.cache import cacheit
import sympy.vector
class Orienter(Basic):
"""
Super-class for all orienter classes.
"""
def rotati... | kaushik94/sympy | sympy/vector/orienters.py | Python | bsd-3-clause | 11,694 |
from __future__ import print_function
import numpy as np
# Chapter 2 Beginning with NumPy fundamentals
#
# Demonstrates the selection
# of ndarray elements.
#
# Run from the commandline with
#
# python elementselection.py
a = np.array([[1,2],[3,4]])
print("In: a")
print(a)
#Out:
#array([[1, 2],
# [3, 4]])
p... | moonbury/notebooks | github/Numpy/Chapter2/elementselection.py | Python | gpl-3.0 | 492 |
from django.contrib.gis.geos import LineString
from django.test import SimpleTestCase
class GEOSCoordSeqTest(SimpleTestCase):
def test_getitem(self):
coord_seq = LineString([(x, x) for x in range(2)]).coord_seq
for i in (0, 1):
with self.subTest(i):
self.assertEqual(co... | evansd/django | tests/gis_tests/geos_tests/test_coordseq.py | Python | bsd-3-clause | 554 |
from collections import OrderedDict
expectations = OrderedDict([
# t_process[prism-tmin] recording:
('tmin',
[('prism/tiles/CONUS/19821201/CONUS_19821201_prism_tmin.tif',
'raster',
'gdalinfo-stats',
['Driver: GTiff/GeoTIFF',
'Size is 1405, 621',
'Coordinate System is:',
'GEOGCRS["NAD83",... | Applied-GeoSolutions/gips | gips/test/sys/expected/prism_process.py | Python | gpl-3.0 | 24,640 |
from typing import Any, Dict, Iterable, List, Mapping, Optional, Set, Tuple
from zerver.lib.initial_password import initial_password
from zerver.models import Realm, Stream, UserProfile, Huddle, \
Subscription, Recipient, Client, RealmAuditLog, get_huddle_hash
from zerver.lib.create_user import create_user_profile... | jackrzhang/zulip | zerver/lib/bulk_create.py | Python | apache-2.0 | 5,383 |
# coding: utf-8
from django.db import models
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
import uuid
import os
from filebrowser.fields import FileBrowseField
from sorl.thumbnail import ImageField
from tinymce import models as tinymce_models
try:
from PIL i... | klebercode/econordeste | econordeste/core/models.py | Python | mit | 10,504 |
"""
Some io tools for excel -- requires xlwt
Example usage:
import matplotlib.mlab as mlab
import mpl_toolkits.exceltools as exceltools
r = mlab.csv2rec('somefile.csv', checkrows=0)
formatd = dict(
weight = mlab.FormatFloat(2),
change = mlab.FormatPercent(2),
cost = mlab.Fo... | jonyroda97/redbot-amigosprovaveis | lib/mpl_toolkits/exceltools.py | Python | gpl-3.0 | 3,966 |
import time
import simplejson
from channel import BaseChannel, ChannelException,ChannelMetaClass, STATUS_BAD, STATUS_GOOD, STATUS_UGLY
from utils import *
#############
## Arirang ##
#############
class Arirang(BaseChannel):
playable = True
short_name = 'arirang_world'
long_name = 'Arirang TV World'
d... | k3oni/plugin.video.world.news.live | channels.py | Python | mit | 24,516 |
import ops.cmd, ops
import dsz
import os.path
import sys
def checkplugin(plugins_obj, command_to_check):
commands_found = []
for plugin in plugins_obj.remote.plugin:
if plugin.name.lower().startswith(('%s_target' % command_to_check.lower())):
commands_found.append(plugin.name)
return c... | DarthMaulware/EquationGroupLeaks | Leak #5 - Lost In Translation/windows/Resources/Ops/PyScripts/flavplugincontrol.py | Python | unlicense | 3,462 |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2022, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | bokeh/bokeh | tests/integration/widgets/test_text_input.py | Python | bsd-3-clause | 6,626 |
#------------------------------------------------------------------
#Name : Unordered Linked List
#Purpose : Unordered Linked List optimized for Adjecency List
#Author : Atul Kumar
#Created : 29/07/2016
#License : GPL V3
#Copyright : (c) 2016 Atul Kumar (www.facebook.com/atul.kr.007)
#Any correc... | overide/Datastructure-and-Algorithm-with-Python | searching/BFS/unordered_linked_list_vertex.py | Python | gpl-3.0 | 6,208 |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | uclouvain/osis_louvain | base/tests/models/test_session_exam_calendar.py | Python | agpl-3.0 | 12,403 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'CollectionVersion'
db.delete_table('dataforms_collectionversion')
# Adding fiel... | django-dataforms/django-dataforms | dataforms/migrations/0024_auto__del_collectionversion__add_field_dataform_javascript_include.py | Python | gpl-3.0 | 10,317 |
# Copyright 2018 The TensorFlow Hub 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... | tensorflow/hub | tensorflow_hub/test_utils.py | Python | apache-2.0 | 6,340 |
import datetime
import numpy as np
import matplotlib.colors as colors
import matplotlib.finance as finance
import matplotlib.dates as mdates
import matplotlib.ticker as mticker
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
import matplotlib.font_manager as font_manager
startdate = datetime.date(2015, ... | panda0881/pycharmtesting | testing2.py | Python | apache-2.0 | 6,320 |
# arguments or args
# setting up unlimited arguments with *
# can be thought of as lists but not really
# going through arguments in a list as individual items
def Func(*args):
for arg in args:
print('Show me my argument:', arg)
sample = [1,2,3,54,'ham']
print('\nRunning args function now\n')
Func(*sa... | leon-lei/learning-materials | basics/arg_kwargs.py | Python | mit | 804 |
import pytest
from .prefill_an_array import prefill
@pytest.mark.parametrize(
"param1, param2, answer",
[
[3, 1, [1, 1, 1]],
[2, "abc", ["abc", "abc"]],
["1", 1, [1]],
[3, prefill(2, "2d"), [["2d", "2d"], ["2d", "2d"], ["2d", "2d"]]],
],
)
def test_prefill(param1, param2, a... | benpetty/Code-Katas | katas/prefill_an_array/test_prefill_an_array.py | Python | mit | 727 |
"""
* KingTable 2.0.0 Flask development server
* https://github.com/RobertoPrevato/KingTable
*
* Copyright 2017, Roberto Prevato
* https://robertoprevato.github.io
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
"""
import os
import json
from flask import Flask, request, render_temp... | killuazhu/lights-data | servers/flask/server.py | Python | mit | 3,138 |
import argparse
import os
import shutil
import sys
from time import time
import numpy
import skimage.transform
import dlib
from ffvideo import VideoStream
def detect_crop_all_faces(X):
num_frames = X.shape[0]
all_cropped_faces = numpy.zeros((num_frames, 3, 96, 96), dtype=numpy.uint8)
all_landmarks = num... | pkhorrami4/make_chen_dataset | code/detect_faces.py | Python | gpl-3.0 | 6,022 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
dimensions= 1
startX = -55 # -100 # -500
end__X = 55 # 100 # 500
zero_shift_left = -45
energy_shift_val = -0.067908708333333
dampMarginBandMin = 2
dampMarginBandMax = 20
dampFormulaSmooth = False # True #- uses exp() with smoothed edge, False - uses 'traditional... | cosurgi/trunk | examples/qm/1d-potential-from-file.py | Python | gpl-2.0 | 7,232 |
import unittest
import logging
import json
import bson.json_util as bju
import attrdict as ad
import arrow
# Our imports
import emission.core.get_database as edb
import emission.core.wrapper.localdate as ecwl
import emission.net.usercache.abstract_usercache_handler as enuah
import emission.analysis.plotting.geojson.g... | yw374cornell/e-mission-server | emission/tests/analysisTests/intakeTests/TestPipelineRealData.py | Python | bsd-3-clause | 22,406 |
from __future__ import unicode_literals
from __future__ import absolute_import
import os
import tempfile
from wiki.tests.test_commands import TestManagementCommands
from .. import models
class TestAttachmentManagementCommands(TestManagementCommands):
"""
Add some more data
"""
def setUp(self):
... | inflrscns/django-wiki | wiki/plugins/attachments/tests/test_commands.py | Python | gpl-3.0 | 830 |
"""Tests for chebyshev module.
"""
from __future__ import division
import numpy as np
import numpy.polynomial.chebyshev as cheb
from numpy.polynomial.polynomial import polyval
from numpy.testing import (
TestCase, assert_almost_equal, assert_raises,
assert_equal, assert_, run_module_suite)
... | beiko-lab/gengis | bin/Lib/site-packages/numpy/polynomial/tests/test_chebyshev.py | Python | gpl-3.0 | 18,706 |
#!/usr/bin/env python
#
# Plot the output of "bcftools +guess-ploidy -v"
#
# Copyright (C) 2016 Genome Research Ltd.
#
# Author: Petr Danecek <pd3@sanger.ac.uk>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to... | wkretzsch/bcftools | misc/guess-ploidy.py | Python | gpl-3.0 | 4,333 |
import logging
from son_editor.app.database import db_session
from son_editor.app.exceptions import InvalidArgument
from son_editor.impl.private_catalogue_impl import publish_private_nsfs, query_private_nsfs
from son_editor.models.descriptor import Service, Function
from son_editor.models.project import Project
from s... | chrz89/upb-son-editor-backend | src/son_editor/impl/platform_connector.py | Python | apache-2.0 | 2,659 |
#Copyright 2008 Govind Salinas <blix@sophiasuchtig.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 Free Software Foundation, either version 2 of the License, or
#(at your option) any later version.
#This program is d... | blix/pyrite | pyrite/commands/clone.py | Python | gpl-2.0 | 1,924 |
from __future__ import print_function
from Components.ActionMap import ActionMap
from Components.Button import Button
from Components.Label import Label
from Components.config import config
from Components.MenuList import MenuList
from Components.TimerList import TimerList
from Components.TimerSanityCheck import TimerS... | openatv/enigma2 | lib/python/Screens/TimerEdit.py | Python | gpl-2.0 | 22,592 |
import logging
import traceback
from pathlib import Path
from typing import Optional
from PySide2 import QtWidgets
from PySide2.QtCore import Signal
from randovania.patching.patcher import Patcher
from randovania.patching.patchers.exceptions import ExportFailure
from randovania.gui.dialog.game_input_dialog import Gam... | henriquegemignani/randovania | randovania/gui/lib/game_exporter.py | Python | gpl-3.0 | 2,692 |
from rpython.translator.gensupp import NameManager
def test_unique():
m = NameManager()
sn = m.seennames
check = [
m.uniquename('something0'),
m.uniquename('something', with_number=True),
m.uniquename('something', with_number=True),
m.uniquename('something2', with_number=Tru... | oblique-labs/pyVM | rpython/translator/test/test_uniquename.py | Python | mit | 544 |
import logging
import vim
log = logging.getLogger(__name__)
class WindowManager(object):
"""Docstring for WindowManager. """
def __init__(self):
"""Initializes the global window manager."""
self.windows = dict()
def add(self, win):
"""Add a new vim window to manager.
... | kastenpotential/zion.vim | python3/pyvim/window.py | Python | gpl-3.0 | 1,305 |
from models import SimpleText, SimpleCategory
from django.contrib import admin
from categories.admin import CategoryBaseAdmin, CategoryBaseAdminForm
class SimpleTextAdmin(admin.ModelAdmin):
fieldsets = (
(None, {
'fields': ('name', 'description', )
}),
)
class SimpleCategoryAdmin... | gavinhodge/django-categories | example/simpletext/admin.py | Python | apache-2.0 | 584 |
# -*- coding: UTF-8 -*-
"""
Behave exception classes.
.. versionadded:: 1.2.7
"""
# ---------------------------------------------------------------------------
# EXCEPTION/ERROR CLASSES:
# ---------------------------------------------------------------------------
class ConstraintError(RuntimeError):
"""Used if ... | jenisys/behave | behave/exception.py | Python | bsd-2-clause | 1,142 |
"""Module in which is implemented the dynamic time warping algorithm.
"""
import numpy as np
def dtw(x, y, dist=None):
""" Computes the DTW of two sequences.
Parameters
----------
x : array_like
time serie.
y : array_like
time serie.
dist: function
distance function ... | tgquintela/TimeSeriesTools | TimeSeriesTools/Similarities/dtw.py | Python | mit | 1,887 |
from .core import DaskYARNCluster
__version__ = "0.2.4"
| blaze/knit | dask_yarn/__init__.py | Python | bsd-3-clause | 57 |
# coding: utf-8
import os
from .base import BaseTestCase
from prettyconf.loaders import EnvVarConfigurationLoader
class EnvVarTestCase(BaseTestCase):
def test_basic_config(self):
os.environ["TEST"] = "test"
config = EnvVarConfigurationLoader()
self.assertIn("TEST", config)
self... | georgeyk/prettyconf | tests/test_envvar.py | Python | mit | 596 |
__author__ = 'cmantas'
#python ssh lib
import paramiko
import string
import sys
from socket import error as socketError
sys.path.append('lib/scp.py')
from lib.scp import SCPClient
from datetime import datetime, timedelta
from time import sleep, time
ssh_timeout = 10
ssh_giveup_timeout = 600
priv_key_path = 'keys/jus... | cmantas/cluster_python_tool | scp_utils.py | Python | apache-2.0 | 1,916 |
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
# Copyright (C) Zing contributors.
#
# This file is a part of the Zing project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
from functo... | evernote/zing | pootle/apps/accounts/managers.py | Python | gpl-3.0 | 2,690 |
#####################################################################
# variables.py
#
# (c) Copyright 2013-2016, Benjamin Parzella. All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Soft... | bparzella/secsgem | secsgem/secs/variables/__init__.py | Python | lgpl-2.1 | 1,311 |
#!/usr/bin/python
import re, sys, os
from bs4 import BeautifulSoup
import simplejson as json
import argparse
from htmltoken import tokenize
import cgi
import util
import io
def genescaped(text):
"""All tokens in TEXT with any odd characters (such as <>&) encoded using HTML escaping"""
for tok in tokenize(text... | philpot/trafficcop-wat | wat/learn/prepare/bp-extract.py | Python | apache-2.0 | 5,759 |
__author__ = 'DeonHeyns'
# -*- coding: utf-8 -*-
import requests
import json as jason
class Client(object):
def __init__(self):
self._domain = 'http://data.fcc.gov/api'
self._params = None
self._url = None
self._response = None
def execute(self):
url = self._domain +... | DeonHeyns/fcc_census_block_api | client.py | Python | mit | 4,962 |
import ConfigParser
from cStringIO import StringIO
import glob
import imp
import inspect
import itertools
import logging
import logging.config
import logging.handlers
from optparse import OptionParser, Values
import os
import platform
import re
from socket import gaierror, gethostbyname
import string
import sys
import ... | Shopify/dd-agent | config.py | Python | bsd-3-clause | 40,585 |
from bibliopixel.animation.circle import Circle
from bibliopixel.colors import palettes
class Swirl(Circle):
COLOR_DEFAULTS = ('palette', palettes.get('three_sixty')),
def __init__(self, layout, angle=12, **kwds):
super().__init__(layout, **kwds)
self.angle = angle
def pre_run... | ManiacalLabs/BiblioPixelAnimations | BiblioPixelAnimations/circle/swirl.py | Python | mit | 586 |
#!/usr/bin/env python2
#
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Archive corpus file into zip and generate .d depfile.
Invoked by GN from fuzzer_test.gni.
"""
from __future__ import print_func... | endlessm/chromium-browser | third_party/openscreen/src/testing/libfuzzer/archive_corpus.py | Python | bsd-3-clause | 1,839 |
'''
Created on 18 Dec 2013
@author: myrosia
'''
from data import PainInfo
from main import SymptomDiaryApp
from diary_content import InfoBlock, EditBlock
from kivy.properties import StringProperty, NumericProperty
class PainInfoBlock(InfoBlock):
pain_info = None
average_pain = StringProperty("Not recorded")... | myrosia/symptomdiary | pain_info.py | Python | gpl-3.0 | 1,832 |
class Formatter(object):
pass
| kmod/icbd | stdlib/type_mocks/pygments/formatter.py | Python | mit | 34 |
#!/usr/bin/env python3
# Copyright (c) 2016-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the bumpfee RPC.
Verifies that the bumpfee RPC creates replacement transactions successfully when... | ericshawlinux/bitcoin | test/functional/wallet_bumpfee.py | Python | mit | 14,384 |
import numpy as np
import hcn
from IPython import embed, get_ipython
import vtk_visualizer as vv
if __name__ == "__main__":
m = hcn.Model3D.from_file("b4.obj", "m")
m = m.select_x(0, 1)
m = m.select_y(0, 1)
m = m.select_z(0.01, 1)
vv.plotxyz(m.to_array(), block=True)
sm = m.smoothed(knn=160, o... | SintefRaufossManufacturing/python-hcn | demo.py | Python | lgpl-3.0 | 842 |
# -*- coding: utf-8 -*-
# (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,... | Russell-IO/ansible | lib/ansible/playbook/play_context.py | Python | gpl-3.0 | 25,463 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
''' Processor functions for images '''
import numpy as np
def squeeze_image(img):
''' Return image, remove axes length 1 at end of image shape
For example, an image may have shape (10,20,30,1,1). ... | satra/NiPypeold | nipype/externals/pynifti/funcs.py | Python | bsd-3-clause | 2,788 |
#!flask/bin/python
# This script upgrades the database version to one version above the current
# version.
from migrate.versioning import api
from config import SQLALCHEMY_DATABASE_URI
from config import SQLALCHEMY_MIGRATE_REPO
api.upgrade(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO)
print "Current database vers... | dharmit/microblog | db_upgrade.py | Python | mit | 407 |
# -*- coding: utf-8 -*-
import re
import logging
from collections import namedtuple
import six
logger = logging.getLogger(__name__)
RuleInput = namedtuple('RuleInput', ['result_log', 'node'])
RuleMatch = namedtuple('RuleMatch', ['rule', 'result', 'node'])
class Network(object):
"""
A grouping of conditio... | mwielgoszewski/doorman | doorman/rules.py | Python | mit | 11,580 |
#!/usr/bin/python
# Copyright: Ansible Project
# 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': ['preview'],
... | sgerhart/ansible | lib/ansible/modules/net_tools/dnsmadeeasy.py | Python | mit | 23,583 |
import os
from distutils.core import setup
project_name = 'impersonate'
long_description = open('README.rst').read()
# Idea from django-registration setup.py
packages, data_files = [], []
root_dir = os.path.dirname(__file__)
if root_dir:
os.chdir(root_dir)
for dirpath, dirnames, filenames in os.walk(project_name... | Top20Talent/django-impersonate | setup.py | Python | bsd-3-clause | 1,879 |
# Copyright 2014-2019 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# Copyright 2015 Bassirou Ndaw <https://github.com/bassn>
# Copyright 2015 Alexis de Lattre <https://github.com/alexis-via>
# Copyright 2016-2017 Stanislav Krotov <https://it-projects.info/team/ufaks>
# Copyright 2017 Ilmir Karamov <https:... | it-projects-llc/pos-addons | pos_debt_notebook/__manifest__.py | Python | mit | 2,085 |
# -*- coding: UTF-8 -*-
import json
import re
import urllib
import urlparse
from resources.lib.modules import cleantitle
from resources.lib.modules import client
from resources.lib.modules import control
from resources.lib.modules import source_utils
from resources.lib.modules import dom_parser
class source:
d... | repotvsupertuga/tvsupertuga.repository | script.module.streamtvsupertuga/lib/resources/lib/sources/de/serienstream.py | Python | gpl-2.0 | 6,050 |
import socket
import threading
import time
def tcplink(sock, addr):
print 'Accept new connection from %s:%s...' % addr
sock.send('Welcome!')
while True:
data = sock.recv(1024)
time.sleep(1)
if data == 'exit' or not data:
break
sock.send('Hello, %s!' %... | lovekun/Notebook | python/chatroomServer.py | Python | gpl-2.0 | 654 |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pants.backend.jvm.targets.jvm_target import JvmTarget
from pants.backend.jvm.targets.runtime_platform_mixin import RuntimePlatformMixin
from pants.base.payload import Payload
class ... | wisechengyi/pants | src/python/pants/backend/jvm/targets/benchmark.py | Python | apache-2.0 | 1,163 |
def get_setup_data(self, case_data):
setup_data = []
if not case_data:
return setup_data
for case_index in case_data:
# ignore empty dict
if not case_index:
continue
for item in case_index.values():
for t_case in item:
setup... | by46/geek | thirdpart/sql.py | Python | mit | 536 |
"""Example code for generating a Rhino 'plane' (e.g. coordinate frame) from Euler angle rotations.
authors: Joshua Bard <jdbard@cmu.edu>
Inputs visible in Grasshopper:
x
y
z
rx
ry
rz
Outputs visible in Grasshopper:
out
a
xAxis
yAxis
zAxis
"""
import rhinoscriptsyntax as rs
basePlane = rs.... | CMU-dFabLab/dfab | rhino_python_examples/eulerplane.py | Python | bsd-3-clause | 946 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# edi documentation build configuration file, created by
# sphinx-quickstart on Tue May 3 15:17:55 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autoge... | lueschem/edi | docs/conf.py | Python | lgpl-3.0 | 9,220 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.