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
# -*- coding: utf-8 -*-
#
# Software License Agreement (BSD License)
#
# Copyright (c) 2010-2011, Antons Rebguns.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Red... | ufieeehw/IEEE2015 | ros/dynamixel_motor/dynamixel_driver/scripts/set_servo_config.py | Python | gpl-2.0 | 7,282 | 0.006866 |
from direct.distributed import DistributedObject
class DistributedTestObject(DistributedObject.DistributedObject):
def setRequiredField(self, r):
self.requiredField = r
def setB(self, B):
self.B = B
def setBA(self, BA):
self.BA = BA
def setBO(self, BO):
self.BO = BO
... | ToontownUprising/src | otp/distributed/DistributedTestObject.py | Python | mit | 717 | 0.001395 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "csrf_example.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that... | consideratecode/csrf_example | manage.py | Python | mit | 810 | 0 |
from django.http import HttpResponseRedirect
from django.utils.encoding import smart_str
def serve_file(request, file, **kwargs):
"""Serves files by redirecting to file.url (e.g., useful for Amazon S3)"""
return HttpResponseRedirect(smart_str(file.url))
def public_download_url(file, **kwargs):
"""Directs ... | GDGLima/contentbox | third_party/filetransfers/backends/url.py | Python | apache-2.0 | 405 | 0.004938 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | GabrielBrascher/cloudstack | plugins/hypervisors/ovm/src/main/scripts/vm/hypervisor/ovm/OvmNetworkModule.py | Python | apache-2.0 | 15,306 | 0.008363 |
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the migratoryBirds function below.
# {1:2, 2:4, 3:3, 4:4}
def migratoryBirds(arr):
frequentBird, frequency = 1, 0
birdsDict = {}
for i in arr:
if i not in birdsDict.keys():
birdsDict[i] = 1
else... | MithileshCParab/HackerRank-10DaysOfStatistics | Problem Solving/Algorithms/Implementation/migratory_birds.py | Python | apache-2.0 | 925 | 0.007568 |
# Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals, absolute_import, print_function
import sys
import click
import cProfile
import pstats
import frappe
import frappe.utils
from functools import wraps
from six import StringIO
c... | bohlian/frappe | frappe/commands/__init__.py | Python | mit | 1,535 | 0.024756 |
import csv
import numpy
import pandas
import pymongo
import requests
from datetime import datetime
from io import StringIO
mongo_client = pymongo.MongoClient("localhost", 27017)
financial_db = mongo_client.financial_data
financial_collection = financial_db.data
class Pull:
def __call__(self, source, tickers, ... | tchitchikov/goulash | python/pullData/src/pull.py | Python | apache-2.0 | 2,524 | 0.004358 |
#
# MLDB-2126-export-structured.py
# Mathieu Marquis Bolduc, 2017-01-25
# This file is part of MLDB. Copyright 2017 mldb.ai inc. All rights reserved.
#
import tempfile
import codecs
import os
from mldb import mldb, MldbUnitTest, ResponseException
tmp_dir = os.getenv('TMP')
class MLDB2126exportstructuredTest(MldbUni... | mldbai/mldb | testing/MLDB-2126-export-structured.py | Python | apache-2.0 | 1,480 | 0.001351 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.28 on 2020-03-17 20:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('astrobin_apps_platesolving', '0011_update_platesolvingadvanced_settings_sample_raw_frame_file_verbose_name'),
]
operations... | astrobin/astrobin | astrobin_apps_platesolving/migrations/0012_platesolvingadvancedtask.py | Python | agpl-3.0 | 824 | 0.002427 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from .modes import Modes
from . import models
from . import bridges
from . import layers
from . import processing
from .libs import * # noqa
from . import activations
from . import initializations
from . import losses
from . imp... | polyaxon/polyaxon-api | polyaxon_lib/__init__.py | Python | mit | 572 | 0.001748 |
import itertools
import os
import urlparse
from collections import namedtuple, defaultdict
from wptmanifest.node import (DataNode, ConditionalNode, BinaryExpressionNode,
BinaryOperatorNode, VariableNode, StringNode, NumberNode,
UnaryExpressionNode, UnaryOpera... | danlrobertson/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/manifestupdate.py | Python | mpl-2.0 | 25,973 | 0.001617 |
import os
class Config(object):
DEBUG = False
TESTING = False
SECRET_KEY = 'A0Zr18h/3yX R~XHH!jmN]LWX/,?RT'
DATABASE = {
'engine': 'playhouse.pool.PooledPostgresqlExtDatabase',
'name': 'middleware',
'user': 'comunitea',
'port': '5434',
... | jgmanzanas/CMNT_004_15 | project-addons/vt_flask_middleware/config.py | Python | agpl-3.0 | 705 | 0.004255 |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | ismail-s/warehouse | tests/unit/packaging/test_services.py | Python | apache-2.0 | 9,105 | 0 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it und... | jobiols/management-system | mgmtsystem_hazard_risk/__openerp__.py | Python | agpl-3.0 | 1,727 | 0 |
# -*- coding: utf-8 -*-
"""
celery.events.dumper
~~~~~~~~~~~~~~~~~~~~
THis is a simple program that dumps events to the console
as they happen. Think of it like a `tcpdump` for Celery events.
:copyright: (c) 2009 - 2011 by Ask Solem.
:license: BSD, see LICENSE for more details.
"""
from __fu... | mzdaniel/oh-mainline | vendor/packages/celery/celery/events/dumper.py | Python | agpl-3.0 | 2,533 | 0.001974 |
"""Config flow to configure the OVO Energy integration."""
import aiohttp
from ovoenergy.ovoenergy import OVOEnergy
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.config_entries import ConfigFlow
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from .const import DOMA... | partofthething/home-assistant | homeassistant/components/ovo_energy/config_flow.py | Python | apache-2.0 | 3,440 | 0.000291 |
#!/usr/bin/env python
"""
Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
try:
import _mssql
import pymssql
except ImportError:
pass
import logging
from lib.core.convert import utf8encode
from lib.core.data import conf
from lib.core.da... | V11/volcano | server/sqlmap/plugins/dbms/sybase/connector.py | Python | mit | 2,499 | 0.002401 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
diff.py
---------------------
Date : November 2013
Copyright : (C) 2013-2016 Boundless, http://boundlessgeo.com
************************************************************... | boundlessgeo/geogig-py | src/geogigpy/diff.py | Python | bsd-3-clause | 2,681 | 0.001119 |
"""
This file is part of py-sonic.
py-sonic 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.
py-sonic is distributed in the hope that it wil... | ties/py-sonic | libsonic/connection.py | Python | gpl-3.0 | 100,484 | 0.001513 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('universidades', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='universidademodel',
... | MCRSoftwares/AcadSocial | universidades/migrations/0002_auto_20150118_1319.py | Python | gpl-2.0 | 640 | 0 |
from .common import *
INTERNAL_IPS = ['127.0.0.1', ]
CORS_ORIGIN_WHITELIST = (
'localhost:8000',
)
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}
Q_CLUSTER = {
'name': 'DjangORM',
'workers': 2,
'timeout': 90,
'retry': 120,
'queue_limit': 5... | spacedogXYZ/sms_checkin | sms_checkin/settings/development.py | Python | agpl-3.0 | 883 | 0.001133 |
CONFIG_SCREEN = 'config'
RUNNING_SCREEN = 'running'
SUCCESS_SCREEN = 'success'
ERROR_SCREEN = 'error'
| lrq3000/pyFileFixity | pyFileFixity/lib/gooey/gui/windows/views.py | Python | mit | 111 | 0.036036 |
from itertools import combinations
START_P_HP = 100
START_P_DMG = 0
START_P_A = 0
START_B_HP = 100
START_B_DMG = 8
START_B_A = 2
WEAPONS = [ [8,4,0], [10,5,0], [25,6,0], [40,7,0], [74,8,0] ]
ARMOR = [ [13,0,1], [31,0,2], [53,0,3], [75,0,4], [102,0,5] ]
#Include 'no armor' option
ARMOR.append([0,0,0])
RINGS = [ [25,1... | tosmun/AdventOfCode | solutions/day21/p2/main.py | Python | apache-2.0 | 1,368 | 0.067982 |
import datetime
import sys
import pdb
from directory import directory
if False:
pdb.set_trace() # avoid warning message from pyflakes
class Logger(object):
# from stack overflow: how do i duplicat sys stdout to a log file in python
def __init__(self, logfile_path=None, logfile_mode='w', base_name=No... | rlowrance/re-local-linear | Logger.py | Python | mit | 886 | 0.003386 |
"""
Higher order classes and functions for Libvirt Sandbox (lxc) container testing
:copyright: 2013 Red Hat Inc.
"""
import datetime
import time
import logging
import lvsb_base
# This utility function lets test-modules quickly create a list of all
# sandbox aggregate types, themselves containing a list of individual... | spiceqa/virt-test | virttest/lvsb.py | Python | gpl-2.0 | 4,505 | 0 |
import boto
from boto.swf.exceptions import SWFResponseError
import sure # noqa
from moto import mock_swf_deprecated
# RegisterDomain endpoint
@mock_swf_deprecated
def test_register_domain():
conn = boto.connect_swf("the_key", "the_secret")
conn.register_domain("test-domain", "60", description="A test domai... | botify-labs/moto | tests/test_swf/responses/test_domains.py | Python | apache-2.0 | 3,834 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, sys
import traceback
from argparse import ArgumentParser
class SRDKRunError(Exception):
def __init__(self, message):
self.msg = message
def run_commands(cmds):
for cmd in cmds:
cmd = u" ".join(cmd)
print("Rhedeg %s" ... | techiaith/seilwaith | srdk/htk/SRDK_Train.py | Python | apache-2.0 | 1,957 | 0.036791 |
#!/usr/bin/env python
#
# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
... | n4hy/gnuradio | gr-uhd/apps/uhd_rx_cfile.py | Python | gpl-3.0 | 5,974 | 0.005524 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
from leagueofladders import settings
urlpatterns = patterns('',
url(r'^l/', include('leagueofladders.apps.myleague.urls', namespace='myleague')),
url(r'^admin/', include(admin.site.urls)... | dylanseago/LeagueOfLadders | leagueofladders/urls.py | Python | apache-2.0 | 420 | 0.004762 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | Azure/azure-sdk-for-python | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_storage_management_client.py | Python | mit | 63,288 | 0.006652 |
from . uuid64 import *
| jdowner/uuid64 | uuid64/__init__.py | Python | mit | 23 | 0 |
#!/usr/bin/env python
# take a large pcap and dump the data into a CSV so it can be analysed by something like R.
#
# This version we want to know what the source IP is, what the protocol is and based on those
# peices of info run a function to grab that data and write a line to a CSV file
#
# Ignore all traffic sourc... | dleecefft/pcapstats | pbin/parseL4Info.py | Python | apache-2.0 | 5,615 | 0.018878 |
from chainer import cuda
from chainer import function
from chainer.utils import type_check
def _kern():
return cuda.elementwise(
'T cond, T x, T slope', 'T y',
'y = cond >= 0 ? x : (T)(slope * x)', 'lrelu')
class LeakyReLU(function.Function):
"""Leaky rectifier unit."""
def __init__(se... | kiyukuta/chainer | chainer/functions/activation/leaky_relu.py | Python | mit | 2,382 | 0 |
#!/usr/bin/python3 -i
#
# Copyright (c) 2015-2020 The Khronos Group Inc.
# Copyright (c) 2015-2020 Valve Corporation
# Copyright (c) 2015-2020 LunarG, Inc.
# Copyright (c) 2015-2020 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... | endlessm/chromium-browser | third_party/angle/third_party/vulkan-validation-layers/src/scripts/layer_chassis_dispatch_generator.py | Python | bsd-3-clause | 99,103 | 0.005711 |
from envi.archs.msp430.regs import *
checks = [
# SWPB
(
'DEC r15',
{ 'regs': [(REG_R15, 0xaabb)], 'flags': [(SR_N, 0), (SR_Z, 0), (SR_C, 0), (SR_V, 0)], 'code': "8f10", 'data': "" },
{ 'regs': [(REG_R15, 0xbbaa)], 'flags': [(SR_N, 0), (SR_Z, 0), (SR_C, 0), (SR_V, 0)], 'code': "8f10", '... | joshuahoman/vivisect | envi/tests/msp430/iswpb.py | Python | apache-2.0 | 341 | 0.017595 |
import socket
import nlp
class NLPServer(object):
def __init__(self, ip, port):
self.sock = socket.socket()
self.sock.bind((ip, port))
self.processor = nlp.NLPProcessor()
print "Established Server"
def listen(self):
import thread
self.sock.listen(5)
print "Started listening at port."
while True:
... | jeffw16/elephant | nlp/nlpserver.py | Python | mit | 849 | 0.042403 |
from __future__ import division, print_function
import numpy as np
from lmfit.models import VoigtModel
from scipy.signal import argrelmax
import matplotlib.pyplot as plt
def lamda_from_bragg(th, d, n):
return 2 * d * np.sin(th / 2.) / n
def find_peaks(chi, sides=6, intensity_threshold=0):
# Find all potenti... | NSLS-II-XPD/ipython_ophyd | archived/profile_collection-dev/startup/42-energy-calib.py | Python | bsd-2-clause | 4,842 | 0.001239 |
""" This test need a set of pins which can be set as inputs and have no external
pull up or pull down connected.
"""
from machine import Pin
import os
mch = os.uname().machine
if 'LaunchPad' in mch:
pin_map = ['GP24', 'GP12', 'GP14', 'GP15', 'GP16', 'GP17', 'GP28', 'GP8', 'GP6', 'GP30', 'GP31', 'GP3', 'GP0', ... | feilongfl/micropython | tests/wipy/pin.py | Python | mit | 4,685 | 0.007044 |
from __future__ import absolute_import
import os
from celery import Celery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sugarcub.settings')
from django.conf import settings # noqa
app = Celery('sugarcub')
# Using a string here means the worke... | bronycub/sugarcub | sugarcub/celery.py | Python | gpl-3.0 | 576 | 0 |
#!/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'],
... | kustodian/ansible | lib/ansible/modules/cloud/amazon/kinesis_stream.py | Python | gpl-3.0 | 46,551 | 0.001547 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-27 16:37
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shop', '0017_auto_20170327_1934'),
]
operations = [
migrations.AlterField(
... | IlyaDjurin/django-shop | shop/migrations/0018_auto_20170327_1937.py | Python | mit | 3,554 | 0.0039 |
"""
Copyright 2015 Brocade Communications 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 or agreed t... | DavidJohnGee/clicrud | clicrud/crud/__init__.py | Python | apache-2.0 | 3,616 | 0.000553 |
from __future__ import division, absolute_import, print_function
from flask import current_app, Blueprint, jsonify, url_for, request
from idb.helpers.cors import crossdomain
from .common import json_error, idbmodel, logger
this_version = Blueprint(__name__,__name__)
def format_list_item(t,uuid,etag,modified,versio... | iDigBio/idb-backend | idb/data_api/v1.py | Python | gpl-3.0 | 4,235 | 0.012043 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflow/tensorflow | tensorflow/python/client/timeline.py | Python | apache-2.0 | 28,612 | 0.005033 |
import blinker
from concurrency.fields import IntegerVersionField
from django.contrib.auth.models import User
from django.db import models
from django.db.models.signals import post_save
from django.dispatch.dispatcher import receiver
from game.apps.core.models.planet.models import Planet
from game.utils.models i... | piotrlewalski/birdstorm | game/apps/core/models/buildings.py | Python | mit | 2,036 | 0.002947 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'slidersd.ui'
#
# Created: Tue Mar 17 23:31:52 2015
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attri... | MSHallOpenSoft/plotter | Thesidetab/sliderder.py | Python | gpl-2.0 | 2,815 | 0.001421 |
"""
Platform for a Generic Modbus Thermostat.
This uses a setpoint and process
value within the controller, so both the current temperature register and the
target temperature register need to be configured.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/component... | PetePriority/home-assistant | homeassistant/components/modbus/climate.py | Python | apache-2.0 | 5,304 | 0 |
# -*- coding: utf-8 -*-
from greek_stemmer.closets.word_exceptions import exceptions
def test_word_exceptions():
assert isinstance(exceptions, dict)
| kpech21/Greek-Stemmer | tests/closets/test_word_exceptions.py | Python | lgpl-3.0 | 157 | 0 |
from pypif.obj import Property, Scalar
from .base import DFTParser, Value_if_true, InvalidIngesterException
import os
import re
from ase.io.vasp import read_vasp_out
from pypif.obj import Value, FileReference
from dftparse.vasp.outcar_parser import OutcarParser
from dftparse.vasp.eigenval_parser import EigenvalParser
... | CitrineInformatics/pif-dft | dfttopif/parsers/vasp.py | Python | apache-2.0 | 16,836 | 0.00689 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Reading, writing, and describing memory.
"""
import gdb
import pwndbg.compat
import pwndbg.typeinfo
PAGE_SIZE = 0x1000
PAGE_MASK = ~(PAGE_SIZE-1)
MMAP_MIN_ADDR = 0x8000
def read(addr, count, partial=False):
result = ''
try:
result = gdb.selected_infer... | bj7/pwndbg | pwndbg/memory.py | Python | mit | 5,918 | 0.010308 |
# anaconda: The Red Hat Linux Installation program
#
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
# Red Hat, Inc. All rights reserved.
#
# 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 Softw... | kparal/anaconda | pyanaconda/anaconda.py | Python | gpl-2.0 | 9,570 | 0.001463 |
"""
WSGI config for Footer project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` s... | mihow/footer | config/wsgi.py | Python | mit | 1,706 | 0 |
# Copyright 2014 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.
import ast
import os.path
import platform
import re
import sys
class Config(object):
'''A Config contains a dictionary that species a build configuratio... | junhuac/MQUIC | src/mojo/tools/mopy/config.py | Python | mit | 4,103 | 0.014136 |
import random
import datetime
import psycopg2
from collections import deque
from tornado.stack_context import wrap
from tornado.ioloop import IOLoop
from tornado.concurrent import return_future
class WrapCursor:
def __init__(self,db,cur):
self._db = db
self._cur = cur
self._oldcur = None
... | pzread/sdup | pg.py | Python | mit | 8,196 | 0.0194 |
import simplejson as json
import urllib
import urllib2
import time
server = ""
def GET(uri, params):
params = urllib.urlencode(params)
req = urllib2.Request(server + uri + "?" + params , headers={'Accept': 'application/json'})
return json.loads(urllib2.urlopen(req).read())
def POST(uri, params):
para... | mozilla/iacomus-alerts | python/poster.py | Python | epl-1.0 | 2,563 | 0.006633 |
# -*- coding: utf-8 -*-
#
# (c) Copyright 2001-2009 Hewlett-Packard Development Company, L.P.
#
# 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 opt... | Alberto-Beralix/Beralix | i386-squashfs-root/usr/share/hplip/ui4/readonlyradiobutton.py | Python | gpl-3.0 | 1,657 | 0.004225 |
from __future__ import print_function
from __future__ import division
import numpy as np
import sys
import argparse
import time
import re
import gzip
import os
import logging
from collections import defaultdict
from operator import itemgetter
__version__ = "1.0"
def main():
parser=argparse.ArgumentParser(descr... | blajoie/vcf2fasta | scripts/vcf2fasta.py | Python | apache-2.0 | 8,351 | 0.025626 |
import socket
import pytest
import mock
from pygelf import GelfTcpHandler, GelfUdpHandler, GelfHttpHandler, GelfTlsHandler, GelfHttpsHandler
from tests.helper import logger, get_unique_message, log_warning, log_exception
SYSLOG_LEVEL_ERROR = 3
SYSLOG_LEVEL_WARNING = 4
@pytest.fixture(params=[
GelfTcpHandler(hos... | keeprocking/pygelf | tests/test_common_fields.py | Python | mit | 2,884 | 0.001387 |
# -*- coding: utf-8 -*-
#
# Copyright 2013 - Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | nmakhotkin/mistral-extra | examples/webhooks/api/controllers/resource.py | Python | apache-2.0 | 1,470 | 0 |
# Copyright the Karmabot authors and contributors.
# All rights reserved. See AUTHORS.
#
# This file is part of 'karmabot' and is distributed under the BSD license.
# See LICENSE for more details.
# dedicated to LC
from json import JSONDecoder
from urllib import urlencode
from urllib2 import urlopen
from karmabot.co... | chromakode/karmabot | karmabot/extensions/lmgtfy.py | Python | bsd-3-clause | 2,423 | 0.000413 |
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from numpy import asarray_chkfinite
from .misc import LinAlgError, _datacopied
from .lapack import get_lapack_funcs
from scipy._lib.six import callable
__all__ = ['qz']
_double_precision = ['i','l','d']
def _sele... | witcxc/scipy | scipy/linalg/_decomp_qz.py | Python | bsd-3-clause | 8,764 | 0.004792 |
# Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | cloudbase/nova-virtualbox | nova/openstack/common/versionutils.py | Python | apache-2.0 | 8,784 | 0 |
from exchanges import helpers
from exchanges import kraken
from decimal import Decimal
### Kraken opportunities
#### ARBITRAGE OPPORTUNITY 1
def opportunity_1():
sellLTCbuyEUR = kraken.get_current_bid_LTCEUR()
sellEURbuyXBT = kraken.get_current_ask_XBTEUR()
sellXBTbuyLTC = kraken.get_current_ask_XBTLTC()
oppor... | Humantrashcan/prices | exchanges/opportunity_kraken.py | Python | mit | 658 | 0.024316 |
import os
from fs import enums
import unittest
class TestEnums(unittest.TestCase):
def test_enums(self):
self.assertEqual(enums.Seek.current, os.SEEK_CUR)
self.assertEqual(enums.Seek.end, os.SEEK_END)
self.assertEqual(enums.Seek.set, os.SEEK_SET)
self.assertEqual(enums.ResourceTy... | PyFilesystem/pyfilesystem2 | tests/test_enums.py | Python | mit | 335 | 0 |
#!/usr/bin/env python
from __future__ import print_function
# Use the srilm module
from srilm import *
# Initialize a trigram LM variable (1 = unigram, 2 = bigram and so on)
n = initLM(5)
# Read 'sample.lm' into the LM variable
readLM(n, "corpu.lm")
# How many n-grams of different order are there ?
print("1. Numbe... | sureshbvn/nlpProject | nGramModel/test.py | Python | mit | 2,837 | 0.004582 |
from flask import Flask
from flask import request
from flask.ext.sqlalchemy import SQLAlchemy
import datetime
import uuid as uid
import sys
import requests
import urllib2
GOIP_SERVER_IP = '127.0.0.1' #'172.248.114.178'
TELEPHONY_SERVER_IP = '127.0.0.1:5000/sms/in'
sys.path.append('/home/csik/public_python/sms_... | rootio/rootio_telephony | sms_utils/sms_server.py | Python | agpl-3.0 | 3,873 | 0.018848 |
# Copyright (C) 2013-2020 Internet Systems Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET ... | isc-projects/forge | tests/softwaresupport/bind9_server/bind_configs.py | Python | isc | 54,716 | 0.009668 |
import sys
import os
import torch
import time
from engine import TetrisEngine
from dqn_agent import DQN, ReplayMemory, Transition
from torch.autograd import Variable
use_cuda = torch.cuda.is_available()
FloatTensor = torch.cuda.FloatTensor if use_cuda else torch.FloatTensor
LongTensor = torch.cuda.LongTensor if use_c... | jaybutera/tetrisRL | run_model.py | Python | mit | 1,627 | 0.009834 |
import pandas as pd
import logging
import settings
import os
from scikits.audiolab import oggwrite, play, oggread
from scipy.fftpack import dct
from itertools import chain
import numpy as np
import math
log = logging.getLogger(__name__)
def read_sound(fpath, limit=settings.MUSIC_TIME_LIMIT):
try:
data, f... | VikParuchuri/evolve-music2 | extract_features.py | Python | mit | 6,422 | 0.001557 |
import time
from indy import anoncreds, wallet
import json
import logging
from indy import pool
from src.utils import run_coroutine, PROTOCOL_VERSION
logger = logging.getLogger(__name__)
async def demo():
logger.info("Anoncreds sample -> started")
issuer = {
'did': 'NcYxiDXkpYi6ov5FcYDi1e',
... | srottem/indy-sdk | samples/python/src/anoncreds.py | Python | apache-2.0 | 7,929 | 0.005171 |
import gevent
import socket
from vnc_api.vnc_api import *
from cfgm_common.vnc_kombu import VncKombuClient
from config_db import *
from cfgm_common.dependency_tracker import DependencyTracker
from reaction_map import REACTION_MAP
import svc_monitor
class RabbitConnection(object):
_REACTION_MAP = REACTION_MAP
... | sajuptpm/contrail-controller | src/config/svc-monitor/svc_monitor/rabbit.py | Python | apache-2.0 | 4,079 | 0.001226 |
"""
Basic iscsi support for Linux host with the help of commands
iscsiadm and tgtadm.
This include the basic operates such as login and get device name by
target name. And it can support the real iscsi access and emulated
iscsi in localhost then access it.
"""
import re
import os
import logging
from avocado.core imp... | vipmike007/avocado-vt | virttest/iscsi.py | Python | gpl-2.0 | 29,173 | 0.001165 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | v-iam/azure-sdk-for-python | azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error.py | Python | mit | 1,252 | 0.000799 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack 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
#
# Unle... | dsiddharth/access-keys | keystone/common/sql/migrate_repo/versions/001_add_initial_tables.py | Python | apache-2.0 | 5,811 | 0 |
"""
The `compat` module provides support for backwards compatibility with older
versions of Django/Python, and compatibility wrappers around optional packages.
"""
# flake8: noqa
from __future__ import unicode_literals
import inspect
import django
from django.apps import apps
from django.conf import settings
from dj... | steventimberman/masterDebater | venv/lib/python2.7/site-packages/rest_framework/compat.py | Python | mit | 10,280 | 0.000486 |
""" generic tests from the Datetimelike class """
import numpy as np
import pandas as pd
from pandas.util import testing as tm
from pandas import Series, Index, DatetimeIndex, date_range
from ..datetimelike import DatetimeLike
class TestDatetimeIndex(DatetimeLike):
_holder = DatetimeIndex
def setup_method(... | NixaSoftware/CVis | venv/lib/python2.7/site-packages/pandas/tests/indexes/datetimes/test_datetimelike.py | Python | apache-2.0 | 2,661 | 0 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# Copyright (c) 2012-2014, Michael Reuter
# Distributed under the MIT License. See LICENSE.txt for more information.
#------------------------------------------------------------------------------
from .moon_info im... | mareuter/lct-python | lct/utils/observing_info.py | Python | mit | 1,166 | 0.008576 |
import os
import platform
import sys
import threading
from concurrent.futures import ThreadPoolExecutor
from os import environ, path
from threading import Timer
import grpc
import ptvsd
from getgauge import handlers, logger, processor
from getgauge.impl_loader import copy_skel_files
from getgauge.messages import runne... | kashishm/gauge-python | start.py | Python | mit | 2,076 | 0.000482 |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Logit'] , ['MovingAverage'] , ['Seasonal_WeekOfYear'] , ['NoAR'] ); | antoinecarme/pyaf | tests/model_control/detailed/transf_Logit/model_control_one_enabled_Logit_MovingAverage_Seasonal_WeekOfYear_NoAR.py | Python | bsd-3-clause | 163 | 0.04908 |
import argparse
import taichi as ti
FRAMES = 100
def test_ad_gravity():
from taichi.examples.simulation.ad_gravity import init, substep
init()
for _ in range(FRAMES):
for _ in range(50):
substep()
def video_ad_gravity(result_dir):
import numpy as np
from taichi.examples.si... | yuanming-hu/taichi | tests/python/examples/simulation/test_ad_gravity.py | Python | mit | 1,137 | 0 |
"""This script automates the copying of the default keymap into your own keymap.
"""
import shutil
from pathlib import Path
import qmk.path
from qmk.decorators import automagic_keyboard, automagic_keymap
from milc import cli
@cli.argument('-kb', '--keyboard', help='Specify keyboard name. Example: 1upkeyboards/1up60h... | kmtoki/qmk_firmware | lib/python/qmk/cli/new/keymap.py | Python | gpl-2.0 | 1,884 | 0.004246 |
# -*- coding: utf-8 -*-
#
# Copyright 2015 AirPlug 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 applic... | ddinsight/dd-streamworks | stream_worker/devmodule/production/networklog/__init__.py | Python | apache-2.0 | 12,862 | 0.003424 |
# -*- coding: utf8 -*-
SQL = (
('list_fonds_report1', """
select
F.FKOD,F.FNAME, (F.A16+if(F.A22,A22,0)) as A16
FROM
`af3_fond` F
WHERE
FNAME like ('%%%(qr)s%%') or A1 like ('%%%(qr)s%%')
ORDER BY FKOD;"""),
)
FOUND_ROWS = True
ROOT = "fonds"
ROOT_PREFIX = None
ROOT_POSTFIX= ... | ffsdmad/af-web | cgi-bin/plugins2/report/fond_search_report1.py | Python | gpl-3.0 | 547 | 0.006085 |
# -*- coding: UTF-8 -*-
# Copyright (C) 2007, 2009, 2011-2012 J. David Ibáñez <jdavid.ibp@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 Free Software Foundation, either version 3 of the License, or
# (at y... | hforge/itools | itools/database/backends/git.py | Python | gpl-3.0 | 14,062 | 0.00313 |
import os
import time
import unittest
from typing import Callable
from unittest.mock import patch
from uuid import uuid4
from freezegun import freeze_time
from ray_release.exception import (
ClusterCreationError,
ClusterStartupError,
ClusterStartupTimeout,
ClusterStartupFailed,
ClusterEnvBuildErro... | ray-project/ray | release/ray_release/tests/test_cluster_manager.py | Python | apache-2.0 | 24,218 | 0.000991 |
from datetime import time
from datetime import timedelta
import pendulum
from .constants import SECS_PER_HOUR
from .constants import SECS_PER_MIN
from .constants import USECS_PER_SEC
from .duration import AbsoluteDuration
from .duration import Duration
from .mixins.default import FormattableMixin
class Time(Formatt... | sdispater/pendulum | pendulum/time.py | Python | mit | 7,783 | 0.001156 |
# Copyright (c) 2021 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 ap... | luotao1/Paddle | python/paddle/distributed/fleet/utils/log_util.py | Python | apache-2.0 | 1,685 | 0.00178 |
# -*- coding: utf-8 -*-
#
# This file is part of the Christine project
#
# Copyright (c) 2006-2007 Marco Antonio Islas Cruz
#
# Christine 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... | markuz/Christine | libchristine/Share.py | Python | gpl-2.0 | 5,045 | 0.004559 |
#!/usr/bin/env python
"""Exponential and Quaternion code for Lab 6.
Course: EE 106, Fall 2015
Author: Victor Shia, 9/24/15
This Python file is a code skeleton Lab 6 which calculates the rigid body transform
given a rotation / translation and computes the twist from rigid body transform.
When you think you have the me... | AravindK95/ee106b | project1/src/lab1/src/exp_quat_func.py | Python | mit | 7,708 | 0.018422 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | reminisce/mxnet | python/mxnet/symbol/numpy_extension/__init__.py | Python | apache-2.0 | 996 | 0 |
# A SCons tool for R scripts
#
# Copyright (c) 2014 Kendrick Boyd. This is free software. See LICENSE
# for details.
"""
Basic test of producing output using save.
"""
import TestSCons
test = TestSCons.TestSCons()
# Add scons_r tool to test figure.
test.file_fixture('../__init__.py', 'site_scons/site_tools/scons_r/... | kboyd/scons_r | test/basic.py | Python | bsd-2-clause | 596 | 0.001678 |
from django.shortcuts import render_to_response
from django.template import RequestContext
from markitup import settings
from markitup.markup import filter_func
from markitup.sanitize import sanitize_html
def apply_filter(request):
cleaned_data = sanitize_html(request.POST.get('data', ''), strip=True)
markup ... | thoslin/django-markitup | markitup/views.py | Python | bsd-3-clause | 527 | 0.00759 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | aldian/tensorflow | tensorflow/python/keras/applications/xception.py | Python | apache-2.0 | 13,084 | 0.006649 |
from __future__ import absolute_import, division, print_function
class _slice(object):
""" A hashable slice object
>>> _slice(0, 10, None)
0:10
"""
def __init__(self, start, stop, step):
self.start = start
self.stop = stop
self.step = step
def __hash__(self):
r... | mrocklin/blaze | blaze/expr/utils.py | Python | bsd-3-clause | 1,782 | 0.001684 |
#!/usr/bin/env python
__author__ = 'Adam R. Smith, Michael Meisinger, Dave Foster <dfoster@asascience.com>'
import threading
import traceback
import gevent
from gevent import greenlet, Timeout
from gevent.event import Event, AsyncResult
from gevent.queue import Queue
from pyon.core import MSG_HEADER_ACTOR
from pyon.... | scionrep/scioncc | src/pyon/ion/process.py | Python | bsd-2-clause | 27,034 | 0.005401 |
#! /usr/bin/python
# Joe Deller 2014
# Finding out where we are in minecraft
# Level : Beginner
# Uses : Libraries, variables, functions
# Minecraft worlds on the Raspberry Pi are smaller than
# other minecraft worlds, but are still pretty big
# So one of the first things we need to learn to do
# is find out where w... | joedeller/pymine | whereamiV2.py | Python | mit | 3,643 | 0.000549 |
from pySDC import CollocationClasses as collclass
import numpy as np
from ProblemClass import sharpclaw
#from examples.sharpclaw_burgers1d.TransferClass import mesh_to_mesh_1d
from pySDC.datatype_classes.mesh import mesh, rhs_imex_mesh
from pySDC.sweeper_classes.imex_1st_order import imex_1st_order
import pySDC.Meth... | torbjoernk/pySDC | examples/advection_2d_explicit/playground.py | Python | bsd-2-clause | 2,543 | 0.009044 |
# ====================================================================
# 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 re... | owenmorris/pylucene | test/test_PositionIncrement.py | Python | apache-2.0 | 11,319 | 0.002297 |
# parsetab.py
# This file is automatically generated. Do not edit.
_tabversion = '3.2'
_lr_method = 'LALR'
_lr_signature = '\x91\x95\xa5\xf7\xe0^bz\xc0\xf4\x04\xf9Z\xebA\xba'
_lr_action_items = {'NAME':([0,2,5,7,11,12,13,14,],[1,8,8,8,8,8,8,8,]),')':([3,8,9,10,16,17,18,19,20,],[-9,-10,-7,16,-8,-4,-3,-5,-6,]),'(... | quchunguang/test | testpy/parsetab.py | Python | mit | 2,575 | 0.133592 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.