text stringlengths 4 1.02M | meta dict |
|---|---|
from ..style import use
use("johannes")
| {
"content_hash": "265b325c826dd99909b410a210cf8123",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 23,
"avg_line_length": 13.666666666666666,
"alnum_prop": 0.7073170731707317,
"repo_name": "tamasgal/km3pipe",
"id": "b7ba7b207cefed7a3f1cf04019f74b46483bbd1a",
"size": "41",... |
"""
Installs and configures MariaDB
"""
import uuid
import logging
from packstack.installer import validators
from packstack.installer import utils
from packstack.installer.utils import split_hosts
from packstack.modules.common import filtered_hosts
from packstack.modules.ospluginutils import (getManifestTemplate,
... | {
"content_hash": "1813b175edcd6b5058efb66a82d935c2",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 78,
"avg_line_length": 35.459016393442624,
"alnum_prop": 0.5887656033287101,
"repo_name": "Bitp-Spbsu/openstack-packstack",
"id": "eca7f24a229d98066956c3bd1d7d45d5a15615b7",... |
import os
import logging
import pkgutil
import shutil
import sys
import xmlrpclib
import time
from lib.core.packages import choose_package
from lib.common.exceptions import CuckooError, CuckooPackageError
from lib.common.abstracts import Package, Auxiliary
from lib.common.constants import PATHS
from lib.core.config im... | {
"content_hash": "692a13ceac066708cef4e736abe9ec3c",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 112,
"avg_line_length": 38.59375,
"alnum_prop": 0.5577935222672065,
"repo_name": "mburakergenc/Malware-Detection-using-Machine-Learning",
"id": "b31b54ec9c1fbc1a9f1da21d4c11... |
import os
import csv
import shutil
import pandas as pd
import tensorflow as tf
import numpy as np
from keras.applications import VGG16
from keras.layers import Dense, Flatten, Dropout, ELU
from keras.preprocessing.image import ImageDataGenerator
from keras.utils import np_utils
import math
import cv2
import pickle
from... | {
"content_hash": "a537a39d81e2aca52a743bb7e1f1f44f",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 114,
"avg_line_length": 37.86021505376344,
"alnum_prop": 0.6137460948594149,
"repo_name": "matthewzimmer/carnd-behavioral-cloning",
"id": "21bf517a93f5f3e0b9e9949b8c5d3f0ac1... |
"""Copies & compiles the data required to start the reinforcement loop."""
import sys
sys.path.insert(0, '.') # nopep8
import asyncio
import glob
import os
from absl import app, flags
from ml_perf import utils
N = os.environ.get('BOARD_SIZE', '19')
flags.DEFINE_string('src_dir', 'gs://minigo-pub/ml_perf/',
... | {
"content_hash": "eab05253ee75272c5c479a176818154b",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 108,
"avg_line_length": 32.728813559322035,
"alnum_prop": 0.6229932677369239,
"repo_name": "mlperf/training_results_v0.6",
"id": "3f491777923a7f52ff34c80d933c52df0f892997",
... |
__author__ = 'Brian Quinlan (brian@sweetapp.com)'
import collections
import logging
import threading
import time
FIRST_COMPLETED = 'FIRST_COMPLETED'
FIRST_EXCEPTION = 'FIRST_EXCEPTION'
ALL_COMPLETED = 'ALL_COMPLETED'
_AS_COMPLETED = '_AS_COMPLETED'
# Possible future states (for internal use by the futures package).
... | {
"content_hash": "6eea9d46a64e321d43fc5c12382b8444",
"timestamp": "",
"source": "github",
"line_count": 572,
"max_line_length": 80,
"avg_line_length": 34.15384615384615,
"alnum_prop": 0.5867628992628993,
"repo_name": "IronLanguages/ironpython3",
"id": "b2598339bbfa7668595112e52fe18a775719cbb3",
"si... |
from __future__ import unicode_literals
import os
from django.conf import settings
from django.test import SimpleTestCase
from django.utils._os import upath
from django.utils.translation import activate, get_language
here = os.path.dirname(os.path.dirname(os.path.abspath(upath(__file__))))
pdir = os.path.split(os.pa... | {
"content_hash": "557b146d47f5f584824e2a18ec5c0bd1",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 79,
"avg_line_length": 28.814814814814813,
"alnum_prop": 0.7197943444730077,
"repo_name": "cloudera/hue",
"id": "b8c083d5368445bd70eb1e608e0523222b3391e9",
"size": "778",
... |
import os
from setuptools import setup, find_packages
setup(name='bisectcloud',
version='1.0',
description='Django application.',
long_description='',
author='',
author_email='',
license='',
url='',
include_package_data=True,
classifiers = [],
packages=find... | {
"content_hash": "933b4e9fcaabf19164a47402498557f0",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 48,
"avg_line_length": 22.176470588235293,
"alnum_prop": 0.5941644562334217,
"repo_name": "AutomatedTester/bisectcloud",
"id": "46f519374a96e683e30a5806257fa1d95dc6d716",
"... |
r"""UUID objects (universally unique identifiers) according to RFC 4122.
This module provides immutable UUID objects (class UUID) and the functions
uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5
UUIDs as specified in RFC 4122.
If all you want is a unique ID, you should probably call uuid1() ... | {
"content_hash": "9b659934a23139b10bc2e84b3e9d3887",
"timestamp": "",
"source": "github",
"line_count": 544,
"max_line_length": 79,
"avg_line_length": 37.35845588235294,
"alnum_prop": 0.6023716970919648,
"repo_name": "MalloyPower/parsing-python",
"id": "e1b2f4b881f8144dd80a65a0df4c60df1d28ba75",
"s... |
import unittest
import numpy as np
import six
import chainer
from chainer.backends import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.utils import type_check
def _as_two_dim(x):
if x.ndim == 2:
return x
... | {
"content_hash": "e514c1c324de4a0eddd18ea8d4581a4a",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 76,
"avg_line_length": 28.348314606741575,
"alnum_prop": 0.6341656757827983,
"repo_name": "anaruse/chainer",
"id": "a4bcded83bf88110d6bccdd341fe67a1d6077abb",
"size": "2523... |
import inspect
import time
import uuid
from oslo_utils import timeutils
from six import moves
from novadocker.virt.docker import client as docker_client
class MockClient(object):
def __init__(self, endpoint=None):
self._containers = {}
self.name = None
# Fake repository
self._re... | {
"content_hash": "0cf754642ef5b4a047ca618b74e0995e",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 73,
"avg_line_length": 33.05990783410138,
"alnum_prop": 0.5294117647058824,
"repo_name": "thanhtien522/nova-docker",
"id": "fb47e1c385ba128ace7ba5761c63a9b8300db398",
"siz... |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
depends_on = (
("meetings", "0010_auto__add_field_meeting_meetup_id"),
)
def forwards(self, orm):
# Adding model ... | {
"content_hash": "0eae57979f1668efac243b7c6c7a4ed0",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 138,
"avg_line_length": 59.86046511627907,
"alnum_prop": 0.5625485625485626,
"repo_name": "tanyaschlusser/chipy.org",
"id": "48ce377199298c7becd4db7dd687aa70aa907c65",
"siz... |
import numpy as np
import cv2 as cv
import time
import faceAPI
from faceAPI import FaceRecognitionModel
debug = True
onComputer = True
fm = FaceRecognitionModel()
# fm.learnAll("./training-images/")
# fm.recognize("./test-images/max_1.jpg")
# fm.recognize("./test-images/will_1.jpg")
# fm.recognize("./test-images/arno... | {
"content_hash": "fdfc73f5e8cf862ca41bb8504989a1b1",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 64,
"avg_line_length": 22.564102564102566,
"alnum_prop": 0.7,
"repo_name": "xamgeis/project_vulcan",
"id": "432adbcdc08c75bd312ae99d72fd2dfdf426f243",
"size": "880",
"bin... |
"""## Casting
TensorFlow provides several operations that you can use to cast tensor data
types in your graph.
@@string_to_number
@@to_double
@@to_float
@@to_bfloat16
@@to_int32
@@to_int64
@@cast
## Shapes and Shaping
TensorFlow provides several operations that you can use to determine the shape
of a tensor and cha... | {
"content_hash": "9868fe4b82a3ded6ae4457865daf03d5",
"timestamp": "",
"source": "github",
"line_count": 1211,
"max_line_length": 82,
"avg_line_length": 32.35177539223782,
"alnum_prop": 0.6476338761549849,
"repo_name": "brodyh/tensorflow",
"id": "28138fbf39f65591c9037a49b10e058926f99b34",
"size": "3... |
from collections import defaultdict
from datetime import timedelta
from math import pow, sqrt
import datetime
import json
from core.utils import get_config
from django.conf import settings
from django.core.cache import cache
from django.db.models import Q
import pytz
class MapJSONGenerator(object):
"""Provides m... | {
"content_hash": "28f7cebf49640cf28d4af4f9c7cccbb2",
"timestamp": "",
"source": "github",
"line_count": 453,
"max_line_length": 167,
"avg_line_length": 35.11479028697572,
"alnum_prop": 0.5754699189036273,
"repo_name": "nyrocron/eve-wspace",
"id": "a6205caab6d36a72b57630c0f1ac6b4804b98e95",
"size": ... |
__all__ = ['Emitter', 'EmitterError']
from error import YAMLError
from events import *
class EmitterError(YAMLError):
pass
class ScalarAnalysis(object):
def __init__(self, scalar, empty, multiline,
allow_flow_plain, allow_block_plain,
allow_single_quoted, allow_double_quoted,
... | {
"content_hash": "468c54073865f8aaf55e4f6cef8832aa",
"timestamp": "",
"source": "github",
"line_count": 1132,
"max_line_length": 85,
"avg_line_length": 37.99028268551237,
"alnum_prop": 0.5104290198814091,
"repo_name": "stitchfix/spinnaker",
"id": "c70771ac344a8d20b1caacb813d23363e2a17bc6",
"size": ... |
'''
Kivy Language
=============
The Kivy language is a language dedicated to describing user interface and
interactions. You could compare this language to Qt's QML
(http://qt.nokia.com), but we included new concepts such as rule definitions
(which are somewhat akin to what you may know from CSS), templating and so on... | {
"content_hash": "1ab1c1c2e918db40906eb86a97301001",
"timestamp": "",
"source": "github",
"line_count": 1808,
"max_line_length": 80,
"avg_line_length": 33.55641592920354,
"alnum_prop": 0.5462996538651722,
"repo_name": "wangjun/kivy",
"id": "23a9e24ad7174fd838fc1873cab8332c899d35b7",
"size": "60670"... |
""" Motion correction / motion correction with slice timing
Routines implementing motion correction and motion correction combined with
slice-timing.
See:
Roche, Alexis (2011) A four-dimensional registration algorithm with application
to joint correction of motion and slice timing in fMRI. *Medical Imaging, IEEE
Tra... | {
"content_hash": "3ae0d05e126664fdc3e14b5bb489be34",
"timestamp": "",
"source": "github",
"line_count": 956,
"max_line_length": 86,
"avg_line_length": 38.29916317991632,
"alnum_prop": 0.5403124487900803,
"repo_name": "nipy/nireg",
"id": "95ace5fc17d931196c24c0a54488d583cf412559",
"size": "36728",
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
""" Fonctions très utiles par Yves Stadler. Optimisations par Michaël Coquard.
Remerciements spéciaux à D. Kratsch pour les cours d'algo pour le tri
fusion :)."""
factCache = [1]
def fact(i) :
""" Calcul de factorielle avec mise en cache des résultats.... | {
"content_hash": "d486586555f728cdc9915747418b2f88",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 80,
"avg_line_length": 30.098039215686274,
"alnum_prop": 0.5061889250814332,
"repo_name": "mvy/Demaratus-Framework",
"id": "728bc0372d93beede5fb00a3c7259fe5f21692a9",
"siz... |
'''
A brute force solution to the annoying Star Trek logic problem:
http://io9.com/can-you-solve-this-extremely-difficult-star-trek-puzzle-1667991339
by John Bohannon
14 December 2014
'''
from itertools import permutations
class Person():
def __init__(self, name):
self.name = name
self.fizz = self.tri = 0
self... | {
"content_hash": "4adeaad505a68b85a1965d3e1dd6ea53",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 102,
"avg_line_length": 36.43,
"alnum_prop": 0.6426022508921219,
"repo_name": "gonzolabs/star_trek",
"id": "fd6d65981e09b15d6d43bae8b0f180018f88f633",
"size": "3666",
"b... |
"""Module to help with parsing and generating configuration files."""
from collections import OrderedDict
import logging
import os
from pathlib import Path
import re
import shutil
from types import ModuleType
from typing import Any, Callable, Dict, Optional, Sequence, Set, Tuple, Union
from awesomeversion import Aweso... | {
"content_hash": "db54c5e9fa809ca3aedc9dab5014525b",
"timestamp": "",
"source": "github",
"line_count": 931,
"max_line_length": 108,
"avg_line_length": 33.13641245972073,
"alnum_prop": 0.6137439222042139,
"repo_name": "partofthething/home-assistant",
"id": "cfc1390a37ba2c5efe05c626de094115ec8b786c",
... |
"""
Wavefront REST API
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST API documentation... | {
"content_hash": "a719e73fc0bbeaa1940b14139da320c9",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 409,
"avg_line_length": 35.5,
"alnum_prop": 0.7338769458858414,
"repo_name": "wavefrontHQ/python-client",
"id": "11651afe1746a2ffd1234bdff0b7b3809c84c57c",
"size": "1366",
... |
"""Tests frame.inspect() """
import unittest
from sparktkregtests.lib import sparktk_test
class FrameInspectTest(sparktk_test.SparkTKTestCase):
def setUp(self):
"""Build test frame"""
super(FrameInspectTest, self).setUp()
dataset = self.get_file("movie_user_5ratings.csv")
schema... | {
"content_hash": "968a336a3c481027bfce6b2585787841",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 78,
"avg_line_length": 37,
"alnum_prop": 0.6162697350816163,
"repo_name": "grehx/spark-tk",
"id": "b07ea73c45b41ce39d9a79348da8dde158ace239",
"size": "4442",
"binary": f... |
from __future__ import absolute_import, print_function, unicode_literals
from django.conf import settings
from django.contrib import admin
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from plugins.models import Slide, Slider
from plugins.serializers import SliderWithInlinesPluginS... | {
"content_hash": "223a2abbd84eeb637b7e275b2eb17a14",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 72,
"avg_line_length": 28,
"alnum_prop": 0.6842105263157895,
"repo_name": "divio/djangocms-rest-api",
"id": "007200e2f6ec1b0c8a1bb9e5653842daed21a457",
"size": "1620",
"b... |
from __future__ import print_function
import numpy as np
import sys
import os
import inspect
from distutils.version import LooseVersion
from ..ext.six import string_types
from ..util import use_log_level
###############################################################################
# Adapted from Python's unittest... | {
"content_hash": "bd4bb7c0a07ff62816ebcfb081f707a7",
"timestamp": "",
"source": "github",
"line_count": 409,
"max_line_length": 79,
"avg_line_length": 30.149144254278728,
"alnum_prop": 0.5589976482037142,
"repo_name": "hronoses/vispy",
"id": "fb4a9797c2393200127434b0de22d5b1b9759a8e",
"size": "1265... |
import os
import re
import subprocess
import time
import urllib.request
from urllib.error import HTTPError
TO_PUBLISH = [
'crates/cargo-platform',
'crates/cargo-util',
'crates/crates-io',
'.',
]
def already_published(name, version):
try:
urllib.request.urlopen('https://crates.io/api/v1/c... | {
"content_hash": "0a2c1937da65387208a1e0e9b4c2fc4a",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 98,
"avg_line_length": 26.470588235294116,
"alnum_prop": 0.5881481481481482,
"repo_name": "eminence/cargo",
"id": "5ace18f7282ea545b26a1b045eb1a527f1068da0",
"size": "1428"... |
import webapp2
import os
from google.appengine.ext.webapp import template
import user_filter
class Require(webapp2.RequestHandler):
def get(self):
user, nickname = user_filter.do_filter()
self.response.out.write(template.render('html/require.html',
... | {
"content_hash": "0206584986d15386cd8143b82f57fd49",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 69,
"avg_line_length": 32.59090909090909,
"alnum_prop": 0.4435146443514644,
"repo_name": "thinkAmi/9784798123028_GAE",
"id": "2d4e0dfaebcc5cfe773c701efd5452c6e5eeb35b",
"si... |
""" (Compute) Unit tests
"""
import os
import sys
import radical.pilot as rp
import unittest
import uuid
from copy import deepcopy
from radical.pilot.db import Session
from pymongo import MongoClient
# DBURL defines the MongoDB server URL and has the format mongodb://host:port.
# For the installation of a MongoDB ser... | {
"content_hash": "3a7aa84044037056f8c314949bc03350",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 84,
"avg_line_length": 31.978835978835978,
"alnum_prop": 0.5286234281932495,
"repo_name": "JensTimmerman/radical.pilot",
"id": "b734009f663184dd9ebee44eb718ba4180165fd1",
... |
import mwapi
import mwapi.errors
my_agent = 'mwapi demo script <ahalfaker@wikimedia.org>'
session = mwapi.Session('https://10.11.12.13', user_agent=my_agent,
timeout=0.5)
print("Making a request that should hang for 0.5 seconds and then timeout.")
try:
session.get(action="fake")
except mw... | {
"content_hash": "af31ce646fcb6f1df855ca78f7a389c6",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 76,
"avg_line_length": 32.5,
"alnum_prop": 0.6692307692307692,
"repo_name": "wikimedia/operations-debs-python-mwapi",
"id": "93004312d24cef9c880ac00eb4f8d0525dde02f3",
"siz... |
from .boolalg import (to_cnf, to_dnf, And, Or, Not, Xor, Nand, Nor, Implies,
Equivalent, ITE, POSform, SOPform, simplify_logic,
bool_equal, bool_map, true, false)
from .inference import satisfiable
| {
"content_hash": "dd0fbdb353d57581be16e2002ae81bed",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 76,
"avg_line_length": 51.5,
"alnum_prop": 0.7135922330097088,
"repo_name": "hrashk/sympy",
"id": "f849c03b8a54b7c000de16a3aef0021ad434e89f",
"size": "206",
"binary": fals... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pants.base.build_environment import get_buildroot
from pants_test.backend.python.pants_requirement_integration_test_base import \
PantsRequirementInt... | {
"content_hash": "46f36a7a492206202bb2317320079b52",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 94,
"avg_line_length": 48.023809523809526,
"alnum_prop": 0.6906296479920674,
"repo_name": "foursquare/pants",
"id": "c7845f56a394fbffe04aea136ae955d18c64e4c7",
"size": "216... |
from office365.runtime.client_result import ClientResult
from office365.runtime.client_value_collection import ClientValueCollection
from office365.runtime.queries.create_entity import CreateEntityQuery
from office365.runtime.queries.service_operation import ServiceOperationQuery
from office365.runtime.paths.service_op... | {
"content_hash": "9e99377cb320341685ec0dc3fcfd8dfe",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 99,
"avg_line_length": 41.08571428571429,
"alnum_prop": 0.6933240611961057,
"repo_name": "vgrem/Office365-REST-Python-Client",
"id": "076251ab3ccb4220e67f8d7a6518ffffbc1368b7... |
"""
Created on Thu Jan 14 16:44:09 2021
@author: Mateo
This short script demonstrates how to use the module for computing
[1] Sabelhaus & Song (2010) age profiles of income volatility.
It does so by replicating the results from the original paper (Figure 6 in [1])
[1] Sabelhaus, J., & Song, J. (2010). The great mode... | {
"content_hash": "065e271e8111312746680998321d1673",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 79,
"avg_line_length": 25.607142857142858,
"alnum_prop": 0.6820083682008368,
"repo_name": "econ-ark/HARK",
"id": "0017be6c8a30f8a499fbdbeba9912d85b34473ac",
"size": "1458",... |
import datetime
from django.conf import settings
from django.db import models
from django.contrib.auth.models import User
BODY_MAX_LENGTH = getattr(settings, 'SIMPLE_COMMENTS_BODY_MAX_LENGTH', 3000)
class BaseComment(models.Model):
"""Abstract base class used to create comment models.
All subclasses **m... | {
"content_hash": "cca8ad887001e3c1f73f38d89f3eae2d",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 79,
"avg_line_length": 38.34939759036145,
"alnum_prop": 0.6352497643732328,
"repo_name": "strange/django-simple-comments",
"id": "78b1ec80df202c41d2123ec8e49e4e5de9dc7f35",
... |
import brian_no_units
import cPickle
from brian import *
from time import time
import os
#Regular stimulation at cerebellum doesn't mean that thalamocortical synapses are firing regularly
#Perhaps irregular stimulation two synapses away leads to regular stimulation
from optparse import OptionParser
from numpy impor... | {
"content_hash": "f72eda311cb5eea5f6239c53bba920fd",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 120,
"avg_line_length": 34.02272727272727,
"alnum_prop": 0.6653306613226453,
"repo_name": "mac389/deep-brain-stimulation",
"id": "c608930e36371620c61a60d3f0dc3b1612674af5",
... |
import datetime
import pytz
from dateutil import relativedelta
UTC_TZ = pytz.timezone('UTC')
EASTERN_TZ = pytz.timezone('US/Eastern')
# Timezones are way harder than one would imagine.
# from betterself.utils import date_utils
def get_datetime_in_eastern_timezone(year, month, day, hour, minute, second=0):
""" ... | {
"content_hash": "a8901fb7a03501dfda654e65e55ab962",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 99,
"avg_line_length": 30.21311475409836,
"alnum_prop": 0.7303309820944113,
"repo_name": "jeffshek/betterself",
"id": "635abf6dec14b023f54fbef717249aa83ae3fb3d",
"size": "1... |
import copy
from django.core.exceptions import ValidationError
from django.forms.utils import ErrorDict, ErrorList, flatatt
from django.test import SimpleTestCase
from django.utils.encoding import force_text
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy
class FormsU... | {
"content_hash": "07a3af86349b7652983d9e56fd0633f8",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 119,
"avg_line_length": 36.92168674698795,
"alnum_prop": 0.5278185674661445,
"repo_name": "twz915/django",
"id": "f52c1956377e9831bae7ac421fad02165b42516c",
"size": "6131"... |
import unittest.mock as mock
from unittest import TestCase
from minio import Minio
from minio.api import _DEFAULT_USER_AGENT
from .minio_mocks import MockConnection, MockResponse
class StatObject(TestCase):
def test_object_is_string(self):
client = Minio('localhost:9000')
self.assertRaises(TypeE... | {
"content_hash": "03bf8e5d0dca9334df7b360d5934fc21",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 79,
"avg_line_length": 36.825,
"alnum_prop": 0.6184657162253904,
"repo_name": "minio/minio-py",
"id": "ebf32adeed101c6df16c419efc7cf895a41cb832",
"size": "2130",
"binary"... |
import sys
sys.path.append('../../')
from scipy import ndimage
from proximal.utils.utils import *
from proximal.halide.halide import *
from proximal.lin_ops import *
import numpy as np
from scipy import signal
import matplotlib.pyplot as plt
import cv2
############################################################
... | {
"content_hash": "c17a76d9450f6c92fdfa38334eb946b6",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 79,
"avg_line_length": 30.586206896551722,
"alnum_prop": 0.5245208568207441,
"repo_name": "comp-imaging/ProxImaL",
"id": "587b8a8628c3a4451e595535c324b76e216682d8",
"size"... |
from ietf.utils.test_utils import SimpleUrlTestCase
class MailingListsUrlTestCase(SimpleUrlTestCase):
def testUrls(self):
self.doTestUrls(__file__)
| {
"content_hash": "acc0046cd4a9f85b9ba85eab3cd10f8c",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 51,
"avg_line_length": 27,
"alnum_prop": 0.7592592592592593,
"repo_name": "mcr/ietfdb",
"id": "043584ea079d4999bf5fa9bdb5c487a0045b2692",
"size": "1830",
"binary": false,
... |
from distutils.command.build_py import build_py
from distutils.command.build_scripts import build_scripts
from distutils.command.install_scripts import install_scripts
from distutils.command.sdist import sdist
import glob
import os.path
import sys
from setuptools import find_packages, setup
from euca2ools import __ve... | {
"content_hash": "e2d4365b421852ecbfd1ad605ad12005",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 79,
"avg_line_length": 42.00769230769231,
"alnum_prop": 0.561435634499176,
"repo_name": "jhajek/euca2ools",
"id": "f4af8b5c8b6acd7db904591c3cd74df3d645f358",
"size": "6808... |
class Student(object):
"""docstring for Student"""
def __init__(self, name, score): # 第一个参数永远是self 表示创建的实例本身
super(Student, self).__init__()
self.__name = name
self.__score = score
def print_score(self):
print('%s: %s' % (self.__name, self.__score))
def get_grade(self):
if self.__score >= 90:
return... | {
"content_hash": "e64abc5a9e98648f2b8c6961791952cc",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 59,
"avg_line_length": 19.73170731707317,
"alnum_prop": 0.6291718170580964,
"repo_name": "henryneu/Python",
"id": "46c26be0ae5a18a68c3f2da2581d9502b21b8399",
"size": "891",... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('payment', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='invoice',
name='level',
field=models.CharField(choices=[('intern', 'Intern')... | {
"content_hash": "a12d1d33a27c0b43b3850d365da6af6f",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 214,
"avg_line_length": 30.5,
"alnum_prop": 0.5881147540983607,
"repo_name": "groundupnews/gu",
"id": "e964a707eefd674c9243809345c9a70c11259e93",
"size": "537",
"binary":... |
from django.test import SimpleTestCase
from cfp import search
class SearchTest(SimpleTestCase):
def test_single_quotes(self):
self.assertEquals(['foo', 'foo bar', 'baz'],
search.tokenize_query("'foo' 'foo bar' baz"))
def test_double_quotes(self):
self.assertEquals([... | {
"content_hash": "538e14c2bab78d904607ba7fd7e51822",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 75,
"avg_line_length": 35.333333333333336,
"alnum_prop": 0.5754716981132075,
"repo_name": "kyleconroy/speakers",
"id": "3c34ccce76be35e17edfb4337586e0c2624f1c7d",
"size": "... |
from django.core.urlresolvers import reverse # noqa
from django.template import defaultfilters as filters
from django.utils.http import urlencode # noqa
from django.utils.translation import ugettext_lazy as _ # noqa
from horizon import tables
from openstack_dashboard import api
class DeleteFlavor(tables.DeleteAc... | {
"content_hash": "6da10386e83d1610eb9117ab6af129bc",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 72,
"avg_line_length": 31.52577319587629,
"alnum_prop": 0.6007194244604317,
"repo_name": "Havate/havate-openstack",
"id": "557ad57919732065e1fea5715d67eddb9bb13d67",
"size"... |
import pygtk
pygtk.require("2.0")
import gtk, gobject
from utils.Form import FormBuilder
from utils.Busqueda import BusquedaWindow
from utils.Database import DataModel
from ImprimirTicket import Ticket
from decimal import *
import datetime
import re
class VentasFactory(gtk.Frame):
__id_venta = 0
def __in... | {
"content_hash": "82093e41a0e40189ab181801f84eb6fd",
"timestamp": "",
"source": "github",
"line_count": 308,
"max_line_length": 149,
"avg_line_length": 46.66233766233766,
"alnum_prop": 0.5816866128583357,
"repo_name": "hey-mx/ventas_pygtk",
"id": "688bb3733889ed8d4c3f478e013c5b65d61918ec",
"size": ... |
__author__ = 'Orthanc Minas'
| {
"content_hash": "de3e26284365d6057a3935c8a472ac00",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 28,
"avg_line_length": 29,
"alnum_prop": 0.6206896551724138,
"repo_name": "orthancminas/Company-Symulator",
"id": "91935bcf5b0ed9ea5cf4be77b6998ba860a7640b",
"size": "29",
... |
from . import fake
FakeObject = fake.Fake
| {
"content_hash": "ba7d6d6a7e320eff68b9a394a775430f",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 22,
"avg_line_length": 14.333333333333334,
"alnum_prop": 0.7441860465116279,
"repo_name": "haarcuba/testix",
"id": "8a9730aa7dc527f806e026d98410dc4620866f21",
"size": "43",
... |
import sys
import re
import socket
from amonagent.modules.core import (
get_uptime,
get_memory_info,
get_cpu_utilization,
get_load_average,
get_network_traffic,
get_ip_address,
get_cpu_info,
disk_check
)
class TestSystemCheck(object):
def test_uptime(self):
uptime = get_uptime()
assert isinstance(upti... | {
"content_hash": "d7c6a3b2a7788e8bde15ae5211949cc2",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 58,
"avg_line_length": 21.519083969465647,
"alnum_prop": 0.6644200070947145,
"repo_name": "amonapp/amonagent-legacy",
"id": "6caebb7c9bc5800c6c84b35ddc4cfe50c3b814b2",
"si... |
import os
import tempfile
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
import numpy as np
import pandas as pd
import pytest
import yaml
from pandas.util import testing as pdt
from collections import OrderedDict
from .. import yamlio
@pytest.fixture
def test_cfg():
retur... | {
"content_hash": "265a5a6294c6522b36442cd24fd59264",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 84,
"avg_line_length": 24.748743718592966,
"alnum_prop": 0.5955329949238579,
"repo_name": "apdjustino/urbansim",
"id": "d5804bed5248820eecf47f0645cda3d77003fcc7",
"size": ... |
import re
__all__ = ['NormalizedVersion', 'suggest_normalized_version',
'VersionPredicate', 'is_valid_version', 'is_valid_versions',
'is_valid_predicate']
# A marker used in the second and third parts of the `parts` tuple, for
# versions that don't have those segments, to sort properly. An examp... | {
"content_hash": "6bf11213d0627bc6cd28816f9165b74c",
"timestamp": "",
"source": "github",
"line_count": 457,
"max_line_length": 81,
"avg_line_length": 35.02407002188184,
"alnum_prop": 0.5300512307884543,
"repo_name": "cournape/Bento",
"id": "36903cc2b6a7576422d2841257079cbc4000646b",
"size": "16006... |
import subprocess
import shutil
from time import sleep
from unittest import TestCase
from dusty.commands.upgrade import _test_dusty_binary
from dusty import constants
from ..testcases import DustyIntegrationTestCase
class TestUpgrade(DustyIntegrationTestCase):
def tearDown(self):
super(TestUpgrade, self... | {
"content_hash": "025c41e86ece485a57cb41f59ced4cc0",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 115,
"avg_line_length": 37.733333333333334,
"alnum_prop": 0.6731448763250883,
"repo_name": "gamechanger/dusty",
"id": "d91c0daa17f6235ab85f033a740b95f44edc6094",
"size": "2... |
class action3component(object):
def __init__(self):
self._initialized = False
def set_animplayfunc(self, animplayfunc):
self._animplay = animplayfunc
def set_soundplayfunc(self, soundplayfunc):
self._soundplay = soundplayfunc
def set_addanimfunc(self, addanimfunc):
sel... | {
"content_hash": "4a5113d6018865412067d5effe29bc00",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 54,
"avg_line_length": 27.96875,
"alnum_prop": 0.6212290502793296,
"repo_name": "agoose77/hivesystem",
"id": "ece81847edd3881d9c50a64a8dc2bd25ea777bae",
"size": "895",
"b... |
import proto # type: ignore
__protobuf__ = proto.module(
package="google.cloud.aiplatform.v1beta1.schema.predict.params",
manifest={
"ImageClassificationPredictionParams",
},
)
class ImageClassificationPredictionParams(proto.Message):
r"""Prediction model parameters for Image Classification... | {
"content_hash": "6a08ed196f5550fb72da22fc82da5b1b",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 68,
"avg_line_length": 26.72972972972973,
"alnum_prop": 0.6319514661274014,
"repo_name": "googleapis/python-aiplatform",
"id": "92826107207e4971db4c8dfec9092382dd02f8c4",
"... |
import numpy as np
import math
from scipy import ndimage, misc
from scipy.interpolate import interp1d
import re
import matplotlib.pyplot as plt
from glob import glob
from define_parameters import paths, parameters
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
class image... | {
"content_hash": "b9b8f1e178471559193182a01aaab90f",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 131,
"avg_line_length": 48.74226804123711,
"alnum_prop": 0.546002538071066,
"repo_name": "ethilliez/Image_augmentation",
"id": "65b9753499d4782f6b62b78298a9ffaa82859f93",
... |
__author__ = 'Xsank'
import os.path
import tornado.ioloop
import tornado.options
import tornado.httpserver
import tornado.web
from urls import handlers
from settings import PORT
from settings import settings
class Application(tornado.web.Application):
def __init__(self):
tornado.web.Application.__init__(... | {
"content_hash": "d7d8a1e8ad682ac57d7d391469a1165f",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 66,
"avg_line_length": 22.03846153846154,
"alnum_prop": 0.7242582897033158,
"repo_name": "xsank/Pyrumpetroll",
"id": "d75fc77f170d563c28dbff76784bb07b074e25c7",
"size": "57... |
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
# check if we have any users on call to assign to
users_on_call = demisto.executeCommand("getUsers", {"onCall": "true"})[0]['Contents']
# if we don't have on shift users, return error, else reassign the provided incident id's t... | {
"content_hash": "9856db409d66fc48c1d2df236b972eb1",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 118,
"avg_line_length": 49.61538461538461,
"alnum_prop": 0.7007751937984497,
"repo_name": "VirusTotal/content",
"id": "047308f089e3391f0a8d3b78430c2a65b55e6de1",
"size": "6... |
import os
# try/except added for compatibility with python < 3.8
try:
from unittest import mock
from unittest.mock import AsyncMock # pragma: NO COVER
except ImportError: # pragma: NO COVER
import mock
import math
from google.api_core import (
future,
gapic_v1,
grpc_helpers,
grpc_helper... | {
"content_hash": "f88fbbe1cebe62f3f0a2d1140b3f7a78",
"timestamp": "",
"source": "github",
"line_count": 1752,
"max_line_length": 121,
"avg_line_length": 36.0513698630137,
"alnum_prop": 0.6479053861499002,
"repo_name": "googleapis/python-retail",
"id": "f2db9d032de402290ac0d8ea4823ffdbda96e98b",
"si... |
from __future__ import absolute_import
# Copyright (c) 2010-2016 openpyxl
"""Workbook is the top-level container for all document information."""
from openpyxl.compat import deprecated
from openpyxl.compat import OrderedDict
from openpyxl.worksheet import Worksheet
from openpyxl.utils.indexed_list import IndexedList... | {
"content_hash": "cc07be117fd0067baa33b633e6962724",
"timestamp": "",
"source": "github",
"line_count": 289,
"max_line_length": 110,
"avg_line_length": 30.273356401384085,
"alnum_prop": 0.63481540747514,
"repo_name": "aragos/tichu-tournament",
"id": "a21d8f3ed8deb3a052de4faa09e18ce72bf43dec",
"size... |
API_UTIL_NAMESPACE = 'json_schema_compiler::util'
class UtilCCHelper(object):
"""A util class that generates code that uses
tools/json_schema_compiler/util.cc.
"""
def __init__(self, type_manager):
self._type_manager = type_manager
def PopulateArrayFromDictionary(self, array_prop, src, name, dst):
"... | {
"content_hash": "49f23aaa620b6e72a1f2b9220f6321ea",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 78,
"avg_line_length": 28.706666666666667,
"alnum_prop": 0.6079888527635857,
"repo_name": "plxaye/chromium",
"id": "8d490ba5ba345877f1aea32a1765a5b3e9475985",
"size": "2320... |
"""
Avalam agent.
Copyright (C) 2015, <<<<<<<<<<< YOUR NAMES HERE >>>>>>>>>>>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that i... | {
"content_hash": "0da8b703c1fcdce7e37823d9f5d65881",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 156,
"avg_line_length": 36.30813953488372,
"alnum_prop": 0.6267413931144916,
"repo_name": "fthuin/artificial-intelligence",
"id": "3ebde2de94360c0572fd7c7a21fd8be8d6097f2a",... |
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from itsdangerous import TimestampSigner
import config
app = Flask(__name__)
app.config.from_object('config')
db = SQLAlchemy(app)
token_signer = TimestampSigner(config.SECRET_KEY)
from app.mod_auth.controller import mod_auth
from app.mod_bucketlists.... | {
"content_hash": "e9320a23b4bacf683b30016e278ee3b8",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 58,
"avg_line_length": 23.77777777777778,
"alnum_prop": 0.8084112149532711,
"repo_name": "andela-brotich/CP2-bucket-list-api",
"id": "39de9d451638178b003b5431162fea5f238fd339... |
from flask import redirect, url_for
from flask_admin.base import AdminIndexView, expose
from flask_admin.contrib.sqla import ModelView
from flask_admin.form import SecureForm
from wtforms.validators import IPAddress, NumberRange
class GroupView(ModelView):
form_base_class = SecureForm
column_searchable_list =... | {
"content_hash": "987129dd2dabd22d3a39de0743483d65",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 118,
"avg_line_length": 39.3235294117647,
"alnum_prop": 0.6305160807778609,
"repo_name": "luuquangvu/fastmonitor",
"id": "e85656ad5138c2ebfc58d92b9700a3cc5a0e1639",
"size":... |
from __future__ import division, print_function, absolute_import
import numpy as np
from . import BPoly, PPoly
from .polyint import _isscalar
__all__ = ["PchipInterpolator", "pchip_interpolate", "pchip",
"Akima1DInterpolator"]
class PchipInterpolator(object):
"""PCHIP 1-d monotonic cubic interpolat... | {
"content_hash": "67d48f50bfee53a171b3651a77565c9f",
"timestamp": "",
"source": "github",
"line_count": 349,
"max_line_length": 85,
"avg_line_length": 33.12893982808023,
"alnum_prop": 0.5708354955889985,
"repo_name": "witcxc/scipy",
"id": "dbd3f15c413fc45ac5b14a1585b7a64ac5c82988",
"size": "11562",... |
from sqf.base_type import ParserType
from sqf.keywords import BINARY_OPERATORS, UNARY_OPERATORS, OP_COMPARISON, PREPROCESSORS_UNARY
class EndToken:
pass
def _normalize(item):
return str(item).lower()
def nud(token, parser):
n_token = _normalize(token)
if n_token in UNARY_OPERATORS:
return ... | {
"content_hash": "2207a684f38d37bd97cddfeb6fbee38a",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 94,
"avg_line_length": 28.30252100840336,
"alnum_prop": 0.5712589073634204,
"repo_name": "LordGolias/sqf",
"id": "a670256bfad27eac99243771fa81b768fc204eb2",
"size": "3368"... |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding unique constraint on 'ApiKey', fields ['key']
db.create_unique(u'oscarapi_apikey', ['key... | {
"content_hash": "495d6d1d44d75863d333cb4a3a8b28ea",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 101,
"avg_line_length": 29.88888888888889,
"alnum_prop": 0.6059479553903345,
"repo_name": "lijoantony/django-oscar-api",
"id": "176c04adb061e2666fc3af2b36490ef87fca6abc",
"... |
from .curver import Curver | {
"content_hash": "70cf58763c559c2d24f1261faf67e92e",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 26,
"avg_line_length": 26,
"alnum_prop": 0.8461538461538461,
"repo_name": "kieranrcampbell/curver-python",
"id": "95cddacdb34c9ead3607d73248574e316a5d0bbf",
"size": "52",
... |
"""
Polygons.py
"""
import gdal, ogr
from gdalconst import *
import argparse
from osgeo import osr
def getArgs():
parser = argparse.ArgumentParser(
description = "Convert raster to polygons"
)
parser.add_argument(
"-i",
"--input",
type = str,
required = True,
help = "input raster file"
)
parser.add... | {
"content_hash": "2c28d891911be0131204c2928156be4e",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 77,
"avg_line_length": 17.890243902439025,
"alnum_prop": 0.6734832992501704,
"repo_name": "jeffreywolf/threshold",
"id": "0f75a3c42fcade86573c7b09403801a2661d1db9",
"size":... |
from django.apps import AppConfig
class WagtailMenusConfig(AppConfig):
name = 'wagtailmenus'
verbose_name = 'WagtailMenus'
| {
"content_hash": "5e0749af7530764d10ec3d7ebb410e92",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 36,
"avg_line_length": 22.166666666666668,
"alnum_prop": 0.7518796992481203,
"repo_name": "ababic/wagtailmenus",
"id": "45ae7d85f93e1695ce08acdb85e15e1b51395141",
"size": "1... |
import sys, inspect
import numpy as np
from ..data.mfstructure import DatumType
from ..data import mfdata
from collections import OrderedDict
from ..mfbase import ExtFileAction, MFDataException
from ...datbase import DataType
from .mfdatautil import convert_data, to_string
from .mffileaccess import MFFileAccessScalar
f... | {
"content_hash": "64a397f47283da6aa8c327fb9b20c35d",
"timestamp": "",
"source": "github",
"line_count": 891,
"max_line_length": 79,
"avg_line_length": 36.36026936026936,
"alnum_prop": 0.4566163533660524,
"repo_name": "aleaf/flopy",
"id": "2c88480d008d5705662d7a768bfae998eab991c0",
"size": "32397",
... |
'''
Created on Apr 4, 2017
@author: benelot
'''
import gym
import gym, gym.spaces, gym.utils, gym.utils.seeding
import numpy as np
import pybullet as p
def state_fields_of_pose_of(body_id, link_id=-1): # a method you will most probably need a lot to get pose and orientation
if link_id == -1:
(x,y,z), (a,... | {
"content_hash": "c2ee46bcda999c8ecf97e4307e53bbcd",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 125,
"avg_line_length": 38.741379310344826,
"alnum_prop": 0.6290609701824655,
"repo_name": "benelot/bullet-gym",
"id": "5149d02112ac8fa5b665d5a143ba1b5d808d676d",
"size": ... |
from errno import EACCES, EPERM
import os
from shutil import rmtree as shutil_rmtree
import stat
import sys
def rmtree(path):
kwargs = {}
if sys.platform == 'win32':
kwargs['onerror'] = _onerror_windows
return shutil_rmtree(path, **kwargs)
def _onerror_windows(function, path, excinfo):
if is... | {
"content_hash": "9550e9a6b1be1d32b39b4b7015226d11",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 79,
"avg_line_length": 25.11111111111111,
"alnum_prop": 0.6792035398230089,
"repo_name": "dirk-thomas/vcstool",
"id": "c8869ae80044028680a46bb28450b7fbc4ae9b74",
"size": "4... |
from flask_security import RoleMixin
from app import config
db = config.db
class Role(db.Document, RoleMixin):
name = db.StringField(max_length=80, unique=True)
description = db.StringField(max_length=255)
| {
"content_hash": "9acf9b011856cc00972069c0ac63c905",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 53,
"avg_line_length": 24.11111111111111,
"alnum_prop": 0.7511520737327189,
"repo_name": "pony012/PruebaServicioCucea",
"id": "de4258553a596dc191bcf0aaf21d1c6ad709b1b6",
"si... |
import sys, logging, os
from raygun4py import raygunprovider
# Hook the Raygun logging handler up:
logger = logging.getLogger("mylogger")
rgHandler = raygunprovider.RaygunHandler("paste_your_api_key_here")
logger.addHandler(rgHandler)
def log_exception(exc_type, exc_value, exc_traceback):
logger.error("A python ... | {
"content_hash": "3042819f5512bf3ffb6621cf1ec4b5f1",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 90,
"avg_line_length": 27.333333333333332,
"alnum_prop": 0.7526132404181185,
"repo_name": "Osmose/raygun4py",
"id": "d19e52caf702715c8229b81a715ddeaea3dbb4c7",
"size": "574... |
from __future__ import absolute_import, division, print_function
import glob
import os.path
# We need to import this prior to importing cffi to fix prebuilding the
# extension modules
from nacl import _cffi_fix # noqa
from cffi import FFI
from cffi.verifier import Verifier
__all__ = ["ffi"]
HEADERS = glob.glo... | {
"content_hash": "d2ac7532b54f362f8fe74a3a358ad029",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 74,
"avg_line_length": 24.905405405405407,
"alnum_prop": 0.6516549104720565,
"repo_name": "alex/pynacl",
"id": "d30f16c5fe61a570e56af24f288d6447bd767e29",
"size": "2444",
... |
import sys
import unittest
from alphatwirl.selection import build_selection
from alphatwirl.selection.modules import All
from alphatwirl.selection.modules import Any
from alphatwirl.selection.modules import Not
from alphatwirl.selection.modules.LambdaStr import LambdaStr
##____________________________________________... | {
"content_hash": "dff464a7340de3f1734b9fdcdbc18666",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 70,
"avg_line_length": 30.923076923076923,
"alnum_prop": 0.5477611940298508,
"repo_name": "TaiSakuma/AlphaTwirl",
"id": "76eb8de9a5a98a491c29a23406f00aad969822b4",
"size": ... |
import sublime
from php_coverage.debug import debug_message
sublime3 = int(sublime.version()) >= 3000
if sublime3:
set_timeout_async = sublime.set_timeout_async
else:
debug_message("Adding Sublime 3 polyfills")
set_timeout_async = sublime.set_timeout
| {
"content_hash": "05563104f39d3efb82eb80f3a6761387",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 49,
"avg_line_length": 24.181818181818183,
"alnum_prop": 0.7443609022556391,
"repo_name": "bradfeehan/SublimePHPCoverage",
"id": "ed5a05552f360625744ab5f0263a347c49dd526a",
... |
import platform
import socket
import time
import rpm
import logging
class Info(object):
## This class take the information of the rpms attacking to the RPM's api and host information
def __init__(self):
pass
def rpm_getinfo(self):
## Catch all rpm installed in the system only for CentOS/RedHat/Fedora
... | {
"content_hash": "67f078e30797dc3f2fe1ea7e53c1a062",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 98,
"avg_line_length": 31.941176470588236,
"alnum_prop": 0.6519337016574586,
"repo_name": "padajuan/rpmController",
"id": "85372c4b8799db11be144e0fc136605a15005579",
"size"... |
import numpy as np
import math
import onnx
from onnx import helper, TensorProto, mapping
import torch
import torchvision
import tvm.topi.testing
import tvm
from tvm import relay
from tvm.contrib import graph_runtime
import scipy
import tvm.testing
def get_input_data_shape_dict(graph_def, input_data):
if isinstanc... | {
"content_hash": "0aba827c9d156e077a36ff364d99bcf8",
"timestamp": "",
"source": "github",
"line_count": 3873,
"max_line_length": 100,
"avg_line_length": 34.104053705138135,
"alnum_prop": 0.571253359579059,
"repo_name": "tqchen/tvm",
"id": "81b5186d0e261bd82677597ea9c19a67f6782749",
"size": "132870"... |
from django.db import models
from localflavor.au.models import (AUBusinessNumberField, AUCompanyNumberField, AUPhoneNumberField, AUPostCodeField,
AUStateField, AUTaxFileNumberField)
class AustralianPlace(models.Model):
state = AUStateField(blank=True)
state_required = AUSta... | {
"content_hash": "345fa1d234f2af0bfc0cc4c9bb14f917",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 116,
"avg_line_length": 40.44444444444444,
"alnum_prop": 0.7266483516483516,
"repo_name": "jieter/django-localflavor",
"id": "a8323f9ca035ff28f6cb3df45dd9e7490e4770f6",
"si... |
import datetime
import itertools
import ddt
import glanceclient.exc
import mock
from oslo_config import cfg
from cinder import context
from cinder import exception
from cinder.image import glance
from cinder import test
from cinder.tests.unit.glance import stubs as glance_stubs
CONF = cfg.CONF
class NullWriter(ob... | {
"content_hash": "240b63d392750b0e47246233de8e5b76",
"timestamp": "",
"source": "github",
"line_count": 941,
"max_line_length": 79,
"avg_line_length": 38.48990435706695,
"alnum_prop": 0.5501256246721334,
"repo_name": "ge0rgi/cinder",
"id": "3370b2603dfede2e07e466d0f65bae267fd969d4",
"size": "36856"... |
"""Tests for treadmill.rest.api.*"""
| {
"content_hash": "e16b62ffc4a3aab46aa8ec4928eaf141",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 36,
"avg_line_length": 37,
"alnum_prop": 0.6486486486486487,
"repo_name": "ThoughtWorksInc/treadmill",
"id": "7b7ac17bcf8e558056f646ca6c01efd0c9d98e86",
"size": "37",
"bin... |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_... | {
"content_hash": "cc9e4ffcae58f415b5c62756a79db671",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 135,
"avg_line_length": 26.634146341463413,
"alnum_prop": 0.6961538461538461,
"repo_name": "mahabs/nitro",
"id": "168a4aa99b3ede305d99d77100a539e0c79d2aa2",
"size": "6074"... |
from models import Record
from db import session
from flask_restful import reqparse
from flask_restful import abort
from flask_restful import Resource
from flask_restful import fields
from flask_restful import marshal_with
record_fields = {
'id': fields.Integer,
'data': fields.String,
'uri': fields.Url('r... | {
"content_hash": "5df5bef44352c34f614930690b626910",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 70,
"avg_line_length": 28.689655172413794,
"alnum_prop": 0.6382211538461539,
"repo_name": "RunnerPro/ProApi",
"id": "f913810457aec9ce3ea56f43614646a7755566ac",
"size": "166... |
import paramiko
from mistral.openstack.common import log as logging
LOG = logging.getLogger(__name__)
def _read_paramimko_stream(recv_func):
result = ''
buf = recv_func(1024)
while buf != '':
result += buf
buf = recv_func(1024)
return result
def _connect(host, username, password)... | {
"content_hash": "19e2f695f241ccfd97fd9a0098cb31a1",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 71,
"avg_line_length": 25.818181818181817,
"alnum_prop": 0.6119718309859155,
"repo_name": "dmitryilyin/mistral",
"id": "a774ec6ac8df6e26d79b057edfd5f6043314a4f1",
"size": "... |
from collections import Iterable
import numpy as np
Menpo3dErrorMessage = ("In order to keep menpo's dependencies simple, menpo "
"does not contain 3D importing and visualization code. "
"Please install menpo3d to view 3D meshes.")
class Renderer(object):
r"""
... | {
"content_hash": "6c5e68584660f15a75fb2c45cb1da628",
"timestamp": "",
"source": "github",
"line_count": 464,
"max_line_length": 80,
"avg_line_length": 39.008620689655174,
"alnum_prop": 0.5992265193370165,
"repo_name": "mozata/menpo",
"id": "2073eae1388dd19b9aacfe304a5c1d080337aa3d",
"size": "18100"... |
from _mysql import OperationalError
import sys
import os
from DataBaseSchemaSync.SchemaComparison import SchemaComparison
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from DataBaseSchemaSync.db.MysqlDataBaseConnector import MysqlDataBaseConnector
import json
from DataBaseSchemaSync.u... | {
"content_hash": "c67c3d958de612d5dc5762bda10e5944",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 79,
"avg_line_length": 28.098039215686274,
"alnum_prop": 0.6454989532449407,
"repo_name": "lyrl/database_schema_sync",
"id": "6354e0e4861c5bcecef90096c65739bcedfa8ac5",
"si... |
_method_cache = {}
class methodcaller(object):
"""
Return a callable object that calls the given method on its operand.
Unlike the builtin `operator.methodcaller`, instances of this class are
serializable
"""
__slots__ = ('method',)
func = property(lambda self: self.method) # For `funcn... | {
"content_hash": "f682b18247d998c0bc6ceb902cbde9ff",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 75,
"avg_line_length": 24.163265306122447,
"alnum_prop": 0.5734797297297297,
"repo_name": "mrocklin/streams",
"id": "4e1538da7c4506a9bf7fed145c07d2eb9fdde2bc",
"size": "118... |
"""
This code was generated by Codezu.
Changes to this file may cause incorrect behavior and will be lost if
the code is regenerated.
"""
from mozurestsdk.mozuclient import default as default_client
from mozurestsdk.mozuurl import MozuUrl;
from mozurestsdk.urllocation import UrlLocation
from mozures... | {
"content_hash": "d9c7b826680b66581267f6a6594adbbc",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 241,
"avg_line_length": 34.72727272727273,
"alnum_prop": 0.7604712041884817,
"repo_name": "sanjaymandadi/mozu-python-sdk",
"id": "8646c39d631fd35f4aa1fe5a4e5e8e49e728d154",
... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('speakers', '0003_remove_speaker_sessions_preference'),
]
operations = [
migrations.AddField(
model_name='speaker',
name='mob... | {
"content_hash": "49d7d80e3da69c2b6e70cf29fda46013",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 230,
"avg_line_length": 32.27777777777778,
"alnum_prop": 0.657487091222031,
"repo_name": "PyCon/pycon",
"id": "61f85d594b52a6bdc966a1df154f001dc91da320",
"size": "605",
"... |
import zipfile
def unzip(filename, dir):
zf = zipfile.ZipFile(filename)
zf.extractall(dir)
def unzip1(filename, dir):
zf = zipfile.ZipFile(filename)
zf.extract(dir)
| {
"content_hash": "02213e2ce91f81cfd085d52a61bac627",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 34,
"avg_line_length": 18.9,
"alnum_prop": 0.671957671957672,
"repo_name": "github/codeql",
"id": "b6ae48e1d88611b1e5cc2b56314263989592e6b5",
"size": "189",
"binary": fal... |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Stream(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "ohlc"
_path_str = "ohlc.stream"
_valid_props = {"maxpoints", "token"}
# maxpoints
#... | {
"content_hash": "654141f7bcddef715a8468edc06f15c2",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 82,
"avg_line_length": 29.364285714285714,
"alnum_prop": 0.5254196059352956,
"repo_name": "plotly/python-api",
"id": "8bf7dfcd6dc619b808657d5b918816f9d280695b",
"size": "4... |
import base64
import cloudstorage
import datetime
import json
import logging
import tba_config
import traceback
from google.appengine.ext import ndb
from consts.event_type import EventType
from controllers.api.api_status_controller import ApiStatusController
from datafeeds.datafeed_base import DatafeedBase
from model... | {
"content_hash": "79e08385938932e0438cc7e5fe235cb0",
"timestamp": "",
"source": "github",
"line_count": 439,
"max_line_length": 165,
"avg_line_length": 46.85876993166287,
"alnum_prop": 0.5950610082154489,
"repo_name": "bdaroz/the-blue-alliance",
"id": "cacedc34fd92301e4902de66a50906c8129c16b8",
"si... |
from route53.change_set import ChangeSet
from route53.exceptions import AlreadyDeletedError
from route53.resource_record_set import AResourceRecordSet, AAAAResourceRecordSet, CNAMEResourceRecordSet, MXResourceRecordSet, NSResourceRecordSet, PTRResourceRecordSet, SOAResourceRecordSet, SPFResourceRecordSet, SRVResourceRe... | {
"content_hash": "5602d9698f52bbaa1a5933a34acdd980",
"timestamp": "",
"source": "github",
"line_count": 414,
"max_line_length": 257,
"avg_line_length": 42.22463768115942,
"alnum_prop": 0.6316572278473771,
"repo_name": "EricSchles/python-route53",
"id": "2c9332524d412088a947fe4021a6b0ec5eadd042",
"s... |
""" Sahana Eden Automated Test - HRM003 Create Staff Training
@copyright: 2011-2012 (c) Sahana Software Foundation
@license: MIT
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 Softwar... | {
"content_hash": "fb7540ad6810a33831682ad3aba25af8",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 110,
"avg_line_length": 38.51948051948052,
"alnum_prop": 0.5906945380984491,
"repo_name": "mrGeen/eden",
"id": "66189b6608fe3d342d2e6a165a7f7a7eaf591542",
"size": "2966",
... |
import logging
class _AnsiColorStreamHandler(logging.StreamHandler):
DEFAULT = '\x1b[0m'
RED = '\x1b[31m'
GREEN = '\x1b[32m'
YELLOW = '\x1b[33m'
CYAN = '\x1b[36m'
CRITICAL = RED
ERROR = RED
WARNING = YELLOW
INFO = GREEN
DEBUG = CYAN
@classmethod
de... | {
"content_hash": "2bc2cbb5c8d752cb83c373762dd56879",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 95,
"avg_line_length": 35.22680412371134,
"alnum_prop": 0.6376938835235587,
"repo_name": "FichteFoll/TelegramIRCImageProxy",
"id": "e04f28570a2d6ff9528c97485a9a30f063057754",... |
import matplotlib.pyplot as plt
import prettyplotlib as ppl
import itertools
import sklearn
import asyncio
import random
import math
import numpy as np
def data_gen():
status = {True:'running', False:'sleeping'}
return [{'battery':random.randint(0,5), 'status':status[random.random()>0.9]} for i in range(5)]
# ... | {
"content_hash": "2e2e359b5298ef31259792952e2a562d",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 122,
"avg_line_length": 38.72043010752688,
"alnum_prop": 0.6467647875590113,
"repo_name": "jamesjarlathlong/resourceful",
"id": "6a646b891a6b5690fc8a459b18f99904e1d05117",
... |
"""DB related custom exceptions."""
import six
from ironic.openstack.common.gettextutils import _
class DBError(Exception):
"""Wraps an implementation specific exception."""
def __init__(self, inner_exception=None):
self.inner_exception = inner_exception
super(DBError, self).__init__(six.tex... | {
"content_hash": "3a2cd5b539f98a5d4f610630159f1c81",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 69,
"avg_line_length": 28.5,
"alnum_prop": 0.6824561403508772,
"repo_name": "varunarya10/ironic",
"id": "d4b8ff442e5f5fbfa5c6b58e5f6f3b3b33852e72",
"size": "1872",
"binar... |
"""
ROS Master API.
L{ROSMasterHandler} provides the API implementation of the
Master. Python allows an API to be introspected from a Python class,
so the handler has a 1-to-1 mapping with the actual XMLRPC API.
API return convention: (statusCode, statusMessage, returnValue)
- statusCode: an integer indicating the... | {
"content_hash": "cc29dfc26dacd817742a06f05addfb71",
"timestamp": "",
"source": "github",
"line_count": 846,
"max_line_length": 165,
"avg_line_length": 40.523640661938536,
"alnum_prop": 0.5858005425429513,
"repo_name": "MangoMangoDevelopment/neptune",
"id": "bf78a889e0c527d83a45cedd5c525f3b9534112c",... |
import sys
from setuptools import setup
packages = ['BacklogPy', 'BacklogPy.api']
requires = [
'requests',
'Deprecated'
]
test_requirements = ['mock', 'nose']
if sys.version_info < (2, 7, 0):
test_requirements.append('unittest2')
with open('LICENSE', 'r') as f:
_license = f.read()
with open('READM... | {
"content_hash": "c395af048adb417e865fa53ea2aa75b5",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 70,
"avg_line_length": 28.982142857142858,
"alnum_prop": 0.6149106592729513,
"repo_name": "koxudaxi/BacklogPy",
"id": "0c29c4d8d0dd93aa2c8c3b746a294373b537dca0",
"size": "1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.