text stringlengths 4 1.02M | meta dict |
|---|---|
import os
import shutil
import time
import unittest
from lib.util.mysqlBaseTestCase import mysqlBaseTestCase
server_requirements = [[],[]]
servers = []
server_manager = None
test_executor = None
# we explicitly use the --no-timestamp option
# here. We will be using a generic / vanilla backup dir
backup_path = None
... | {
"content_hash": "e6118e738f69db666e414aa774685935",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 90,
"avg_line_length": 42.77622377622377,
"alnum_prop": 0.5558280202713749,
"repo_name": "jonzobrist/Percona-Server-5.1",
"id": "0fab9031fa770b9e727c11635493f4e84532a8cb",
... |
from __future__ import print_function
from bcc import BPF
from ctypes import c_int
from time import sleep, strftime
from sys import argv
def usage():
print("USAGE: %s [interval [count]]" % argv[0])
exit()
# arguments
interval = 1
count = -1
if len(argv) > 1:
try:
interval = int(argv[1])
if... | {
"content_hash": "a3c9def9e4c5388e5a1c7715975f5d2b",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 66,
"avg_line_length": 23.347368421052632,
"alnum_prop": 0.5703336339044184,
"repo_name": "mcaleavya/bcc",
"id": "1764c6012f383073eb87eafc882ce70bbd23ffe0",
"size": "2634",... |
"""
This file contains all of the configuration values for the application.
Update this file with the values for your specific Google Cloud project.
You can create and manage projects at https://console.developers.google.com
"""
import os
# The secret key is used by Flask to encrypt session cookies.
SECRET_KEY = 'sec... | {
"content_hash": "ec10a5c453a6d3973cdcb87d59c98192",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 79,
"avg_line_length": 39.86868686868687,
"alnum_prop": 0.7494299467950342,
"repo_name": "wilcoant/bookshelf",
"id": "d40ef9bcddec920c7af30f00286a29c4088c930a",
"size": "45... |
from __future__ import unicode_literals
import json
import pytz
from dash.orgs.models import Org
from dash.orgs.views import OrgObjPermsMixin
from dash.utils import random_string
from datetime import datetime, date
from django.conf import settings
from django.contrib.auth.models import User
from django.core.files imp... | {
"content_hash": "dba819a38e9546db49cfd7bd74e4a401",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 118,
"avg_line_length": 31.45762711864407,
"alnum_prop": 0.6487068965517241,
"repo_name": "xkmato/casepro",
"id": "3e279e8b4a5c9fcab8825165574c1323e25e739a",
"size": "5568... |
"""Presubmit checks for SafeBrowsing download_file_types.
"""
def CheckVersionUpdatedInDownloadFileTypeList(input_api, output_api):
def IsDownloadFileTypeList(x):
return (input_api.os_path.basename(x.LocalPath()) ==
'download_file_types.asciipb')
download_file_types = input_api.AffectedFiles(
... | {
"content_hash": "ff0a1d09ccab86611d12fa2aa1b405ca",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 80,
"avg_line_length": 41,
"alnum_prop": 0.7331855136733185,
"repo_name": "endlessm/chromium-browser",
"id": "d617bd57210fd9e1de344f414636a26775f4f919",
"size": "1516",
"... |
import os, sys
'''Utility tools to update file names under a directory'''
def removeNonAscii(s):
return "".join(i for i in s if ord(i)<128)
def move(directory, sub_str_to_replace, sub_str):
current_directory = os.path.dirname(os.path.abspath(__file__))
directory_to_update = ur""+os.path.join(current_dir... | {
"content_hash": "deec5a6b805db39fe864757c769d6a91",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 79,
"avg_line_length": 36.6,
"alnum_prop": 0.6156648451730419,
"repo_name": "vollov/py-lab",
"id": "9027351f8ab338644991270ed590e04a58661524",
"size": "1122",
"binary": f... |
import sqlite3
import os, time
import Common.EdkLogger as EdkLogger
import CommonDataClass.DataClass as DataClass
from Table.TableDataModel import TableDataModel
from Table.TableFile import TableFile
from Table.TableFunction import TableFunction
from Table.TablePcd import TablePcd
from Table.TableIdentifier import Ta... | {
"content_hash": "3ef73bdd17176d699906ff831d4808ca",
"timestamp": "",
"source": "github",
"line_count": 329,
"max_line_length": 177,
"avg_line_length": 40.33434650455927,
"alnum_prop": 0.606706857573474,
"repo_name": "egraba/vbox_openbsd",
"id": "2b981585d0006ca650421ff2f75254fe7a56bcbd",
"size": "... |
from .fetchers import NUMetadatasFetcher
from .fetchers import NUIKEGatewayConfigsFetcher
from .fetchers import NUIKESubnetsFetcher
from .fetchers import NUGlobalMetadatasFetcher
from bambou import NURESTObject
class NUIKEGateway(NURESTObject):
""" Represents a IKEGateway in the VSD
Notes:
... | {
"content_hash": "8612bd3dcf8a8a3a46e9223cdedf1006",
"timestamp": "",
"source": "github",
"line_count": 337,
"max_line_length": 179,
"avg_line_length": 26.531157270029674,
"alnum_prop": 0.5452410244939044,
"repo_name": "nuagenetworks/vspk-python",
"id": "2a3dbeee40033d11aa8450c69921fc12eabf86fb",
"... |
"""
PyColourChooser
Copyright (C) 2002 Michael Gilfix
This file is part of PyColourChooser.
You should have received a file COPYING containing license terms
along with this program; if not, write to Michael Gilfix
([email protected]) for a copy.
This version of PyColourChooser is open source; you can ... | {
"content_hash": "2b572b74a77327a5a427fb7a2f1170b6",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 80,
"avg_line_length": 34.19565217391305,
"alnum_prop": 0.638906547997457,
"repo_name": "ktan2020/legacy-automation",
"id": "31a602b9889ab4340457d4a753bed61b184ec742",
"siz... |
import rexviewer as r
import naali
import PythonQt
from PythonQt.QtGui import QTreeWidgetItem, QSizePolicy, QIcon, QHBoxLayout, QComboBox, QFileDialog, QMessageBox, QWidget, QTableWidgetItem
from PythonQt.QtUiTools import QUiLoader
from PythonQt.QtCore import QFile, QSize, SIGNAL
import Queue
import sys
import traceb... | {
"content_hash": "9537ae0c930969c972e7eb955aa3be85",
"timestamp": "",
"source": "github",
"line_count": 498,
"max_line_length": 139,
"avg_line_length": 41.321285140562246,
"alnum_prop": 0.6561376227038584,
"repo_name": "antont/tundra",
"id": "b463a37ab9b248ba695fc4ed34221c2e3dfd0696",
"size": "2057... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
from scipy.ndimage import map_coordinates
def reproject_image_into_polar(data, origin=None, Jacobian=False,
dr=1, dt=N... | {
"content_hash": "01d3c7beffc60231b07c1cc19678e329",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 97,
"avg_line_length": 29.4251497005988,
"alnum_prop": 0.5970695970695971,
"repo_name": "PyAbel/PyAbel",
"id": "acb0839b02a41e3229ca266f52903831c52d342c",
"size": "4944",
... |
"""Tests for grr.lib.bigquery."""
import io
import os
import time
from unittest import mock
from absl import app
from googleapiclient import errors
from grr_response_core import config
from grr_response_core.lib import rdfvalue
from grr_response_core.lib.util import temp
from grr_response_core.lib.util.compat import... | {
"content_hash": "07160002e04245ca5b7ce1e4baaeee15",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 77,
"avg_line_length": 33.47727272727273,
"alnum_prop": 0.6860149355057705,
"repo_name": "google/grr",
"id": "b10d825fdc5c995da10e92bc90d6d9236d5b2e6f",
"size": "2968",
"... |
from __future__ import unicode_literals
# General imports
import re
from django.shortcuts import render, redirect
from django.http import HttpResponse, HttpResponseRedirect
from django.urls import reverse
from django.views import generic, View
from django.contrib import messages
# Import Models
from .forms import T... | {
"content_hash": "8174488f8420c152b48fc114e7816e87",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 161,
"avg_line_length": 37.32544378698225,
"alnum_prop": 0.6353836398224477,
"repo_name": "racmariano/skidom",
"id": "dd96b1c1388c64297c2b58b2e59a80b579e96570",
"size": "6... |
from django import template
from django.conf import settings
from django.contrib.sites.models import Site
from django.utils.html import format_html, mark_safe, strip_tags
from django.utils.text import capfirst, Truncator
from blogoland.confs import DEFAULT_DATE_FORMAT
from blogoland.models import Post, Category
regis... | {
"content_hash": "66f3b9f997319cda09f57fa2f046b9b8",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 80,
"avg_line_length": 26.0920245398773,
"alnum_prop": 0.6536562426522454,
"repo_name": "marsxn/blogoland",
"id": "41bca3741f6a13b8a73dd71f88ebaa3a53f5bb40",
"size": "4276... |
import sys, binascii, random
def fromhex(h):
return binascii.unhexlify(str(h).encode("ascii"))
if sys.version_info[0] >= 3:
def flip_bit_in_byte(byte, whichbit):
return bytes([byte ^ (1 << whichbit)])
else:
def flip_bit_in_byte(byte, whichbit):
return chr(ord(byte) ^ (1 << whichbit))
def ... | {
"content_hash": "f090b14da5d512d6afbb05e29445611e",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 59,
"avg_line_length": 29.789473684210527,
"alnum_prop": 0.6060070671378092,
"repo_name": "warner/python-tweetnacl",
"id": "9d05f9419606874960f35fe0938fc6ad6a3f2b62",
"size... |
"""
Description : Simple Python implementation of the Apriori Algorithm
Usage:
$python apriori.py -f DATASET.csv -s minSupport -c minConfidence
$python apriori.py -f DATASET.csv -s 0.15 -c 0.6
"""
import sys
from itertools import chain, combinations
from collections import defaultdict
from optparse imp... | {
"content_hash": "ac8c4b442d7bfc9dd660170d9bd21f19",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 103,
"avg_line_length": 35.17857142857143,
"alnum_prop": 0.5524292965917331,
"repo_name": "sergiofsilva/apriori-basico",
"id": "8aa1fd354c9541c964bacb8e829aec990d0a311c",
... |
from ..gitpub import gitpub
def sort_repos(repo_list):
"""
Sort the repo_list using quicksort
Parameters
----------------------------------
repo_list : [gitpub.Repository()]
Array of friends (loaded from the input file)
=================================================
Returns:
... | {
"content_hash": "3a62ad228c37908368a25a81104b1045",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 113,
"avg_line_length": 33.98076923076923,
"alnum_prop": 0.5359366157328805,
"repo_name": "Demfier/GitPub",
"id": "b6bcaef02644d5289bd7c8160bd00abcab3431f2",
"size": "1767"... |
from webiopi.utils.types import toint
from webiopi.utils.types import M_JSON
from webiopi.devices.instance import deviceInstance
from webiopi.decorators.rest import request, response
class Pressure():
def __init__(self, altitude=0, external=None):
self.altitude = toint(altitude)
if isinstance(exter... | {
"content_hash": "8a6c20beb7568c0a6a0466a11c3d711d",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 116,
"avg_line_length": 28.07936507936508,
"alnum_prop": 0.5830035801771245,
"repo_name": "thortex/rpi3-webiopi",
"id": "c60cabf2fda5a00bc8e52a241028587b4c9614d5",
"size":... |
"""Test v2 APIs for build resources."""
from __future__ import annotations
from typing import TYPE_CHECKING
import pydantic
import pytest
from mock import MagicMock
from werkzeug.exceptions import NotFound
from keeper.exceptions import ValidationError
from keeper.mediatypes import v2_json_type
from keeper.testutils... | {
"content_hash": "07c795198aad61343ddd0ab4b9b459bf",
"timestamp": "",
"source": "github",
"line_count": 306,
"max_line_length": 79,
"avg_line_length": 30.49346405228758,
"alnum_prop": 0.5423855963990998,
"repo_name": "lsst-sqre/ltd-keeper",
"id": "459a3778512cc66f683a9663237f44f4e3b61997",
"size": ... |
from oslo_log import log as logging
from neutron.objects import router
from neutron.services.logapi.common import constants as log_const
from neutron.services.logapi.common import exceptions as log_exc
from neutron.services.logapi.common import validators
LOG = logging.getLogger(__name__)
EVENTS_DISABLE = [log_const... | {
"content_hash": "18612800d4ac547d1593381ca7df2abd",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 77,
"avg_line_length": 38.48888888888889,
"alnum_prop": 0.7263279445727483,
"repo_name": "noironetworks/neutron",
"id": "ee7f91155211ef6c9472b8c8497b598955aff161",
"size": ... |
"""Handles authentication and authorization with Munki clients.
Classes:
AuthBase: base class
Auth1: implementation of Munki/Simian auth, server side
Auth1Client: implementation of Munki/Simian, client side
AuthSessionBase: base class to store session details
AuthSessionDict: session storage... | {
"content_hash": "84611e7de68e9f116814c4dda3f93998",
"timestamp": "",
"source": "github",
"line_count": 1086,
"max_line_length": 99,
"avg_line_length": 27.211786372007367,
"alnum_prop": 0.6333581483486735,
"repo_name": "googlearchive/simian",
"id": "af23f5117978a7dce7db38fac7f18a8395ebcfcc",
"size"... |
from abc import ABCMeta, abstractmethod
from enum import Enum
from utils.binary import *
class SimulatorState(Enum):
UNINITIALIZED = 0
INITIALIZED = 1
LOADED = 2
RUNNING = 3
PAUSED = 4
TERMINATED = 5
class Simulator(metaclass=ABCMeta):
"""Abstract base class for a processor simulator imp... | {
"content_hash": "df131625f903dd14728df6d6871872cb",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 160,
"avg_line_length": 37.630208333333336,
"alnum_prop": 0.6264359861591695,
"repo_name": "zjurelinac/PEAS",
"id": "33920f9b461b4083cba8ea69cf47dc67ade4056e",
"size": "72... |
"""
Rebuild the Ui files
Note: If the system complains about not finding PyQt4 from pyuic, and you are using
anaconda, change the script in ~/anaconda/bin/pyuic4 to start with python2.7, not pythonw2.7
"""
import os, sys
uic = 'pyuic4'
sys.argv.pop(0)
if len(sys.argv) > 1 and sys.argv[1] == '--pyside':
sys.argv.pop... | {
"content_hash": "65d6a2d930cdee51fa3033071a579b83",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 92,
"avg_line_length": 30.657894736842106,
"alnum_prop": 0.5690987124463519,
"repo_name": "mgraupe/acq4",
"id": "e8ae9da9ad7336d370a460d40bd8e9295476b9cc",
"size": "1183",
... |
"""Interface for accessing Cargo settings (stored in the sublime-project
file).
These are used by the build system to determine how to run Cargo.
Cargo Info
==========
When the `cargo_exec` Sublime command is run, you pass in a named command to
run. There is a default set of commands defined here in CARGO_COMMANDS (... | {
"content_hash": "40a3d36e266250d51d1b6133c21a7a88",
"timestamp": "",
"source": "github",
"line_count": 483,
"max_line_length": 122,
"avg_line_length": 37.88198757763975,
"alnum_prop": 0.5151117669563317,
"repo_name": "dten/sublime-rust",
"id": "d92ff0d998c0f9456e16ce1e0602cfd0b2d6bb89",
"size": "1... |
from django.contrib.admin.helpers import InlineAdminForm
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
# local test models
from models import (Holder, Inner, InnerInline, Holder2, Inner2, Holder3,
Inner3, Person, OutfitItem, Fashionista, Teacher, Parent, Child)
class... | {
"content_hash": "8a3e1c7e65756ce7b76560d741fa0bf9",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 184,
"avg_line_length": 45.51497005988024,
"alnum_prop": 0.6492566767530588,
"repo_name": "disqus/django-old",
"id": "61d4634f8bf5d071f82e0358ff549dc2c3a1edb3",
"size": "7... |
"""
Django settings for lowfat project.
Generated by 'django-admin startproject' using Django 1.9.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
fro... | {
"content_hash": "6b4e38882a9966b0a3a7169481b9c53d",
"timestamp": "",
"source": "github",
"line_count": 360,
"max_line_length": 127,
"avg_line_length": 28.988888888888887,
"alnum_prop": 0.6422958988118053,
"repo_name": "softwaresaved/fat",
"id": "51a5f19fd9383bbef6818825ed6bbd542ef06aa2",
"size": "... |
'''
localtion
----------
* /asyncread
feature
----------
* Process-level global variable
* Asynchronous Read
* Decorator Demo
'''
import os
import time
import tornado.web
from tornado.web import HTTPError
from tornado.httpclient import AsyncHTTPClient
from tornado import gen
from util import g_logger
from util imp... | {
"content_hash": "a45fdcd8a3ebad26e581afd1ebbd116e",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 81,
"avg_line_length": 32.39473684210526,
"alnum_prop": 0.5398050365556458,
"repo_name": "bufferx/tns",
"id": "7ca23ad959ce950d7e2bdd787387eca21d1e86b9",
"size": "3112",
... |
from unittest import TestCase
from azure.mgmt.compute.models import StorageAccountTypes
from mock import Mock, MagicMock
from cloudshell.cp.azure.domain.common.vm_details_provider import VmDetailsProvider
class TestVmDetailsProvider(TestCase):
def setUp(self):
self.resource_id_parser = MagicMock()
... | {
"content_hash": "432cc869bd5e953178e0b25736c90553",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 119,
"avg_line_length": 52.18867924528302,
"alnum_prop": 0.6576283441793204,
"repo_name": "QualiSystems/Azure-Shell",
"id": "8b6023d63fc57ff748e6c10a70a65742176b27ef",
"si... |
__author__ = 'Riley Flynn (nint8835)'
class PluginNotFoundException(Exception):
"""An exception raised when something tries to access a plugin that doesn't exist"""
pass
class MultiplePluginsFoundException(Exception):
"""An exception raised when there are multiple plugins found with a certain name, so i... | {
"content_hash": "79e6ec185240428a9058cabeed945af9",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 122,
"avg_line_length": 33.714285714285715,
"alnum_prop": 0.7556497175141242,
"repo_name": "nint8835/NintbotForDiscord",
"id": "1a5ec0dd549b421b328885c50a0dddde8522edec",
"... |
from lacore.source.chunked import ChunkedFile as BaseChunkedFile
class ChunkedFile(BaseChunkedFile):
maxchunk = 20971520
| {
"content_hash": "a86313fa0c0e9383d0f521895d23b11e",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 64,
"avg_line_length": 25.4,
"alnum_prop": 0.8188976377952756,
"repo_name": "longaccess/longaccess-client",
"id": "3cbefa8ddbd2f704a105dcae47a9caede1c81207",
"size": "127",
... |
"""
Utility functions for access to OS level info and URI parsing
"""
import collections
import getpass
import logging
import os
import platform
# All systems do not support pwd module
try:
import pwd
except ImportError:
pwd = None
# Python 2 & 3 compatibility
try:
from urllib import parse as _urlparse
e... | {
"content_hash": "d1cf3ad82cd0ca31c5e127a6007d95f3",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 75,
"avg_line_length": 28.113333333333333,
"alnum_prop": 0.5816931467868153,
"repo_name": "gmr/queries",
"id": "b729c9c59b94ee5bd5a3ca2a9a5e77f177353fd2",
"size": "4217",
... |
import torch.nn as nn
from utils import *
class linknet(nn.Module):
def __init__(self, feature_scale=4, n_classes=21, is_deconv=True, in_channels=3, is_batchnorm=True):
super(linknet, self).__init__()
self.is_deconv = is_deconv
self.in_channels = in_channels
self.is_batchnorm = is... | {
"content_hash": "d77fdcd6771c82d406e092fd64e47b2a",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 140,
"avg_line_length": 38.13953488372093,
"alnum_prop": 0.5801829268292683,
"repo_name": "ibadami/pytorch-semseg",
"id": "26faa6c40d388bf9dcb2998e0796edc64bc9d47f",
"size"... |
from office365.directory.object import DirectoryObject
class ResourceSpecificPermissionGrant(DirectoryObject):
"""
Declares the permission that has been granted to a specific Azure AD app for an instance of a resource
in Microsoft Graph.
"""
pass
| {
"content_hash": "249a71450ad4d1c36cde7ede172f5ad4",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 106,
"avg_line_length": 29.88888888888889,
"alnum_prop": 0.758364312267658,
"repo_name": "vgrem/Office365-REST-Python-Client",
"id": "067a513c354cfc5507759931c23e59dd618b89a6"... |
"""
MiniNExT
See README for details
"""
| {
"content_hash": "835b1669d56f59911bbcc47aa71ce5fd",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 22,
"avg_line_length": 10,
"alnum_prop": 0.675,
"repo_name": "USC-NSL/miniNExT",
"id": "77e329ea4074657ffeb6f8278d12a64283b8f835",
"size": "40",
"binary": false,
"copies... |
"""
WSGI config for pums 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.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS... | {
"content_hash": "41d6b0271298d04a1c8c45fd86438b60",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 24.0625,
"alnum_prop": 0.7662337662337663,
"repo_name": "buaawp/pums",
"id": "1baee86a4b99a12928d2ded89a1e52985a8a08d6",
"size": "385",
"binary": f... |
import logging
import numpy as np
from pybar.scans.scan_digital import DigitalScan
from pybar.fei4.register_utils import invert_pixel_mask
from pybar.analysis.analyze_raw_data import AnalyzeRawData
from pybar.run_manager import RunManager
from pybar.analysis.plotting.plotting import plot_occupancy
class ... | {
"content_hash": "6c9d081f63ba19843c5609a957b0b678",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 154,
"avg_line_length": 51.3625,
"alnum_prop": 0.625699683621319,
"repo_name": "SiLab-Bonn/pyBAR",
"id": "44d83ff444788e5ebf3b7bc694b1efb1f33325e6",
"size": "4109",
"bina... |
import functools
import uuid
import django.utils.timezone
from django.db import migrations, models
import eventstore.validators
class Migration(migrations.Migration):
dependencies = [("eventstore", "0040_momconnectimport_last_uploaded_row")]
operations = [
migrations.CreateModel(
name=... | {
"content_hash": "b7643875cf22ad319073364372e2fb37",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 78,
"avg_line_length": 29.641509433962263,
"alnum_prop": 0.3723742838956079,
"repo_name": "praekeltfoundation/ndoh-hub",
"id": "2828ddacd4dc7dc8ad43e982e33e9771f534ff08",
"... |
from __future__ import unicode_literals
import boto3
from moto import mock_secretsmanager
from botocore.exceptions import ClientError
import sure # noqa
import string
import unittest
from nose.tools import assert_raises
@mock_secretsmanager
def test_get_secret_value():
conn = boto3.client('secretsmanager', regi... | {
"content_hash": "86b2a4751329a0488746305f710e99dd",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 94,
"avg_line_length": 41.03448275862069,
"alnum_prop": 0.6858823529411765,
"repo_name": "Brett55/moto",
"id": "6fefeb56f0de089cb86283d927babe9248e4c48b",
"size": "5950",
... |
"""Array printing function
$Id: arrayprint.py,v 1.9 2005/09/13 13:58:44 teoliphant Exp $
"""
from __future__ import division, absolute_import, print_function
__all__ = ["array2string", "set_printoptions", "get_printoptions"]
__docformat__ = 'restructuredtext'
#
# Written by Konrad Hinsen <[email protected]>
... | {
"content_hash": "6b898560b89828e0374c211e4b9b0376",
"timestamp": "",
"source": "github",
"line_count": 755,
"max_line_length": 91,
"avg_line_length": 34.264900662251655,
"alnum_prop": 0.5422110552763819,
"repo_name": "jankoslavic/numpy",
"id": "b8acaee9771256b8087bf8746f87a9e8f9df730d",
"size": "2... |
from flask import Blueprint, Response, render_template, request, session, redirect, jsonify,\
url_for, make_response, current_app
from flask.ext.security import current_user
import os
import urllib
app = Blueprint('scale', __name__, template_folder='templates')
| {
"content_hash": "968e0cb4a091e6307c86d165aecad76c",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 93,
"avg_line_length": 29.444444444444443,
"alnum_prop": 0.769811320754717,
"repo_name": "wigginslab/lean-workbench",
"id": "c393971322395406e2248328373fe4ea4ea81a6e",
"size... |
"""blackberry.py: Module which contains functionality enabling push notification
messages to be sent to the Blackberry Push Service. """
from datetime import datetime, timedelta
import base64
import uuid
from StringIO import StringIO
from twisted.internet.protocol import Protocol
from twisted.python import log
from tw... | {
"content_hash": "20b9119bb720f6eb90fb2e707c894918",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 80,
"avg_line_length": 36.961783439490446,
"alnum_prop": 0.6129588144063416,
"repo_name": "trulabs/pushpy",
"id": "e80f4f103a8f59a4c95c99a6b43a5869501bfe5d",
"size": "5803... |
from .remove_chartchunk import remove_borders
from .scatter import category_scatter
from .stacked_barplot import stacked_barplot
from .enrichment_plot import enrichment_plot
__all__ = ["remove_borders", "category_scatter",
"stacked_barplot", "enrichment_plot"] | {
"content_hash": "ca01455c39d3e588d6ac3388688376ec",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 48,
"avg_line_length": 44.666666666666664,
"alnum_prop": 0.7686567164179104,
"repo_name": "YoungKwonJo/mlxtend",
"id": "47f94c548f484e2828239c3df6336549541101aa",
"size": "3... |
import datetime
import fnmatch
import json
import logging
import os
import pathlib
import typing
from zipfile import ZipFile
import pandas as pd
import requests
from google.cloud import storage
PIPELINES_NAME_INPATIENT = [
"inpatient_charges_2011",
"inpatient_charges_2012",
"inpatient_charges_2013",
"... | {
"content_hash": "430afba63e52f773756ebb3f7be67280",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 88,
"avg_line_length": 30.02158273381295,
"alnum_prop": 0.6573208722741433,
"repo_name": "llooker/public-datasets-pipelines",
"id": "c794db79e1c409f9740ddcdae5e84fd9e88510ef... |
import pygame
import pygame.camera
from pygame.locals import *
class VideoCapturePlayer(object):
size = ( 640, 480 )
def __init__(self, **argd):
self.__dict__.update(**argd)
super(VideoCapturePlayer, self).__init__(**argd)
# create a display surface. standard pygame stuff
sel... | {
"content_hash": "fa0967838ef738d953d36cf34d2e393b",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 81,
"avg_line_length": 30.272727272727273,
"alnum_prop": 0.5701951951951952,
"repo_name": "jingzhehu/udacity_mlnd",
"id": "aa29718ec16db5a86666290b15f083c825100e64",
"size"... |
"""Contains the loss scaling optimizer class."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.distribute import distribution_strategy_context
from tensorflow.python.framework import smart_cond
from tensorflow.python.keras import bac... | {
"content_hash": "7d780e0ad2d0f754e023a20a6007f93e",
"timestamp": "",
"source": "github",
"line_count": 337,
"max_line_length": 107,
"avg_line_length": 42.210682492581604,
"alnum_prop": 0.7069947275922671,
"repo_name": "jhseu/tensorflow",
"id": "1dcf4a7f248a0a246b8044346f6f3429c926b9c6",
"size": "1... |
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from . import views
urlpatterns = [
url(r'^$', views.manage_competition),
url(r'^(\d+)/$', views.get_competition),
url(r'^edit/$', views.update_competition),
#url(r'^add/', views.add_competition, name='add_compe... | {
"content_hash": "6aece2068fc91a50ccc455a4cc231f02",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 102,
"avg_line_length": 50.1764705882353,
"alnum_prop": 0.6787807737397421,
"repo_name": "acuestap/smarttools_test",
"id": "06316652f227a05ae66b480513d82c4dcf6f697a",
"size... |
import json
import csv
with open('../DataVisualization2016/Data/gem2015.csv', 'rb') as mycsvfile:
thedata = csv.reader(mycsvfile)
# for row in thedata:
# print(row[0]+"\t \t"+row[1]+"\t \t"+row[2]+"\t \t"+row[3]+"\t \t"+row[4])
with open('nlgemeenten2009.json') as json_data:
d = json.load(... | {
"content_hash": "5f0fd85817e57c3d86e86152651ac69a",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 83,
"avg_line_length": 40.074074074074076,
"alnum_prop": 0.5628465804066544,
"repo_name": "MatthijsBon/MatthijsBon.github.io",
"id": "5bd73c0736a77fdbc19c7bcccd61f25b5af8562a... |
import time
import hashlib
import matplotlib.pyplot as plot
# Variables
string = "The brown fox jumps over the lazy dog"
algo = ['MD5', 'SHA-1', 'SHA-224', 'SHA-256', 'SHA-384', 'SHA-512']
colors = ['b', 'c', 'y', 'm', 'r', 'k']
results = {}
# Fetch iterations and step from user
iterations = int(raw_input("Iterations... | {
"content_hash": "4d40c5e1c3bf447fe2507c7b3053349e",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 114,
"avg_line_length": 29.987951807228917,
"alnum_prop": 0.6343913218159903,
"repo_name": "SubNader/HashMark",
"id": "5410244105d8be9cb78acb6f0c8e005e7b08bd46",
"size": "2... |
import copy
import os
import sys
import UserDict
import uuid
import fixtures
import six
from glance.cmd import replicator as glance_replicator
from glance.openstack.common import jsonutils
from glance.tests import utils as test_utils
IMG_RESPONSE_ACTIVE = {
'content-length': '0',
'property-image_state': 'av... | {
"content_hash": "3cb7c62ded83f27b25def68c193ae48f",
"timestamp": "",
"source": "github",
"line_count": 561,
"max_line_length": 78,
"avg_line_length": 37.65597147950089,
"alnum_prop": 0.5774674556213018,
"repo_name": "tanglei528/glance",
"id": "e0c501ada83ca90946188af31958a0cda77741a9",
"size": "21... |
import re
import sys
from datetime import datetime
from threading import Lock
from xml.etree import ElementTree as ET
from com.ericsson.xn.server.parser.SgsnmmeParser import SgsnmmeNodeInfo
lock = Lock()
versionTuple = sys.version_info[:2]
version = '.'.join(repr(v) for v in versionTuple)
class SgsnmmeCmdHandler():
... | {
"content_hash": "a4384f393cada25db92b07c4a5babcd5",
"timestamp": "",
"source": "github",
"line_count": 395,
"max_line_length": 120,
"avg_line_length": 52.93417721518988,
"alnum_prop": 0.5187239944521498,
"repo_name": "lowitty/zacademy",
"id": "c58e96e064c1304702eb555637fef58b9912e0f4",
"size": "20... |
from __future__ import division, print_function, absolute_import
import struct
import tempfile
import warnings
import zlib
import numpy as np
from numpy.compat import asstr
# Define the different data types that can be found in an IDL save file
DTYPE_DICT = {1: '>u1',
2: '>i2',
3: '>i4',
... | {
"content_hash": "b5a8e699784196e7b39bb9fd1f9586d6",
"timestamp": "",
"source": "github",
"line_count": 853,
"max_line_length": 100,
"avg_line_length": 28.417350527549825,
"alnum_prop": 0.5359323432343235,
"repo_name": "DailyActie/Surrogate-Model",
"id": "f07b9b68395642abd1a18143c61c85805f6d22a3",
... |
"""news_project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cla... | {
"content_hash": "9250c2508c011e19db94c0743550f414",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 79,
"avg_line_length": 39.758620689655174,
"alnum_prop": 0.6921075455333912,
"repo_name": "julienawilson/news-project",
"id": "28f707e18273476d8e9d24eee4a52c7269185d64",
"s... |
from __future__ import division
supported_datasets = ['bmnist', 'silhouettes']
# ToDo: # 'mnist' and 'tfd' are not normalized (0<= x <=1.)
def get_data(data_name):
if data_name == 'mnist':
from fuel.datasets import MNIST
img_size = (28, 28)
channels = 1
data_train = MNIST(which_se... | {
"content_hash": "dfab36f6bf2f281288a439dc4fd86846",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 168,
"avg_line_length": 60.24096385542169,
"alnum_prop": 0.6518,
"repo_name": "drewlinsley/draw_classify",
"id": "769b8b979852012d85da17cc64e3498054d8eaa4",
"size": "5001",... |
import sys
import os
import time
import collections
import re
from androguard.core import bytecode
from androguard.core.bytecodes.dvm import DalvikVMFormat
from androguard.core.bytecodes import apk, dvm
from androguard.core.analysis.ganalysis import GVMAnalysis
from androguard.core.analysis.analysis import uVMAnalysis... | {
"content_hash": "02044682ce98cfcac3dfb39cf03303f3",
"timestamp": "",
"source": "github",
"line_count": 2447,
"max_line_length": 249,
"avg_line_length": 60.28238659583163,
"alnum_prop": 0.47391719939529936,
"repo_name": "titze/apparecium",
"id": "ccca668b5d11143c511001850a554206db770ce0",
"size": "... |
import mock
import requests
import requests_mock
import unittest
from collections import OrderedDict as odict
from appletea import forecastio
from appletea.forecastio.models import Forecast
def _urlq(items):
l = []
for k, v in items:
l.append('%s=%s' % (k, v))
return '&'.join(l)
class TestApi(u... | {
"content_hash": "8d7d92b5d7473f35bbf1f269da8dd98f",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 79,
"avg_line_length": 38.255102040816325,
"alnum_prop": 0.6303014137103228,
"repo_name": "beylsp/appletea",
"id": "13f34d4d1c80987cc50b6882ce3d8f1ec9d93166",
"size": "3749... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
budget = 1000000
index = 100
def prepare_data(df):
'''
Return: (pdf,sdf), dataframes containing data on
portfolio and statistics.
'''
df['Time'] = pd.to_datetime(df['Time'])
df = df.se... | {
"content_hash": "70fa55065fc9be2f04c751b2a1e9cfe6",
"timestamp": "",
"source": "github",
"line_count": 243,
"max_line_length": 132,
"avg_line_length": 32.89300411522634,
"alnum_prop": 0.6421869135493556,
"repo_name": "TueVJ/OptFinFinalExam",
"id": "9cc9552165099220b3b8de4c8101c62cc27a341b",
"size"... |
import argparse, glob, re, sys
from language import *
from parser import parse_llvm, parse_opt_file
from gen import generate_suite
def block_model(s, sneg, m):
# First simplify the model.
sneg.push()
bools = []
exprs = []
req = []
skip_model = get_pick_one_type()
for n in m.decls():
b = FreshBool... | {
"content_hash": "95d64599d41440a471d4152e2d1c58b4",
"timestamp": "",
"source": "github",
"line_count": 530,
"max_line_length": 84,
"avg_line_length": 28.49622641509434,
"alnum_prop": 0.5996159703370192,
"repo_name": "rutgers-apl/alive-loops",
"id": "6435ad6a8a94cfb7a34d00467661af84bb6a0a13",
"size... |
from django.conf.urls import patterns, url
urlpatterns = patterns('',
url(r'^ajax/get_user/$', 'auth_chat.views.get_user',),
)
| {
"content_hash": "3a9885a33cfe200eaf95fcd50b5bbc81",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 58,
"avg_line_length": 26.4,
"alnum_prop": 0.6742424242424242,
"repo_name": "relicode/auth-chat",
"id": "d33786a44057e526a732e52adc1baffe58644865",
"size": "132",
"binary"... |
"""
This file is part of the private API. Please do not use directly these classes as they will be modified on
future versions without warning. The classes should be accessed only via the transforms argument of Weights.
"""
from typing import List, Optional, Tuple, Union
import PIL.Image
import torch
from torch impor... | {
"content_hash": "181b324c13a5b4a906e9b1ad134bc3a7",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 122,
"avg_line_length": 37.351351351351354,
"alnum_prop": 0.5850217076700435,
"repo_name": "pytorch/vision",
"id": "a6980f3e135ac382fc2df817d3e10184ddac7a37",
"size": "2764... |
"""engine.SCons.Tool.f77
Tool-specific initialization for the generic Posix f77 Fortran compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2... | {
"content_hash": "1658b3e9a23c388946504dba1f76a93f",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 83,
"avg_line_length": 34.517857142857146,
"alnum_prop": 0.7480600103466115,
"repo_name": "frew/simpleproto",
"id": "6fe0c3e6365a1d9dde59360d7336581c36080123",
"size": "193... |
"""Client annotated ACME challenges.
Please use names such as ``achall`` to distiguish from variables "of type"
:class:`acme.challenges.Challenge` (denoted by ``chall``)
and :class:`.ChallengeBody` (denoted by ``challb``)::
from acme import challenges
from acme import messages
from letsencrypt import achallenge... | {
"content_hash": "4da67ff855185bdd78484d807ff54c6d",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 74,
"avg_line_length": 26.672131147540984,
"alnum_prop": 0.7000614628149969,
"repo_name": "mitnk/letsencrypt",
"id": "0cdec06dfabe2835f714d72ca4ccfc78c5d42461",
"size": "16... |
"""
.. moduleauthor:: ZackZK <[email protected]>
"""
import Queue
import datetime
import threading
import time
from collections import deque
import pytz
import tushare as ts
# from tushare.util.dateu import is_holiday # use our own is_holiday currently as tushare does not include 2016 holiday
import engine.logger
... | {
"content_hash": "3668cceb49d59c85b1b7ab3ff0cd9ace",
"timestamp": "",
"source": "github",
"line_count": 411,
"max_line_length": 120,
"avg_line_length": 31.447688564476884,
"alnum_prop": 0.5806576402321083,
"repo_name": "Yam-cn/potato",
"id": "3fa16d3558b36a34a2d3dacf94621e889f915761",
"size": "1349... |
from BaseThrusters import BaseThrusters
class Thrusters(BaseThrusters):
def __init__(self):
pass
def set(self, values):
pass
def get(self):
pass
def stop(self):
pass
| {
"content_hash": "a1493d0be93ddbbc6f0f21148f5a6c4e",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 39,
"avg_line_length": 13.75,
"alnum_prop": 0.5772727272727273,
"repo_name": "purduerov/XX-Core",
"id": "fd07825ac9f5f2dc11636e4b60ea421487164e7c",
"size": "220",
"binary... |
"""Sample simulation parameters."""
import collections
_ParameterSamplerConfig = collections.namedtuple('ParameterSamplerConfig',
['name', 'sampler'])
class ParameterSamplerConfig(_ParameterSamplerConfig):
"""A subclass of namedtuple for parameter distribution conf... | {
"content_hash": "19b918cb8f06f4fb1c624595db5b36a9",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 78,
"avg_line_length": 30.58695652173913,
"alnum_prop": 0.6958066808813077,
"repo_name": "world-federation-of-advertisers/cardinality_estimation_evaluation_framework",
"id": ... |
"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from go... | {
"content_hash": "42bfed4853f583ca170e0180bc7d6053",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 666,
"avg_line_length": 48.25,
"alnum_prop": 0.7927461139896373,
"repo_name": "googleapis/python-api-common-protos",
"id": "8863b05e5b011225e4065659a5dc608eb3b0552c",
"size... |
import viennagrid
class BadFileFormatError(Exception):
"""Exception raised when the mesh file is not well-formatted and hence cannot be read."""
pass
def read_netgen(filepath, domain, segmentation=None):
"""
Read mesh data from a Netgen file and save the read domain data into the given domain.
If a segmentation ... | {
"content_hash": "651d66cff5ac6bb6eaa4538adc0c4fd8",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 98,
"avg_line_length": 37.156462585034014,
"alnum_prop": 0.7385573050164774,
"repo_name": "jonancm/viennagrid-python",
"id": "6862264545116840e1fe2091fb53233017fbe2a3",
"s... |
'''
Copyright (C) 2012-2017 Diego Torres Milano
Created on Feb 2, 2015
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... | {
"content_hash": "d382041e0ec3315b0512713ab91b79eb",
"timestamp": "",
"source": "github",
"line_count": 455,
"max_line_length": 204,
"avg_line_length": 37.48571428571429,
"alnum_prop": 0.618609287054409,
"repo_name": "mwasilew/AndroidViewClient",
"id": "087b68fa9cd97e0b281d6970dbe62ef91f0ee440",
"s... |
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django_countries.fields
class Migration(migrations.Migration):
replaces = [('users', '0001_initial'), ('users', '0002_expanded_user_profiles'), ('users', '0003_fixed_def... | {
"content_hash": "c37997f704c38d18601268c508e7559c",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 793,
"avg_line_length": 77.73529411764706,
"alnum_prop": 0.6814226258040106,
"repo_name": "project-lovelace/lovelace-website",
"id": "74b66d9b028cb14b6ec6c89e1ef0fb858de8ef78... |
'''
Entry point module (keep at root):
This module starts the debugger.
'''
from __future__ import nested_scopes # Jython 2.1 support
import atexit
import os
import sys
import traceback
from _pydevd_bundle.pydevd_constants import IS_JYTH_LESS25, IS_PY3K, IS_PY34_OR_GREATER, IS_PYCHARM, get_thread_id, dict_keys, \
... | {
"content_hash": "48f5a058bc5e3ecf962ff1088e9cd2ba",
"timestamp": "",
"source": "github",
"line_count": 1645,
"max_line_length": 157,
"avg_line_length": 41.05775075987842,
"alnum_prop": 0.5842611785608528,
"repo_name": "apixandru/intellij-community",
"id": "6cec167b3d5b49ff37a1dab60e768b6881fb06b8",
... |
import io
import os
import sys
from oslotest import base
from mistralclient import shell
class BaseShellTests(base.BaseTestCase):
def shell(self, argstr):
orig = (sys.stdout, sys.stderr)
clean_env = {}
_old_env, os.environ = os.environ, clean_env.copy()
try:
sys.std... | {
"content_hash": "1330a1f7c4de6dd0615ef23ead269973",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 63,
"avg_line_length": 26.393939393939394,
"alnum_prop": 0.56601607347876,
"repo_name": "openstack/python-mistralclient",
"id": "f15dd8e891792c3be0406ba699186ea95904a299",
... |
"""
Copyright (2017) Chris Scuderi
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, softwar... | {
"content_hash": "cd7dc3064dbad591f98bf41c88cf02d6",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 79,
"avg_line_length": 25.4,
"alnum_prop": 0.6519685039370079,
"repo_name": "scudre/alarm-central-station-receiver",
"id": "22d50ec14692965883cc409896e5c1c978aefbae",
"size... |
from functools import lru_cache
from typing import Optional
from django.core.exceptions import FieldDoesNotExist
from django.db import models
from django.db.models import QuerySet
from rest_framework.compat import coreapi, coreschema
from rest_framework.filters import BaseFilterBackend
from rest_framework.request impo... | {
"content_hash": "ececd4e5e2a195d07304956fd0b4fef4",
"timestamp": "",
"source": "github",
"line_count": 244,
"max_line_length": 136,
"avg_line_length": 36.221311475409834,
"alnum_prop": 0.5435618918307309,
"repo_name": "rsinger86/drf-flex-fields",
"id": "cee952a11075242fd77d26cf0c160f9948be9aa6",
"... |
'''
File: budget_views.py
Author: Zachary King
Implements the views/handlers for Budget-related requests
'''
from django.shortcuts import render, redirect, reverse
from django.contrib.auth.decorators import login_required
import decimal
from datetime import date
from ..models import Budget, BudgetCategory, Wallet, T... | {
"content_hash": "8569d74a75d1dcc335604e7c6f265613",
"timestamp": "",
"source": "github",
"line_count": 227,
"max_line_length": 140,
"avg_line_length": 52.18942731277533,
"alnum_prop": 0.5992234320925128,
"repo_name": "zcking/Pynny",
"id": "6ca6957d5a42ed6d598d2d04ddf245d7861abe7b",
"size": "11870"... |
import zmq
import json
context = zmq.Context()
# Socket to talk to server
print("开始连接服务器")
socket = context.socket(zmq.REQ)
socket.connect ("tcp://localhost:5555")
# Do 10 requests, waiting each time for a response
for request in range (1,10):
print("Sending request ", request,"...")
content = '信息的定义是什么'
d... | {
"content_hash": "d7dee593b73528a4a70c589e44fde38b",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 50,
"avg_line_length": 27.3,
"alnum_prop": 0.673992673992674,
"repo_name": "donttal/test_jieba",
"id": "c0d60a686c41672999c2e322b06ac13b4c3236ab",
"size": "576",
"binary"... |
"""
@author: Sebi
File: test_bfread.py
Date: 08.04.2016
Version. 0.6
"""
import numpy as np
import os
import bftools as bf
import pytest
import datetime
import zencom as zc
def setbfpath():
# specify bioformats_package.jar to use if required
bfpath = r'c:\BioFormats_Package\5.1.9\bioformats_package.jar'
... | {
"content_hash": "bf7797b909d47e30ac355cd73e6ac274",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 120,
"avg_line_length": 29.171597633136095,
"alnum_prop": 0.639553752535497,
"repo_name": "sebi06/BioFormatsRead",
"id": "1fee62eb53d8f7fd8082e913e3c3f2fe3a274607",
"size"... |
import sqlite3
import os
class TweetList(object):
def __init__(self, path):
self.path = os.path.abspath(path)
self.connection = sqlite3.Connection(self.path)
self.__init_db()
def __init_db(self):
c = self.connection.cursor()
c.execute(
'''CREATE TABLE IF ... | {
"content_hash": "35f51f302b1a89033b33b22b6bf7606f",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 124,
"avg_line_length": 34.50326797385621,
"alnum_prop": 0.5840121235082402,
"repo_name": "billyoverton/tweetqueue",
"id": "5eff4bfb48e145f7d072e5695e0c5c9762dafff3",
"siz... |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('core', '0002_auto_20141216_2149'),
]
operations = [
... | {
"content_hash": "929faf08a867fbfe9f33ed428274520c",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 76,
"avg_line_length": 26.413793103448278,
"alnum_prop": 0.5835509138381201,
"repo_name": "Matt-Deacalion/Mentalist",
"id": "d8daf7f53bf29298df8fce553c1fbdeddadce328",
"siz... |
import os
import time
import baseservice
import apache_log_parser
basepath = os.path.dirname(__file__)
class Fileaccesslog(baseservice.BaseService):
status = {
'name':'unknown',
'status':'stopped',
'action':'stopped',
'actiontime':'000-00-00 00:00:00',
'progress':{
... | {
"content_hash": "d4d98e19bd00a353e7ed974338b3b92f",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 78,
"avg_line_length": 26.72,
"alnum_prop": 0.5558882235528942,
"repo_name": "UQ-UQx/old_injestor",
"id": "fa5fe5c83721768bf27b643c1bb4c49e3c03b153",
"size": "2023",
"bin... |
"""Implements VideoFileClip, a class for video clips creation using video files."""
from moviepy.audio.io.AudioFileClip import AudioFileClip
from moviepy.decorators import convert_path_to_string
from moviepy.video.io.ffmpeg_reader import FFMPEG_VideoReader
from moviepy.video.VideoClip import VideoClip
class VideoFil... | {
"content_hash": "57279579c39e5f4c7ef0b998e5dc9b9b",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 86,
"avg_line_length": 31.28735632183908,
"alnum_prop": 0.6114988978692139,
"repo_name": "Zulko/moviepy",
"id": "1be47cb45ba267306b4e3ceeade146fd8b5c9862",
"size": "5444",... |
import wx
import armid
from EnvironmentListCtrl import EnvironmentListCtrl
from MisuseCaseEnvironmentProperties import MisuseCaseEnvironmentProperties
from MisuseCaseNotebook import MisuseCaseNotebook
class MisuseCaseEnvironmentPanel(wx.Panel):
def __init__(self,parent,dp):
wx.Panel.__init__(self,parent,armid.M... | {
"content_hash": "b8fa5d530e58b3ba501106b0a7d60c14",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 133,
"avg_line_length": 43.1875,
"alnum_prop": 0.7727930535455861,
"repo_name": "RobinQuetin/CAIRIS-web",
"id": "6bcfbbb3df8043d2c1812860474263953e1d7484",
"size": "9091",... |
from django import forms
from blog.models import Entry
class EntryAdminForm(forms.ModelForm):
class Meta:
model = Entry
fields = ('title', 'created_by', 'excerpt', 'content',
'status', 'is_micro', 'enable_comments')
| {
"content_hash": "80aee185bf41f06f91f7917f6b6e0d27",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 56,
"avg_line_length": 20.727272727272727,
"alnum_prop": 0.6973684210526315,
"repo_name": "SushiTee/teerace",
"id": "f5a007553b999ea8883330cd0a6859e69721451a",
"size": "228... |
"""
chemspipy.search
~~~~~~~~~~~~~~~~
A wrapper for asynchronous search requests.
"""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
import datetime
import logging
import threading
import time
from six.moves import range
from . import errors, objects, ... | {
"content_hash": "f12c1e7a18401c68dc95b386bed76e04",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 122,
"avg_line_length": 32.84293193717277,
"alnum_prop": 0.5895106009883628,
"repo_name": "mcs07/ChemSpiPy",
"id": "d3deab2d4817c766ff2470311420c2e36412d5dd",
"size": "629... |
"""
Wrapper around git command line interface
"""
from __future__ import division, print_function
import subprocess
import sys
import time
import re
import os
from collections import namedtuple
from pandas import Timestamp
from utils import Commit
try:
reload(sys)
sys.setdefaultencoding('utf-8')
except:
... | {
"content_hash": "842373339d28fba4dd6e414820758ae5",
"timestamp": "",
"source": "github",
"line_count": 610,
"max_line_length": 103,
"avg_line_length": 29.432786885245903,
"alnum_prop": 0.6172440681742231,
"repo_name": "peterwilliams97/git-stats",
"id": "e47183e14c63a145b64fea1db85f30dd07747e48",
"... |
"""Unit tests for the Quobyte driver module."""
import errno
import os
import six
import StringIO
import traceback
import mock
from oslo_concurrency import processutils as putils
from oslo_config import cfg
from oslo_utils import units
from cinder import context
from cinder import exception
from cinder.image import ... | {
"content_hash": "0fd14d49c019a11cb1bb9c26c15d4a06",
"timestamp": "",
"source": "github",
"line_count": 924,
"max_line_length": 79,
"avg_line_length": 41.5,
"alnum_prop": 0.5677776039221822,
"repo_name": "julianwang/cinder",
"id": "cdd4f005b5ad1fb66113c95db8d47ec5b95c2ee5",
"size": "39012",
"bina... |
import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.c... | {
"content_hash": "e145f8a59fed1ce6674b129a3bba161f",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 116,
"avg_line_length": 37.959349593495936,
"alnum_prop": 0.6682373099164703,
"repo_name": "Azure/azure-sdk-for-python",
"id": "ef9392e72d7af66fa39710d534c2de9b09b42a42",
... |
import unittest
import responses
import mobilvest
import urlparse
import datetime
from hashlib import md5
class TestsMobilVest(unittest.TestCase):
def setUp(self):
responses.add(responses.GET,
'http://online.mobilvest.ru/get/timestamp.php',
body='1432359515')
... | {
"content_hash": "844e84f61940a62f6e65410e552af562",
"timestamp": "",
"source": "github",
"line_count": 281,
"max_line_length": 78,
"avg_line_length": 37.03914590747331,
"alnum_prop": 0.4608954650269024,
"repo_name": "ron8mcr/python-mobilvest",
"id": "2eb0256867e89bf7d807419bb3f743d1c0a5f490",
"siz... |
"""
Copyright 2012 GroupDocs.
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 writin... | {
"content_hash": "b7f2c4f72bce7dab253c21e39290e17a",
"timestamp": "",
"source": "github",
"line_count": 280,
"max_line_length": 148,
"avg_line_length": 39.417857142857144,
"alnum_prop": 0.5840355168977077,
"repo_name": "liosha2007/temporary-groupdocs-python3-sdk",
"id": "08476b5f45119ce15096034c20f9a... |
from geojsontosvg import transform_to_json
from parser import load_matrices
from collections import OrderedDict
import json
res = transform_to_json()
matrix, reversed_matrix,csv_code_to_name = load_matrices()
from_csv = csv_code_to_name.values()
from_json = res.keys()
#print len(from_csv),from_csv
from_csv = [unicode... | {
"content_hash": "f72a73dec3b8a17f33f1517696d230bb",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 83,
"avg_line_length": 29.424242424242426,
"alnum_prop": 0.6189495365602472,
"repo_name": "madewulf/MigrationsMap.net",
"id": "4665a444ac116cd2dc4a19e46a8805521a8bbb1b",
"s... |
"""
Project version:
>>> print(VERSION_INFO)
VersionInfo(major=0, minor=3, patch=0)
>>> print(VERSION)
0.3.0
>>>
"""
import collections
__author__ = "Simone Campagna"
__copyright__ = 'Copyright (c) 2016 Simone Campagna'
__license__ = 'Apache License Version 2.0'
__all__ = (
'VersionInfo',
'VERSION_INFO',
... | {
"content_hash": "e3bca2fe14b68ecb2553879f9506a780",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 53,
"avg_line_length": 15.882352941176471,
"alnum_prop": 0.6277777777777778,
"repo_name": "simone-campagna/toxins",
"id": "24650d26bc15de06d65e374647ccc6f3a1ed2830",
"size"... |
import importlib
import os
import pickle
import sys
import traceback
def main():
script_dict = pickle.load(sys.stdin.buffer)
req = script_dict['request']
inst = script_dict['vnf_instance']
grant_req = script_dict['grant_request']
grant = script_dict['grant_response']
tmp_csar_dir = script_dic... | {
"content_hash": "faa0c97ee180250d73003ca9a3a3bafb",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 71,
"avg_line_length": 28.25,
"alnum_prop": 0.6468222043443282,
"repo_name": "openstack/tacker",
"id": "f3d2b0de87385ee20de5285ef8632bbdbdf2c033",
"size": "1905",
"binary... |
'''Logging from Celery both to logstash and structured log (JSON) file.'''
# You need to install python-logstash package. Also have logstash agent and
# elasticsearch running.
# Example logstash configuration (logstash.conf):
# input {
# udp => {
# codec => json
# }
# }
# output {
# elasticsearch ... | {
"content_hash": "39f0049299ceca99749ee42b3fc9eeef",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 79,
"avg_line_length": 26.134615384615383,
"alnum_prop": 0.6423841059602649,
"repo_name": "tebeka/pythonwise",
"id": "e1d2146f5c712d171b62b0940216acc1006dd607",
"size": "2... |
import multiprocessing
import setuptools
setuptools.setup(
setup_requires=['pbr!=2.1.0,>=2.0.0'],
pbr=True)
| {
"content_hash": "ca51ea9dd20bcfb80c4d792bf6ba4bf5",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 42,
"avg_line_length": 16.857142857142858,
"alnum_prop": 0.6864406779661016,
"repo_name": "Flav35/registryctl",
"id": "ae202b3dda1ef179b027d84990e84c330fd268c3",
"size": "11... |
"""
Solution to Day 1 - Puzzle 2 of the Advent Of Code 2015 series of challenges.
--- Day 1: Not Quite Lisp ---
An opening parenthesis represents an increase in floor and a closing parenthesis represents a decrease in floor.
After taking a 7000 character long input string of assorted parenthesis, determine the first ... | {
"content_hash": "8de0b5259c4cc6d2b6ed3ad7df1792af",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 116,
"avg_line_length": 26.88235294117647,
"alnum_prop": 0.6597374179431073,
"repo_name": "rookuu/AdventOfCode-2015",
"id": "de14ffaa31c53a560fa65c555d1949d71a04f45f",
"siz... |
"""Code for supporting compatibility across python versions."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
try:
from base64 import decodebytes, encodebytes
except ImportError:
from base64 import encodestring as encodebytes
from base64 import decode... | {
"content_hash": "12e85173002fd9d2b415c6dd60407bf4",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 63,
"avg_line_length": 34.2,
"alnum_prop": 0.7865497076023392,
"repo_name": "sserrot/champion_relationships",
"id": "5e5861916ea06c92bd9de7ebd88f9020d8f0bb50",
"size": "342... |
"""This example gets all browsers available to target from the Browser table.
Other tables include 'Bandwidth_Group', 'Browser_Language',
'Device_Capability', 'Operating_System', etc...
A full list of available criteria tables can be found at
https://developers.google.com/doubleclick-publishers/docs/reference/v201708... | {
"content_hash": "c6dd03f840d84c87821bf5a70f291756",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 105,
"avg_line_length": 32.743589743589745,
"alnum_prop": 0.7180892717306187,
"repo_name": "Aloomaio/googleads-python-lib",
"id": "5a0c7eddb173ff310b220d92e86ddc4b81e767ca",
... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('commitments', '0004_auto_20170227_0318'),
]
operations = [
migrations.CreateModel(
name='CommitmentRead... | {
"content_hash": "8f593af4bdcc279d3d7340fba1597fbb",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 162,
"avg_line_length": 27.3,
"alnum_prop": 0.6373626373626373,
"repo_name": "vinay-pad/commit_service",
"id": "c238010d13603343260bddc8c49a9e7e92d5dbae",
"size": "617",
... |
import json
from pathlib import Path
from unittest.mock import Mock
import pytest
import textwrap
import responses as rsps
import click
from ruamel.yaml import YAML
from archery.bot import (
CommentBot, CommandError, CrossbowCommentFormatter, group
)
@pytest.fixture
def responses():
with rsps.RequestsMock()... | {
"content_hash": "2a12f7ef0d4347837873fc6290a9d752",
"timestamp": "",
"source": "github",
"line_count": 225,
"max_line_length": 76,
"avg_line_length": 27.275555555555556,
"alnum_prop": 0.6356525989897344,
"repo_name": "xhochy/arrow",
"id": "9b2d023bc112c7565bf5c8ce0f3d8eed4a40b5eb",
"size": "6923",... |
import time
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from MasterSeer import MasterSeer
import math
import itertools
import csv
from sklearn.feature_selection import SelectPercentile, f_classif, SelectFromModel
from sklearn.linear_model import LinearRegression, Lasso, Ridge
from sklearn.li... | {
"content_hash": "bcd423615a1435761cfe8f0ee5a7495a",
"timestamp": "",
"source": "github",
"line_count": 423,
"max_line_length": 195,
"avg_line_length": 39.657210401891255,
"alnum_prop": 0.5614307004470939,
"repo_name": "georgetown-analytics/envirohealth",
"id": "2e5aebfa886d11e1381eb06ee2a4960a237f7a... |
import pandas as pd
from sklearn import datasets
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
names = ['min', 'max', 'mean', 'sd', 'class']
data = pd.read_csv('iris.data', names=names)
array = data.values
i = 0
'''for x in data[... | {
"content_hash": "295c59103e06bb7bb5041abde3199bbe",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 89,
"avg_line_length": 23.11764705882353,
"alnum_prop": 0.6539440203562341,
"repo_name": "Swaraj1998/MyCode",
"id": "e360673b7571f3189c51fcd8d685fdc9eae857bc",
"size": "786... |
import sys
import argparse
import os
import os.path
import tarfile
import shutil
from pyskeleton import __version__
from pkg_resources import resource_filename
class Parser(argparse.ArgumentParser):
def __init__(self, **kwargs):
super(Parser, self).__init__(**kwargs)
DESCRIPTION = """
will create a pyth... | {
"content_hash": "dcc0cb991adb2c29df57b4e36c5d1d7e",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 73,
"avg_line_length": 23.916666666666668,
"alnum_prop": 0.64198606271777,
"repo_name": "a358003542/skeleton",
"id": "6feede6f3723db9bdae129bdb0ed758b545e24e7",
"size": "11... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.