text stringlengths 4 1.02M | meta dict |
|---|---|
"""
This example demonstrates the use of the Zookeeper job store.
On each run, it adds a new alarm that fires after ten seconds.
You can exit the program, restart it and observe that any previous alarms that have not fired yet
are still active. Running the example with the --clear switch will remove any existing alarms... | {
"content_hash": "2a884d93babda09f9c81ae47b01e43b6",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 97,
"avg_line_length": 34.45454545454545,
"alnum_prop": 0.6965699208443272,
"repo_name": "srault95/apscheduler",
"id": "12b3e42c12ccfdc2424832f241f48f4bc79315b4",
"size": "... |
import os
import os.path as osp
import numpy as np
import grasp_fusion_lib
from grasp_fusion_lib.contrib import grasp_fusion
def main():
dataset_dir = grasp_fusion.datasets.PinchDataset.root_dir
print('Dataset dir: {}'.format(dataset_dir))
heightmap_color_dir = osp.join(dataset_dir, 'color-input')
... | {
"content_hash": "ab40b35cc9dd886248b1c581e198a0ba",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 77,
"avg_line_length": 32.40983606557377,
"alnum_prop": 0.6125442589782498,
"repo_name": "pazeshun/jsk_apc",
"id": "82ed453a66f9823491447e0e558f9a9d59fbd89b",
"size": "2000... |
"""
Main Logic of the svnmailer
===========================
This module is the central core of the svnmailer. It dispatches all work to be
done. It contains just one class (L{Main}), which reads the config file while
it is initialized. When the C{Main.run()} method is called, it selects the
groups to be notified, the ... | {
"content_hash": "f499dc7f9f530c469669921a7ca039c2",
"timestamp": "",
"source": "github",
"line_count": 410,
"max_line_length": 80,
"avg_line_length": 34.421951219512195,
"alnum_prop": 0.5543824842343938,
"repo_name": "danielshahaf/svnmailer-debian",
"id": "66d84c2efa5ee41a0b4fdace55b7431c8473dcfb",
... |
from __future__ import absolute_import
from __future__ import print_function
import struct
from collections import OrderedDict
from collections.abc import Mapping, Sequence
from enum import Enum
TLV_TYPE_SIGNED_INTEGER = 0x00
TLV_TYPE_UNSIGNED_INTEGER = 0x04
TLV_TYPE_BOOLEAN = 0x08
TLV_TYPE_FLOATING_POINT_NUMBER = 0x... | {
"content_hash": "344edb384f669180c6137333e96a71ed",
"timestamp": "",
"source": "github",
"line_count": 708,
"max_line_length": 150,
"avg_line_length": 39.54661016949152,
"alnum_prop": 0.569270331083253,
"repo_name": "project-chip/connectedhomeip",
"id": "5665c5e2a4f46bead00fac3e7447328611d4e58a",
... |
"""
Copyright (c) 2011, 2012, Regents of the University of California
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this l... | {
"content_hash": "aa7a9ff246841f47bb8d00274b62bd9d",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 81,
"avg_line_length": 45.146341463414636,
"alnum_prop": 0.6335314244552495,
"repo_name": "tectronics/smap-data",
"id": "628b0d2839e64ac2e25ffbf55b4c2ee58670e14c",
"size":... |
from flask import render_template, request, jsonify
from . import main
@main.app_errorhandler(403)
def forbidden(e):
if request.accept_mimetypes.accept_json and \
not request.accept_mimetypes.accept_html:
response = jsonify({'error': 'forbidden'})
response.status_code = 403
ret... | {
"content_hash": "a9488678020d5595858457f1ec304f82",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 62,
"avg_line_length": 31.8125,
"alnum_prop": 0.6699410609037328,
"repo_name": "NilsGuo/nilsblog",
"id": "c599320fdc5a1cf5371188238f6c047e8ddb3869",
"size": "1041",
"bina... |
"""
mfdrn module. Contains the ModflowDrn class. Note that the user can access
the ModflowDrn class as `flopy.modflow.ModflowDrn`.
Additional information for this MODFLOW package can be found at the `Online
MODFLOW Guide
<http://water.usgs.gov/ogw/modflow/MODFLOW-2005-Guide/index.html?drn.htm>`_.
"""
import numpy as... | {
"content_hash": "bb674cebfbab5761b7b64dbc1e8806d0",
"timestamp": "",
"source": "github",
"line_count": 329,
"max_line_length": 97,
"avg_line_length": 30.97872340425532,
"alnum_prop": 0.5315934065934066,
"repo_name": "jentjr/flopy",
"id": "32f6e7992bee58e2632d220e5a60d0b7c52489e9",
"size": "10192",... |
class HaltStateException(Exception):
"""
Exception thrown when trying to continue execution from halt state
"""
pass
#
#
class UnsetTapeException(Exception):
"""
Exception thrown when the tape is not set
"""
pass
#
#
class InvalidSymbolException(Exception):
"""
Exception thrown... | {
"content_hash": "35af376408630f8961cd5115292bc131",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 72,
"avg_line_length": 17.966666666666665,
"alnum_prop": 0.6623376623376623,
"repo_name": "jainpranav/Turing_Machine_Simulator",
"id": "fa3b3d64a1813a3fe2362939554203db235f98... |
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
# lon_0 is central longitude of projection.
# resolution = 'c' means use crude resolution coastlines.
m = Basemap(projection='vandg',lon_0=0,resolution='c')
m.drawcoastlines()
m.fillcontinents(color='coral',lake_color='aqua')
# ... | {
"content_hash": "20e91e609cb063d8b9e1115ced534670",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 57,
"avg_line_length": 37.142857142857146,
"alnum_prop": 0.7596153846153846,
"repo_name": "guziy/basemap",
"id": "03db2a3947a5d2c26fc0a15e4271f09c1e12bab3",
"size": "520",
... |
"""A setup file for PIP pacakge.
Usage:
python setup.py bdist_wheel
"""
import setuptools
with open('README.md', 'r') as f:
LONG_DESCRIPTION = f.read()
setuptools.setup(
name='prog_edu_assistant_tools',
version='0.3.1',
author='Salikh Zakirov',
author_email='salikh@gmail.com',
descriptio... | {
"content_hash": "b75f332be180b560d8281fba2ce15c34",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 99,
"avg_line_length": 27.34375,
"alnum_prop": 0.6571428571428571,
"repo_name": "google/prog-edu-assistant",
"id": "70038ed3f9b9c83add25accae8b73e623e8abec0",
"size": "875"... |
from django.contrib.auth.models import User
from django.db import models
class TestManager(models.Manager):
def test(self, test):
return {
"test_name": test.name
}
class Test(models.Model):
'''
Holds meta information about an Account, not used to login.
'''
objects ... | {
"content_hash": "ddf131322fd33a501c1cc9e24327a757",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 63,
"avg_line_length": 22.65,
"alnum_prop": 0.6578366445916115,
"repo_name": "dborstelmann/hackathon-kit",
"id": "44e9da83ed541ad32abc7581a36acfb7567819b1",
"size": "453",
... |
from app import db
db.Model.metadata.reflect(db.engine)
class Vets(db.Model):
__table__ = db.Model.metadata.tables['vets']
def __repr__(self):
return '<Vet {}>'.format(self.last_name.encode('utf-8'))
class Users(db.Model):
__table__ = db.Model.metadata.tables['users']
def __repr__(self):
... | {
"content_hash": "53e78785f7e156fbfee045ff8d20ee1f",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 106,
"avg_line_length": 31.0990990990991,
"alnum_prop": 0.5240440324449595,
"repo_name": "blahu/v",
"id": "783880ebd112d7a89b201c29c8561f7e5cc84a02",
"size": "3452",
"bi... |
import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.electric_load_center import GeneratorMicroChp
log = logging.getLogger(__name__)
class TestGeneratorMicroChp(unittest.TestCase):
def setUp(self):
self.fd, self.path ... | {
"content_hash": "2d2ae254794ebbcc010041e9e4beb90d",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 119,
"avg_line_length": 43.02857142857143,
"alnum_prop": 0.6882470119521913,
"repo_name": "rbuffat/pyidf",
"id": "98366695ad0a28ee2c5077bdfd87ff192fa69142",
"size": "3012",... |
from __future__ import absolute_import
import sys
import types
from contextlib import contextmanager
from kombu.utils.encoding import str_to_bytes
from celery import signature
from celery import states
from celery import group
from celery.backends.cache import CacheBackend, DummyClient
from celery.exceptions import... | {
"content_hash": "9be3b73765d5d01c43c279b980ca075d",
"timestamp": "",
"source": "github",
"line_count": 253,
"max_line_length": 79,
"avg_line_length": 36.426877470355734,
"alnum_prop": 0.5861545138888888,
"repo_name": "sunze/py_flask",
"id": "051760a8def8d008c1ea5a738f3e3dd7283d40da",
"size": "9216... |
import sys
import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General conf... | {
"content_hash": "953f81bc7ceb69961f04b229199b7f92",
"timestamp": "",
"source": "github",
"line_count": 244,
"max_line_length": 79,
"avg_line_length": 31.85655737704918,
"alnum_prop": 0.7078348128135855,
"repo_name": "newnon/PyTexturePacker",
"id": "72bd2b15eebd451a4fa4afc6a5a128946e984788",
"size"... |
from copy import deepcopy
from typing import Any, Awaitable, TYPE_CHECKING
from msrest import Deserializer, Serializer
from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from .. import models
from ._configuration import ContainerRegistryManagementClientConfi... | {
"content_hash": "e1bbd9aff429bda5849ac67a4f15a955",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 135,
"avg_line_length": 46.55670103092783,
"alnum_prop": 0.7174490699734278,
"repo_name": "Azure/azure-sdk-for-python",
"id": "b50cba9a5905ba075cd1634ddb93975d501a110c",
"s... |
from __future__ import absolute_import
import copy
from django import forms
from django.test import TestCase
from widgy.models.links import (
link_registry, get_link_field_from_model, LinkFormMixin, LinkFormField,
get_composite_key, convert_linkable_to_choice, LinkRegistry, LinkField
)
from ..models import (... | {
"content_hash": "cffa40a88971998182fe8ce63c764946",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 92,
"avg_line_length": 32.858333333333334,
"alnum_prop": 0.6398681207202638,
"repo_name": "j00bar/django-widgy",
"id": "f87ef3d99d209475c016e3276936ce67b3b3895b",
"size": ... |
import click
from flask.ext.script import Manager
from shady import create_app, app
manager = Manager(app)
@manager.command
def runserver():
"Runs the App"
create_app()
app.run(host = app.config['SERVE_HOST'],
port = app.config['SERVE_PORT'],
threaded = app.config['THREADED'])
if _... | {
"content_hash": "19a8f21eef76415ef7071c1143cec0e2",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 46,
"avg_line_length": 21.11764705882353,
"alnum_prop": 0.6295264623955432,
"repo_name": "PrashntS/shady-triangles",
"id": "e8e771e16655679714b8f32ad4248d66c70a0059",
"size... |
from __future__ import absolute_import
from collections import OrderedDict
from horizon.utils.memoized import memoized
from openstack_dashboard.api import neutron
from openstack_dashboard.contrib.developer.profiler import api as profiler
neutronclient = neutron.neutronclient
class IKEPolicy(neutron.NeutronAPIDict... | {
"content_hash": "4eab9850faaa764ba20c5a43f66e220d",
"timestamp": "",
"source": "github",
"line_count": 383,
"max_line_length": 79,
"avg_line_length": 38.0443864229765,
"alnum_prop": 0.6565781346510191,
"repo_name": "kogotko/carburetor",
"id": "81e11302d014c62754b059fe530f4ab2198a067e",
"size": "15... |
import os
import sqlite3
from unittest import TestCase
from contextlib2 import ExitStack
from logbook import NullHandler, Logger
from six import with_metaclass, iteritems
from toolz import flip
import pandas as pd
import responses
from .core import (
create_daily_bar_data,
create_minute_bar_data,
make_sim... | {
"content_hash": "ec6cc9d07845a2a9b8002149881b0a00",
"timestamp": "",
"source": "github",
"line_count": 1554,
"max_line_length": 79,
"avg_line_length": 36.53281853281853,
"alnum_prop": 0.6430987106320016,
"repo_name": "enigmampc/catalyst",
"id": "56a0b4b1febfdd5e2f354f5a9f27277433cc7a77",
"size": "... |
"""Showcase what the output of pymunk.pyglet_util draw methods will look like.
See pygame_util_demo.py for a comparison to pygame.
"""
__docformat__ = "reStructuredText"
import pyglet
import pymunk
import pymunk.pyglet_util
from .shapes_for_draw_demos import fill_space
window = pyglet.window.Window(1000, 700, vsy... | {
"content_hash": "a8262475d7139a9006380523b0483ab0",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 85,
"avg_line_length": 21.767857142857142,
"alnum_prop": 0.682526661197703,
"repo_name": "viblo/pymunk",
"id": "f664d256003364b0fb65da1cc30a368f250bd495",
"size": "1219",
... |
from astropy.io import fits
import numpy as np
import os as os
from . import drizzle_position as dp
from . import acs_determine_focus as adf
from . import acs_3dpsf as acs_3dpsf
from scipy.io.idl import readsav
from . import rotate_moments as rm
import copy as cp
from . import directories
import sys
from . import getI... | {
"content_hash": "0a11fe0cef18a69398a58b4f755e2d8b",
"timestamp": "",
"source": "github",
"line_count": 415,
"max_line_length": 104,
"avg_line_length": 34.151807228915665,
"alnum_prop": 0.5972624003386722,
"repo_name": "davidharvey1986/pyRRG",
"id": "09321e17e23c9febaead2726403b927bf6b60b61",
"size... |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from .. import models
class ResourceSkusOperations(object):
"""ResourceSkusOperations operations.
:param client: Client for service requests.
:param config: Configuration of service client.
... | {
"content_hash": "6e227238b76155cae4f1ce0ad388ab1f",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 144,
"avg_line_length": 39.88172043010753,
"alnum_prop": 0.6268535993529253,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "a6b8de4df8193352e619b7d72f1538bb561a9257",
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy
import argparse
import sys
import json
from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
import argparse
# Import data
mnist = input_data.read_data_sets('tmp... | {
"content_hash": "30e5f8d9e67392ce5985f3aad5332821",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 103,
"avg_line_length": 27.804597701149426,
"alnum_prop": 0.6754857379082265,
"repo_name": "jfrancis71/TensorFlowApps",
"id": "b2d7839efd4490cc4572e4cd4ff033247bba258b",
"s... |
import logging
from absl import flags
from absl.testing import absltest
from google.protobuf import json_format
from framework import xds_k8s_testcase
from framework import xds_url_map_testcase
from framework.helpers import skips
logger = logging.getLogger(__name__)
flags.adopt_module_key_flags(xds_k8s_testcase)
# ... | {
"content_hash": "56ec8df7cc503e562372f6b658d959b6",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 99,
"avg_line_length": 41.75454545454546,
"alnum_prop": 0.6383627258872197,
"repo_name": "ejona86/grpc",
"id": "4e76b03fc2fed350c4b384a5c8de6f75a538b1e7",
"size": "5170",
... |
from PySide import QtCore, QtGui
class Ui_genesis_mwin(object):
def setupUi(self, genesis_mwin):
genesis_mwin.setObjectName("genesis_mwin")
genesis_mwin.resize(1009, 765)
self.central_widget = QtGui.QWidget(genesis_mwin)
self.central_widget.setObjectName("central_widget")
se... | {
"content_hash": "5e7d157ecf5bae9e28fae5f3f699c84f",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 139,
"avg_line_length": 55.63291139240506,
"alnum_prop": 0.6976109215017064,
"repo_name": "JukeboxPipeline/jukebox-core",
"id": "aceb2b0199341b84150b62785fe204f72a830b1c",
... |
"""
SchedulerOptions monitors a local .json file for changes and loads
it if needed. This file is converted to a data structure and passed
into the filtering and weighing functions which can use it for
dynamic configuration.
"""
import datetime
import json
import os
from oslo.config import cfg
from cinder.openstack.... | {
"content_hash": "ce34d6a8791573f27a6866bb4afde937",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 76,
"avg_line_length": 32.17777777777778,
"alnum_prop": 0.6294889502762431,
"repo_name": "github-borat/cinder",
"id": "0d405fdf1101411eaca0569693d884b7a75111a6",
"size": "3... |
__author__ = 'yinjun'
"""
Definition of TreeNode:
class TreeNode:
def __init__(self, val):
this.val = val
this.left, this.right = None, None
Example of iterate a tree:
iterator = Solution(root)
while iterator.hasNext():
node = iterator.next()
do something for node
"""
class Solution:
#... | {
"content_hash": "bf3479dd750441f76dc1f3a63566a089",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 70,
"avg_line_length": 26.03846153846154,
"alnum_prop": 0.5022156573116692,
"repo_name": "shootsoft/practice",
"id": "a947193d13ede649d002a442fedfd7011007d97a",
"size": "20... |
""" Messaging API
API to send messages:
- currently SMS, Email & Twitter
Messages get sent to the Outbox (& Log)
From there, Cron tasks collect them & send them
@copyright: 2009-2012 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any per... | {
"content_hash": "c78c5bec9252aaf8634695ae431b3572",
"timestamp": "",
"source": "github",
"line_count": 1783,
"max_line_length": 124,
"avg_line_length": 40.08020190689849,
"alnum_prop": 0.4456431999776108,
"repo_name": "vgupta6/Project-2",
"id": "54febc79f745f30d56da3d21dbebfc13f58c650f",
"size": "... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('curation', '0015_auto_20160725_1102'),
]
operations = [
migrations.AddField(
model_name='video',
name='thumbnail',
... | {
"content_hash": "1a7a1e68ce30db5d3dfa3ea450dd9fa2",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 85,
"avg_line_length": 23,
"alnum_prop": 0.606280193236715,
"repo_name": "webisteme/instavision",
"id": "f2a22430d3f0983696d91686529356967e17fce6",
"size": "438",
"binary... |
from JumpScale9 import j
import time
import libtmux as tmuxp
import os
JSBASE = j.application.jsbase_get_class()
# from .Pane import Pane
from .Window import Window
class Session(JSBASE):
def __init__(self, session):
# if j.core.db is None:
# j.clients.redis.core_start()
# j.core... | {
"content_hash": "0eddd242e5da45249dd39fa20f33f491",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 99,
"avg_line_length": 29.85,
"alnum_prop": 0.5728643216080402,
"repo_name": "Jumpscale/core9",
"id": "3be7165eede63bb00be5f8878bd4e11894b3713b",
"size": "2389",
"binary"... |
"""
screen_size property
"""
from rebulk.remodule import re
from rebulk import Rebulk, Rule, RemoveMatch
from ..common.validators import seps_surround
from ..common import dash, seps
def screen_size():
"""
Builder for rebulk object.
:return: Created Rebulk object
:rtype: Rebulk
"""
def confli... | {
"content_hash": "5fd56fe89078852f8382cd4289eb8df8",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 119,
"avg_line_length": 40.075471698113205,
"alnum_prop": 0.565442561205273,
"repo_name": "pannal/Subliminal.bundle",
"id": "b7732ab61c7878f23a55186477d2bc6a8210c1bd",
"si... |
import json
import urlparse
from django.conf import settings
from django.utils.http import urlencode
import requests
from django_statsd.clients import statsd
import olympia.core.logger
from olympia import amo
from olympia.addons.models import Addon
from . import data
log = olympia.core.logger.getL... | {
"content_hash": "3accdf714fa309c16b8135b17c4e8ed4",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 77,
"avg_line_length": 35.61818181818182,
"alnum_prop": 0.6615620214395099,
"repo_name": "tsl143/addons-server",
"id": "6b411e6d233aea6748d522a3efaa6e1b12a9f081",
"size": "... |
import os
from . import errors
from .ssladapter import ssladapter
class TLSConfig(object):
cert = None
ca_cert = None
verify = None
ssl_version = None
def __init__(self, client_cert=None, ca_cert=None, verify=None,
ssl_version=None, assert_hostname=None,
assert_... | {
"content_hash": "5a41a9e9ffc1ad09cb788a9fb75ec24f",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 77,
"avg_line_length": 34.55714285714286,
"alnum_prop": 0.5812319140140554,
"repo_name": "vitalyisaev2/docker-py",
"id": "83b0ff7ef1e545d5f60ea8a1c2509bae2954adcf",
"size":... |
<<<<<<< HEAD
<<<<<<< HEAD
from test import support
import unittest
import dummy_threading as _threading
import time
class DummyThreadingTestCase(unittest.TestCase):
class TestThread(_threading.Thread):
def run(self):
global running
global sema
global mutex
... | {
"content_hash": "5316368ee58196143bcdf28d45c6dc01",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 79,
"avg_line_length": 28.085858585858585,
"alnum_prop": 0.5358748426541989,
"repo_name": "ArcherSys/ArcherSys",
"id": "eab66baeb316528ada221a7b62bd24b8560cdc2e",
"size": ... |
import tempfile
import unittest
#from .log import *
#from .parsed_trace_events import *
from log import *
from parsed_trace_events import *
class TraceTest(unittest.TestCase):
def __init__(self, *args):
"""
Infrastructure for running tests of the tracing system.
Does not actually run any tests. Look a... | {
"content_hash": "50acc8f991fb7ba5b559196a0b689771",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 77,
"avg_line_length": 22.77777777777778,
"alnum_prop": 0.6487804878048781,
"repo_name": "SummerLW/Perf-Insight-Report",
"id": "7047e0eae862b2e9ab008321b0a1ec793694cc00",
"... |
"""
@authors: Sergei Garbuzov
@status: Development
@version: 1.1.0
"""
import time
import json
from pysdn.controller.controller import Controller
from pysdn.openflowdev.ofswitch import OFSwitch
from pysdn.common.status import STATUS
from pysdn.common.utils import load_dict_from_file
def of_demo_2():
f = "cfg... | {
"content_hash": "d4a52805714a31fe86a3ee7b48198f4a",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 73,
"avg_line_length": 29.076190476190476,
"alnum_prop": 0.5312807075008189,
"repo_name": "brocade/pysdn",
"id": "251d17835d3ad06fc0e75b086cd507c45f3cfe9f",
"size": "4627"... |
"""
The MIT License (MIT)
Copyright (c) 2015-2016 Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, ... | {
"content_hash": "a34386b3699e3e016a0e30d9aea60c68",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 91,
"avg_line_length": 32.53061224489796,
"alnum_prop": 0.5895545796737767,
"repo_name": "4rchenix/paradis",
"id": "76b8bf06d964c9e5591330752a9dab1ca0594da4",
"size": "640... |
"""Test library of Hidden Linear Function circuits."""
import unittest
import numpy as np
from qiskit.test.base import QiskitTestCase
from qiskit.circuit import QuantumCircuit
from qiskit.circuit.exceptions import CircuitError
from qiskit.circuit.library import HiddenLinearFunction
from qiskit.quantum_info import Ope... | {
"content_hash": "cd2865b65708604639dc3205ccfb36e7",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 82,
"avg_line_length": 37.0188679245283,
"alnum_prop": 0.6416921508664628,
"repo_name": "QISKit/qiskit-sdk-py",
"id": "c971c560827e310ffc5594096c9a967ce3061bf3",
"size": "2... |
"""Tests that walk through Course Builder pages."""
__author__ = 'Mike Gainer (mgainer@google.com)'
import cgi
import re
from common import crypto
from common import utils as common_utils
from controllers import sites
from models import courses
from models import models
from models import transforms
from modules.das... | {
"content_hash": "28dd143748478391b7922aefeb17a9d7",
"timestamp": "",
"source": "github",
"line_count": 424,
"max_line_length": 80,
"avg_line_length": 42.58254716981132,
"alnum_prop": 0.6239822763777347,
"repo_name": "wavemind/gcb17ml",
"id": "efc12927a0226f44a7c51a34790b195d25c73802",
"size": "186... |
from unittest import mock
from neutron_lib.api.definitions import port_security
from neutron_lib.plugins import constants
from neutron_lib.plugins import directory
from neutron.db import portsecurity_db as pd
from neutron.db import portsecurity_db_common as pdc
from neutron.tests import base
common = pdc.PortSecurit... | {
"content_hash": "0ef19eaeb2c4453f01069dde89cd19f9",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 78,
"avg_line_length": 35.25,
"alnum_prop": 0.6907801418439716,
"repo_name": "mahak/neutron",
"id": "a89d856518881c0c5a820c50a747c4c58ce30454",
"size": "1983",
"binary": ... |
__author__ = "Sven Kreiss, Kyle Cranmer"
__version__ = "0.1"
__description__ = """
Creates a counting model using HistFactory for the H2ph, HZZ4l and HWWlvlv
channels in ATLAS.
The numbers are taken from these papers and conf notes:
- http://arxiv.org/pdf/1307.1427v1.pdf (combination paper)
- https://cds.cern.ch/rec... | {
"content_hash": "f2ce78c50712134f2e9e12ffd47fe524",
"timestamp": "",
"source": "github",
"line_count": 678,
"max_line_length": 127,
"avg_line_length": 37.727138643067846,
"alnum_prop": 0.731029360021893,
"repo_name": "svenkreiss/decouple",
"id": "c17d46cf2285dd91fbedf1f651874ca16ba71625",
"size": ... |
from simplekv._compat import BytesIO
from simplekv.memory import DictStore
from simplekv.decorator import PrefixDecorator
import pytest
from basic_store import BasicStore
class TestPrefixDecorator(BasicStore):
@pytest.fixture(params=[
'short_',
'loooooooooooooooooooooooooooooooooooooooooooooooooo... | {
"content_hash": "3250277f7e513cd6b6395172e96033f1",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 75,
"avg_line_length": 31.333333333333332,
"alnum_prop": 0.6145662847790507,
"repo_name": "fmarczin/simplekv",
"id": "63a9a2cc8669f3b87492eebc468b2aa5b5ae6215",
"size": "24... |
class MidiOutStream:
"""
MidiOutstream is Basically an eventhandler. It is the most central
class in the Midi library. You use it both for writing events to
an output stream, and as an event handler for an input stream.
This makes it extremely easy to take input from one stream and
... | {
"content_hash": "4039d2767524f78e22adb5830e7fbbfc",
"timestamp": "",
"source": "github",
"line_count": 470,
"max_line_length": 74,
"avg_line_length": 19.848936170212767,
"alnum_prop": 0.47850787865794836,
"repo_name": "feynmanliang/bachbot",
"id": "c128fa6cbbdd8281a7c90ac00d1c2cdd4f858340",
"size"... |
import sys
import urlparse as urlparse_module
from urlparse import parse_qs, urlparse, urlunparse
import zmq
from botocore.session import get_session
from cs.eyrie import Vassal, ZMQChannel, script_main
from cs.eyrie.interfaces import IKafka
from cs.eyrie.transistor import (
CLOSED, TRANSIENT_ERRORS,
AsyncSQSC... | {
"content_hash": "95daa0577d167b55e7570b378dd424e4",
"timestamp": "",
"source": "github",
"line_count": 418,
"max_line_length": 85,
"avg_line_length": 32.46650717703349,
"alnum_prop": 0.517500552649031,
"repo_name": "CrowdStrike/cs.eyrie",
"id": "507d84d21d064e5b790e5a7e01c3a4f77af266af",
"size": "... |
import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
# sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ... | {
"content_hash": "634085306f43f19594c06869268da67d",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 79,
"avg_line_length": 31.91269841269841,
"alnum_prop": 0.6965928873414573,
"repo_name": "itnihao/thriftpy",
"id": "35c08a9bd624a0370eb66caab0b5d728dd61cf9d",
"size": "847... |
import unittest
from gotorrent import tracker
from pyactor.context import set_context, create_host, sleep, shutdown
class TestTracker(unittest.TestCase):
def setUp(self):
#Gets executed before every test
set_context('green_thread')
self.h = create_host()
self.t = self.h.spawn('tra... | {
"content_hash": "72cf86755d76e772986b654f430739a3",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 87,
"avg_line_length": 33.391304347826086,
"alnum_prop": 0.6373697916666666,
"repo_name": "christianzanger/sd-gotorrent",
"id": "44725e86bdb227d33885ca46a0771b7fbb2e45a5",
... |
from django.db import models
from django.contrib.localflavor.mk.models import (
MKIdentityCardNumberField, MKMunicipalityField, UMCNField)
class MKPerson(models.Model):
first_name = models.CharField(max_length = 20)
last_name = models.CharField(max_length = 20)
umcn = UMCNField()
id_number = MKIden... | {
"content_hash": "4603cd819adc5c82e15a527d4f7cb7b7",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 62,
"avg_line_length": 36.142857142857146,
"alnum_prop": 0.7312252964426877,
"repo_name": "mitsuhiko/django",
"id": "b79239a9bfadc180be1f8d7bdf7cff89528839bf",
"size": "506... |
"""A library with tools that processes simulation data."""
from typing import Sequence, Tuple
import numpy as np
def coordinates_to_indices(
locations: np.ndarray,
domain_size: Sequence[float],
mesh_size_local: Sequence[int],
partition: Sequence[int],
halo_width: int,
) -> Tuple[Sequence[int], n... | {
"content_hash": "5f70e92422705e68580bf85be3009198",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 80,
"avg_line_length": 36.622950819672134,
"alnum_prop": 0.6799462846911369,
"repo_name": "google-research/swirl-lm",
"id": "f298c0703684dfdafe499ebadb7033131e26101b",
"siz... |
from __future__ import unicode_literals
from django.db import migrations
def set_null_to_blank(queryset, fields):
for element in queryset:
for field in fields:
value = getattr(element, field)
if value is None:
setattr(element, field, '')
element.save()
de... | {
"content_hash": "b5845d6c1cdd4db3f594fc23c42fbcc7",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 57,
"avg_line_length": 21.542857142857144,
"alnum_prop": 0.5848806366047745,
"repo_name": "rdmorganiser/rdmo",
"id": "fcb3e7d16a172e3de031a5459ce7436aec1fef8e",
"size": "82... |
"""Blocking and non-blocking HTTP client interfaces.
This module defines a common interface shared by two implementations,
``simple_httpclient`` and ``curl_httpclient``. Applications may either
instantiate their chosen implementation class directly or use the
`AsyncHTTPClient` class from this module, which selects an... | {
"content_hash": "8a3cb2ff790e4f7776e9deb4dfd8340c",
"timestamp": "",
"source": "github",
"line_count": 520,
"max_line_length": 83,
"avg_line_length": 40.68269230769231,
"alnum_prop": 0.6328527534861735,
"repo_name": "bufferx/tornado",
"id": "b58a834854936547dbdba904f7697486b113bc52",
"size": "2115... |
from __future__ import annotations
import warnings
from typing import Any, Iterable, Mapping, Sequence, SupportsAbs
from airflow.providers.common.sql.operators.sql import (
SQLCheckOperator,
SQLExecuteQueryOperator,
SQLIntervalCheckOperator,
SQLValueCheckOperator,
)
class SnowflakeOperator(SQLExecut... | {
"content_hash": "ff2a857a25ab36418bfb31e5741e7d7e",
"timestamp": "",
"source": "github",
"line_count": 322,
"max_line_length": 97,
"avg_line_length": 41.01863354037267,
"alnum_prop": 0.6466535433070866,
"repo_name": "nathanielvarona/airflow",
"id": "2546ddfb5eec570c284e8abee35c1c7925c67bd5",
"size... |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrest.polling import LROPoller, NoPolling
from msrestazure.polling.arm_polling import ARMPolling
from .. import models
class StorageAccountCredentialsOperations(object):
"""StorageAccountCredential... | {
"content_hash": "3f1183954814e1b2f9705ec9b14196a0",
"timestamp": "",
"source": "github",
"line_count": 354,
"max_line_length": 211,
"avg_line_length": 47.432203389830505,
"alnum_prop": 0.6546959680781371,
"repo_name": "Azure/azure-sdk-for-python",
"id": "60a5e1ab2367689738c48c05d631e6e3b6e74cff",
... |
import http.client, urllib.parse
def http_request(url, data = None, method = "GET", headers = {}):
parsed = urllib.parse.urlparse(url)
scheme, netloc, path = parsed.scheme, parsed.netloc, parsed.path
if not method:
method = "GET"
method = method.upper()
if not headers:
headers = {}
if data:
data = u... | {
"content_hash": "49c32cea3504850d17a311fa5667962f",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 65,
"avg_line_length": 23.681159420289855,
"alnum_prop": 0.6707466340269278,
"repo_name": "MrVallentin/http_request",
"id": "08f98d32f073c8a759a51d5a1b5fc9a27ec1c07c",
"siz... |
'''
Text Input
==========
.. versionadded:: 1.0.4
.. image:: images/textinput-mono.jpg
.. image:: images/textinput-multi.jpg
The :class:`TextInput` widget provides a box for editable plain text.
Unicode, multiline, cursor navigation, selection and clipboard features
are supported.
The :class:`TextInput` uses two d... | {
"content_hash": "59d9ba667640fe5976712396cfce40ed",
"timestamp": "",
"source": "github",
"line_count": 3175,
"max_line_length": 79,
"avg_line_length": 35.37732283464567,
"alnum_prop": 0.5481246049339851,
"repo_name": "jegger/kivy",
"id": "c25b77500056f981c9112db50f0544a6cb8ebe67",
"size": "112349"... |
from django.core.management.base import BaseCommand, CommandError
from django.contrib.gis.utils import add_postgis_srs
class Command(BaseCommand):
args = '<srid>'
help = 'Add Custom SRID'
def handle(self, *args, **options):
srid = args[0]
try:
add_postgis_srs(srid)
... | {
"content_hash": "cdbdbe5c0d39eb30c72b8a97cb3e9185",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 65,
"avg_line_length": 29.375,
"alnum_prop": 0.6127659574468085,
"repo_name": "Ecotrust/COMPASS",
"id": "162d4a3990a0c04ff822f496da76045bd7f3ce6d",
"size": "470",
"binary... |
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Project(models.Model):
area = models.CharField(_('área'), max_length=100, blank=False, null=False)
tema = models.CharField(_('tema'), max_length=200, blank=False, null=False)
descricao = models.CharField(_('descrição... | {
"content_hash": "f9b14ddad9651ae6066384dde66cdd5b",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 101,
"avg_line_length": 53.21153846153846,
"alnum_prop": 0.6787134080231297,
"repo_name": "edsonlb/PoloVota",
"id": "0eef7ec20f95c7dae4588b64dd40b405df20a5f5",
"size": "282... |
from GithubRepoClient import GithubRepoClient
class GithubRepoPool(object):
"""Docstring for GithubRepoPool. """
def __init__(self):
"""TODO: to be defined1. """
self._github_repo_pool = list()
def create_github_repo_client(self, full_name):
"""TODO: Docstring for create_github_... | {
"content_hash": "9fc0e328be5fe4a25db9768d6735e86c",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 61,
"avg_line_length": 25.514285714285716,
"alnum_prop": 0.574468085106383,
"repo_name": "issuequality/issuequality",
"id": "e81c04c5d4bb05265c84fa8ed3e3608130f9889d",
"siz... |
from __future__ import absolute_import
# external
import cybox.common
# internal
import stix
import stix.utils as utils
import stix.bindings.stix_common as stix_common_binding
# relative
from . import vocabs, VocabString
from .identity import Identity
from .structured_text import StructuredTextList
class Informati... | {
"content_hash": "272d02715fadb741089557556ba0455c",
"timestamp": "",
"source": "github",
"line_count": 240,
"max_line_length": 123,
"avg_line_length": 30.6125,
"alnum_prop": 0.6353613719885668,
"repo_name": "chriskiehl/python-stix",
"id": "44d9dfef8aec5c4cfcc74cf89c1a76841c8d2817",
"size": "7452",... |
from arangodb.api import Database, Collection
from arangodb.query.advanced import Query
from arangodb.tests.base import ExtendedTestCase
class AqlQueryTestCase(ExtendedTestCase):
def setUp(self):
self.database_name = 'testcase_aqlquery_123'
self.db = Database.create(name=self.database_name)
... | {
"content_hash": "8d77d1790e08c67873b87248077beced",
"timestamp": "",
"source": "github",
"line_count": 225,
"max_line_length": 78,
"avg_line_length": 27.955555555555556,
"alnum_prop": 0.6039745627980923,
"repo_name": "saeschdivara/ArangoPy",
"id": "e79b9ab0ae0b2f1528a300b9d637d31302d1bd08",
"size"... |
import mock
from neutron import context
from neutron.db import api as db
from neutron.openstack.common import uuidutils
from neutron.plugins.nec.common import config
from neutron.plugins.nec.db import api as ndb
from neutron.plugins.nec.db import models as nmodels # noqa
from neutron.plugins.nec import ofc_manager
fr... | {
"content_hash": "79277b858dd88c1c875c1a0904aaf2b3",
"timestamp": "",
"source": "github",
"line_count": 281,
"max_line_length": 78,
"avg_line_length": 45.95373665480427,
"alnum_prop": 0.6074498567335244,
"repo_name": "beagles/neutron_hacking",
"id": "a163e7382501e6bdf5062f7d345154d15c9fbaa3",
"size... |
import cv2
import numpy as np
import random
import os
from argparse import ArgumentParser
ALPHA = 5
def build_parser():
parser = ArgumentParser()
parser.add_argument('--original', dest='ori', required=True)
parser.add_argument('--image', dest='img', required=True)
parser.add_argument('--re... | {
"content_hash": "28f56c1e54332f32e64e80eacdd55a78",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 68,
"avg_line_length": 29.0188679245283,
"alnum_prop": 0.6027308192457738,
"repo_name": "linyacool/blind-watermark",
"id": "03e8a8d78a5491e1a8855d99ade93661f6947500",
"size... |
"""gcloud dns record-sets export command."""
from googlecloudsdk.core.util import files
from googlecloudapis.apitools.base import py as apitools
from googlecloudsdk.calliope import base
from googlecloudsdk.calliope import exceptions
from googlecloudsdk.core import log
from googlecloudsdk.core import properties
from ... | {
"content_hash": "407ccedc41116e62b07954ff4c2d8228",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 80,
"avg_line_length": 33.45,
"alnum_prop": 0.6659192825112108,
"repo_name": "wemanuel/smry",
"id": "bc9acf6955ea827b30274d5be8caffee7d3c29d9",
"size": "2726",
"binary": ... |
"""Commands for feedback thread and message operations."""
from __future__ import annotations
import datetime
import itertools
from core import feconf
from core.domain import email_manager
from core.domain import feedback_domain
from core.domain import rights_manager
from core.domain import subscription_services
fro... | {
"content_hash": "16a8621c0113a129ebf85a20ae5a1d50",
"timestamp": "",
"source": "github",
"line_count": 1232,
"max_line_length": 80,
"avg_line_length": 39.92613636363637,
"alnum_prop": 0.6688283965927342,
"repo_name": "brianrodri/oppia",
"id": "5d40e7ea1d186ae60589fd1c923fef99abe7c1c4",
"size": "49... |
import functools
import Gaffer
import GafferUI
## A simple PlugValueWidget which just displays the node connected
# to a Plug.
class ConnectionPlugValueWidget( GafferUI.PlugValueWidget ) :
def __init__( self, plug, **kw ) :
self.__frame = GafferUI.Frame( borderWidth = 2 )
GafferUI.PlugValueWidget.__init__( se... | {
"content_hash": "ff4c75b738983f9ded9a0d789e8364b6",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 125,
"avg_line_length": 31.19047619047619,
"alnum_prop": 0.7057251908396946,
"repo_name": "johnhaddon/gaffer",
"id": "a7eff348f2240306420fd9946d6132856ccf856a",
"size": "44... |
import proto # type: ignore
from google.ads.googleads.v10.enums.types import (
response_content_type as gage_response_content_type,
)
from google.ads.googleads.v10.resources.types import batch_job
from google.ads.googleads.v10.services.types import google_ads_service
from google.rpc import status_pb2 # type: ign... | {
"content_hash": "02d62a3839f7bacd3017c973bc153478",
"timestamp": "",
"source": "github",
"line_count": 308,
"max_line_length": 117,
"avg_line_length": 31.123376623376622,
"alnum_prop": 0.6434383475902358,
"repo_name": "googleads/google-ads-python",
"id": "dec4f03c53eda15a4edb1e09b21411d3fb30b675",
... |
import pandas as pd
import os
from sklearn import preprocessing
from ..main import config
import numpy as np
import sys
def get_normalized_features(filename):
filename_train = filename
data_train = pd.read_csv(filename_train)
filename_val = filename.replace("train","val")
filename_test = filename.repla... | {
"content_hash": "ac83d4e87a9bb7fcc1e34fb7067355d9",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 126,
"avg_line_length": 36.76744186046512,
"alnum_prop": 0.6786843769765971,
"repo_name": "ab93/Depression-Identification",
"id": "7f51728f4df1a2c6574fae08c38bbb6910b65707",
... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='notification',
name='queued',
field=mo... | {
"content_hash": "bfaa69fd4e7662855e920b45c9b0f419",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 68,
"avg_line_length": 21.444444444444443,
"alnum_prop": 0.5958549222797928,
"repo_name": "CSchool/SchoolSite",
"id": "cc327d73c0f2912f42cfe0dadbde8a56a2632974",
"size": "4... |
import rospy
from std_msgs.msg import String
def talker():
pub = rospy.Publisher('chatter', String, queue_size=10)
rospy.init_node('talker', anonymous=True)
rate = rospy.Rate(10) # 10hz
while not rospy.is_shutdown():
hello_str = "hello world %s" % rospy.get_time()
rospy.loginfo(hello_st... | {
"content_hash": "4848ee88a555a3ea15c7186304f5d98a",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 59,
"avg_line_length": 26.72222222222222,
"alnum_prop": 0.6112266112266113,
"repo_name": "nvl1109/car_control",
"id": "1957fb4fdcfceb54140724e60d7d168aae1e1e95",
"size": "5... |
from taiga.base.api.permissions import (AllowAny as TruePermissionComponent,
DenyAll as FalsePermissionComponent)
def test_permission_component_composition():
assert (TruePermissionComponent() | TruePermissionComponent()).check_permissions(None, None, None)
assert (True... | {
"content_hash": "8fe582c4c2974ce0f6b5e3721be371dc",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 108,
"avg_line_length": 71.05882352941177,
"alnum_prop": 0.7566225165562914,
"repo_name": "curiosityio/taiga-docker",
"id": "b858252f37c2885ffe05f512a47fc338cbfea49d",
"siz... |
"""add task_reschedule table
Revision ID: 0a2a5b66e19d
Revises: 9635ae0956e7
Create Date: 2018-06-17 22:50:00.053620
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
from airflow.models.base import COLLATION_ARGS
revision = '0a2a5b66e1... | {
"content_hash": "01c9a3d5031351f67bac555504003992",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 102,
"avg_line_length": 32.78082191780822,
"alnum_prop": 0.6661094860008357,
"repo_name": "airbnb/airflow",
"id": "4c572f44ec5a28bed3ff52acc27b999f2d06273e",
"size": "3179"... |
"""Graph actions tests."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import shutil
import tempfile
import tensorflow as tf
from tensorflow.contrib import testing
from tensorflow.contrib.learn.python import learn
from tensorflow.contrib.learn.python.... | {
"content_hash": "3050d1d8785ca6dd8847b90907b4eefc",
"timestamp": "",
"source": "github",
"line_count": 749,
"max_line_length": 86,
"avg_line_length": 43.57276368491322,
"alnum_prop": 0.6335335212648608,
"repo_name": "DCSaunders/tensorflow",
"id": "caacb1928a2d487174164d10c332bc68faa72922",
"size":... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('stuff', '0002_authenticator'),
]
operations = [
migrations.AlterField(
model_name='authenticator',
name='user_id',
... | {
"content_hash": "c53ac85be28a32a6bc94308e56d7fb3d",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 51,
"avg_line_length": 21.842105263157894,
"alnum_prop": 0.5927710843373494,
"repo_name": "hnaoto/CS4501-ISA-Models",
"id": "541c9592e0428452a3729e3af56a973d8a145c1d",
"siz... |
from unittest import TestCase
import watson_developer_cloud
import responses
import pytest
class TestAlchemyLanguageV1(TestCase):
def test_api_key(self):
default_url = 'https://gateway-a.watsonplatform.net/calls'
inited = watson_developer_cloud.AlchemyLanguageV1(url=default_url, api_key='boguskey... | {
"content_hash": "15dbbe64fb76bdc90ab7c33b1203a40f",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 117,
"avg_line_length": 49.529411764705884,
"alnum_prop": 0.5954869358669834,
"repo_name": "ehdsouza/python-sdk",
"id": "e48d7f89ebc655caf24a42d6e0445209227e9f59",
"size": ... |
"""Tests for tensor2tensor.data_generators.program_search."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gzip
import os
import shutil
import tempfile
from builtins import bytes # pylint: disable=redefined-builtin
from tensor2tensor.data_genera... | {
"content_hash": "97fb6af4ae75f9ac91628dd243d0f507",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 80,
"avg_line_length": 37.422680412371136,
"alnum_prop": 0.565564738292011,
"repo_name": "tensorflow/tensor2tensor",
"id": "340b39391241e8536ac5af2e1838662081af5dec",
"size... |
from typing import Any, TYPE_CHECKING
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy
from .._version import VERSION
if TYPE_CHECKING:
# pylint: disable=unused-import,ungro... | {
"content_hash": "313ef3c34baed52e5a34a4851a326e49",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 107,
"avg_line_length": 53.12068965517241,
"alnum_prop": 0.7198961376176566,
"repo_name": "Azure/azure-sdk-for-python",
"id": "f6b04935c913654b96f39f29d8ad4b9e05939e7c",
"s... |
try:
import scipy
except ImportError:
scipy = None
import pytest
from emcee import moves
from .test_proposal import _test_normal, _test_uniform
__all__ = ["test_normal_kde", "test_uniform_kde", "test_nsplits_kde"]
@pytest.mark.skipif(scipy is None, reason="scipy is not available")
def test_normal_kde(**kwa... | {
"content_hash": "9f0972fa82a48f67145b3730001d7cb6",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 69,
"avg_line_length": 25.846153846153847,
"alnum_prop": 0.7083333333333334,
"repo_name": "dfm/emcee",
"id": "5ab06afdfab9506a75a23f566f15de4e65bc6780",
"size": "697",
"b... |
from django.urls import path
from .views import createPaypalPayment, executePaypalPayment
urlpatterns = [
path('create_payment/', createPaypalPayment, name='createPaypalPayment'),
path('execute_payment/', executePaypalPayment, name='executePaypalPayment'),
]
| {
"content_hash": "f088c3baa069753c914e6a5f2c272612",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 80,
"avg_line_length": 33.625,
"alnum_prop": 0.7806691449814126,
"repo_name": "django-danceschool/django-danceschool",
"id": "44bc97dc930f2714df3ab042ae64eee13f84996c",
"siz... |
"""
This is a small demo, showing how to make an object that can be moved around.
It also contains a simple prototype for a "Connector" object
-- a line connecting two other objects
"""
import wx
#ver = 'local'
ver = 'installed'
if ver == 'installed': ## import the installed version
from wx.lib.floatcanvas ... | {
"content_hash": "1e7b75e00aa66d30ed2d5289a5c3707b",
"timestamp": "",
"source": "github",
"line_count": 281,
"max_line_length": 88,
"avg_line_length": 30.373665480427047,
"alnum_prop": 0.5411833626244874,
"repo_name": "dnxbjyj/python-basic",
"id": "40db285852fb2d4097095e881afacbf830df237f",
"size":... |
from django.test import TestCase
# permissions imports
import permissions.utils
# lfc imports
from lfc.models import BaseContent
from lfc.models import Page
from lfc.models import Portal
from lfc.tests.utils import create_request
class ManagerTestCase(TestCase):
"""
"""
def setUp(self):
"""
... | {
"content_hash": "7b491480c3203850829af1a297af03ce",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 79,
"avg_line_length": 29.25581395348837,
"alnum_prop": 0.6359300476947536,
"repo_name": "natea/django-lfc",
"id": "681acbce13e0fab27f334835a4b44a17cd0ae8f0",
"size": "1275... |
"""
WSGI config for thingyproject project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO... | {
"content_hash": "bfe2725489b4da863122b22a3b068789",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 25.1875,
"alnum_prop": 0.7766749379652605,
"repo_name": "Guillaume-Docquier/Thingy",
"id": "9b8bd1ce737d075cd8e4f8de77174218c0c52284",
"size": "403",... |
import mainFile, sys
import time
fp = mainFile.fingerprintsensor()
fp.Open()
while(1):
fp.SetLED(true)
mainFile.delay(1)
fp.SetLED(false)
mainFile.delay(1)
| {
"content_hash": "07a2d635edca3d84c71b7b98cb1c95be",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 33,
"avg_line_length": 19.11111111111111,
"alnum_prop": 0.6918604651162791,
"repo_name": "ashwinahuja/Engineering-Extended-Project---Ashwin-Ahuja",
"id": "8698a1c2e6e6c0dcbed0... |
WTF_CSRF_ENABLED = True
SECRET_KEY = 'secret-key'
SQLALCHEMY_DATABASE_URI = "postgresql://postgres:admin@localhost/flask_blog"
SQLALCHEMY_TRACK_MODIFICATIONS = False
# pagination
POSTS_PER_PAGE = 6
| {
"content_hash": "66dd73bec2dd6abe958c3d2a9a8cfe77",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 76,
"avg_line_length": 28.428571428571427,
"alnum_prop": 0.7738693467336684,
"repo_name": "andrefaranha/flask-blog",
"id": "740bebd5e06db03e4412962717c5830e99352d0e",
"size"... |
from smart_pointer_member import *
def is_new_style_class(cls):
return hasattr(cls, "__class__")
f = Foo()
f.y = 1
if f.y != 1:
raise RuntimeError
b = Bar(f)
b.y = 2
if f.y != 2:
print f.y
print b.y
raise RuntimeError
if b.x != f.x:
raise RuntimeError
if b.z != f.z:
raise RuntimeErro... | {
"content_hash": "3ee0683085280201456984afcaa8d3b0",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 73,
"avg_line_length": 15.413793103448276,
"alnum_prop": 0.6085011185682326,
"repo_name": "DEKHTIARJonathan/BilletterieUTC",
"id": "ce91da2bd77730961c3d713e1e8b3ce4b50e541c",... |
from __future__ import unicode_literals
from django.db import migrations
def create_user_profile(apps, schema_editor):
UserProfile = apps.get_model("ploghubapp", "UserProfile")
User = apps.get_model("auth", "User")
for user in User.objects.all():
user_profile = UserProfile(user=user, about="(empty... | {
"content_hash": "ca84e50c92622e03f0dfe946d340caa0",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 65,
"avg_line_length": 28.15,
"alnum_prop": 0.6714031971580817,
"repo_name": "ploggingdev/ploghub",
"id": "cdb37ca34a040cadc9f3d6580921993e410e7c41",
"size": "636",
"bina... |
from __future__ import print_function
from distutils.core import setup, Extension
import RDConfig
# force the use of g++ please
from distutils import sysconfig
save_init_posix = sysconfig._init_posix
def my_init_posix():
print('my_init_posix: changing gcc to g++')
save_init_posix()
g = sysconfig.get_config_var... | {
"content_hash": "2bc6ed9fb75e212811c0d4177625bb89",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 132,
"avg_line_length": 35.6578947368421,
"alnum_prop": 0.6767527675276753,
"repo_name": "rvianello/rdkit",
"id": "6258f5b45daa1c68dd3f21c19bf81b438a370cde",
"size": "1415"... |
import os
import numpy as np
import tensorflow as tf
from yarll.agents.agent import Agent
from yarll.agents.env_runner import EnvRunner
from yarll.misc.utils import discount_rewards, FastSaver
from yarll.misc.reporter import Reporter
from yarll.misc.network_ops import create_accumulative_gradients_op, add_accumulative... | {
"content_hash": "6116e0ddb3841eb7382eb3fc76ab8b97",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 166,
"avg_line_length": 48.93814432989691,
"alnum_prop": 0.5977459448072466,
"repo_name": "arnomoonens/DeepRL",
"id": "3cd092fcc2a6850973d9f9111bc12973c9bac171",
"size": "... |
"""
"""
__author__ = "hupantingxue(hupantingxue@126.com)"
__version__ = "$v1.0"
__date__ = "$Date: 2014/12/15 15:06"
import sys
import urllib2
import threading
import Queue
import time
from optparse import OptionParser
class ThreadPool(object):
def __init__(self, urlpth, req_number, thread_num):
"""
... | {
"content_hash": "c839c08d2817734d7af7ca1c0416b971",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 132,
"avg_line_length": 30.60185185185185,
"alnum_prop": 0.5763993948562783,
"repo_name": "hupantingxue/benchmark-scripts",
"id": "d6971efff30917e2c255c96bee5fd96057f1cbee",... |
"""Plugin loader
"""
#-------------------------------------------------------------------------------
__author__ = "Dmitry Dolzhenko"
__email__ = "d.dolzhenko@gmail.com"
#-------------------------------------------------------------------------------
import os
import inspect
import unittest
import glob
import impo... | {
"content_hash": "0b2ea0e72040a6420df9eb7c777e1d97",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 80,
"avg_line_length": 26.00990099009901,
"alnum_prop": 0.5572896840502475,
"repo_name": "ddolzhenko/jacis",
"id": "d00bdcc0292ac0188a1adc41acea471f29f6ee89",
"size": "380... |
import pyttsx
engine = pyttsx.init()
engine.say('Sally sells seashells by the seashore.')
engine.say('The quick brown fox jumped over the lazy dog.')
engine.runAndWait()
| {
"content_hash": "119ee247d59920a3830fbefaa5a1380e",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 59,
"avg_line_length": 24.571428571428573,
"alnum_prop": 0.7558139534883721,
"repo_name": "gbiggs/ros_book_sample_code",
"id": "2e839a4f4ac2f626e3acceb062bd651d7ed08771",
"s... |
'''
Approximate the Unix find(1) command and return a list of paths that
meet the specified criteria.
The options include match criteria:
name = file-glob # case sensitive
iname = file-glob # case insensitive
regex = file-regex # case sensitive
ireg... | {
"content_hash": "84893bcb8173286772a7ca1f5effa45c",
"timestamp": "",
"source": "github",
"line_count": 698,
"max_line_length": 84,
"avg_line_length": 32.336676217765046,
"alnum_prop": 0.5154401665854415,
"repo_name": "stephane-martin/salt-debian-packaging",
"id": "2c0bc43466470348ba94da97022b909fedd... |
import logging
from django.db import models
from django.conf import settings
from django.dispatch import receiver
from django.utils.translation import gettext_lazy as _
logger = logging.getLogger(__name__)
class FoiSite(models.Model):
country_code = models.CharField(_("Country Code"), max_length=5)
country_... | {
"content_hash": "30f02e10c6abac6a099a6611c83c5982",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 81,
"avg_line_length": 26.91304347826087,
"alnum_prop": 0.6042003231017771,
"repo_name": "fin/froide",
"id": "5549c425a9536adf1f650d66bde511e740d927c4",
"size": "2476",
"... |
"""
Convergence loop for a node-specific dataset agent.
In practice most of the code is generic, but a few bits assume this agent
is node-specific.
The convergence agent runs a loop that attempts to converge the local
state with the desired configuration as transmitted by the control
service. This involves two state ... | {
"content_hash": "30d0e480c71d7c3fef9e26b5f706ed12",
"timestamp": "",
"source": "github",
"line_count": 444,
"max_line_length": 79,
"avg_line_length": 35.583333333333336,
"alnum_prop": 0.6668776504842079,
"repo_name": "lukemarsden/flocker",
"id": "209ad57f9c74dfb0408469e4e0bdcb7209741c0b",
"size": ... |
"""
FlaskBB
=======
FlaskBB is a forum software written in Python using the microframework Flask.
And Easy to Setup
-----------------
.. code:: bash
$ python manage.py createall
$ python manage.py runserver
* Running on http://localhost:8080/
Resources
---------
* `website <http://flaskbb.org>`_
* ... | {
"content_hash": "b08b1e46cd515d4a410a57819f748a72",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 101,
"avg_line_length": 24.408163265306122,
"alnum_prop": 0.5535117056856187,
"repo_name": "SeanChen0617/flaskbb-1",
"id": "b6c4e08c50f182933c9d0d0657f94816f3525669",
"size... |
"""Set up common fixtures and helpers for pytest."""
from unittest.mock import Mock
import pytest
import voluptuous as vol
from camacq.const import IMAGE_EVENT
from camacq.control import Center
from camacq.plugins import api as api_mod, sample as sample_mod
SET_SAMPLE_SCHEMA = vol.Schema({vol.Required("name"): str},... | {
"content_hash": "dc28a7e9710887a92e995247b02dc017",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 82,
"avg_line_length": 27.741116751269036,
"alnum_prop": 0.5961573650503202,
"repo_name": "CellProfiling/cam_acq",
"id": "24b8a0741ac4acd0d9b99c44bca5abc1c410b3e7",
"size"... |
from solution import Solution
n = 4
sol = Solution()
res = sol.totalNQueens(n)
print(res)
| {
"content_hash": "2fe24967d24859d79232b466f3c330f0",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 29,
"avg_line_length": 15.166666666666666,
"alnum_prop": 0.7252747252747253,
"repo_name": "zhlinh/leetcode",
"id": "1ee36a8caa280600a305a91cacb4997cd5348350",
"size": "138",... |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_feral_marauder.iff"
result.attribute_template_id = 9
result.stfName("npc_name","marauder_base_female")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "07207dc6f9b3a8a4c531d080eabd5dcc",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 68,
"avg_line_length": 23.615384615384617,
"alnum_prop": 0.7003257328990228,
"repo_name": "anhstudios/swganh",
"id": "773f29680505699c3d58b14f8bc84b86d3a8f18e",
"size": "45... |
import sublime
import sublime_plugin
import subprocess
# Change this to the full path if clang-format is not on the path.
binary = 'clang-format'
# Change this to format according to other formatting styles
# (see clang-format -help).
style = 'LLVM'
class ClangFormatCommand(sublime_plugin.TextCommand):
def run(sel... | {
"content_hash": "b7b1d0a1b9226511013aeefcca6750b9",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 71,
"avg_line_length": 36.21951219512195,
"alnum_prop": 0.6518518518518519,
"repo_name": "indashnet/InDashNet.Open.UN2000",
"id": "d41404ed0f5c993b65cf349da0ce48693be8a7d9",
... |
from collections import deque
class RingBuffer(deque):
"""
inherits deque, pops the oldest data to make room
for the newest data when size is reached
"""
def __init__(self, size):
deque.__init__(self)
self.size = size
def full_append(self, item):
deque.append(self, it... | {
"content_hash": "ef5c15c00c5ddf1010bf6a6710901770",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 57,
"avg_line_length": 25.85185185185185,
"alnum_prop": 0.5931232091690545,
"repo_name": "mahiso/poloniexlendingbot",
"id": "889ce12e3d430a66d702385d409ff5edbab77425",
"siz... |
import sys
import os
import pybind11
import mpi4py
from setuptools import setup, Extension
import setuptools.command.build_py
import sysconfig
import subprocess
#TODO: Maybe produce a meta-package which download the library, mui4py branch and produce the binary package with some
# extra configuration like MPI com... | {
"content_hash": "b67de821bc981fef1365a0038e6ca0b1",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 118,
"avg_line_length": 37.01754385964912,
"alnum_prop": 0.6037914691943128,
"repo_name": "yhtang/MUI",
"id": "c8bf25ccf6176354166fd796209618440341fe9c",
"size": "2110",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.