text stringlengths 4 1.02M | meta dict |
|---|---|
import boxm_batch;
boxm_batch.register_processes();
boxm_batch.register_datatypes();
class dbvalue:
def __init__(self, index, type):
self.id = index # unsigned integer
self.type = type # string
model_dir ="/Users/isa/Experiments/CapitolBOXM_1_1_1";
print("Creating a Scene");
boxm_batch.init_process(... | {
"content_hash": "7769f584ba88618a640f53a8c299ccec",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 65,
"avg_line_length": 29.05128205128205,
"alnum_prop": 0.7016769638128861,
"repo_name": "mirestrepo/voxels-at-lems",
"id": "2b3d652e120a32fa5eb463bbc462c72595eccaf1",
"siz... |
import collections
import os
import re
from pprint import pformat
from six import string_types
from simgen.utils.dict_merge import data_merge
from simgen.utils.marked_yaml import marked_load as safe_load, marked_load
#PLACEHOLDER_PATTERN = r'^\s*\{\{\s*\(?P<name>w+)\s*\}\}\s*$'
PLACEHOLDER_PATTERN = r'^\s... | {
"content_hash": "b333b1cfb50aa28f1d0634bcefcc33d6",
"timestamp": "",
"source": "github",
"line_count": 315,
"max_line_length": 223,
"avg_line_length": 39.231746031746034,
"alnum_prop": 0.5547014079948211,
"repo_name": "iModels/simgen",
"id": "0ca07daec7d654d0fef0f7e93524663501c999e3",
"size": "123... |
from django.http import HttpResponse
from django.core.paginator import Paginator
from django.views.decorators.csrf import csrf_exempt
from rest_framework.renderers import JSONRenderer
from rest_framework.parsers import JSONParser
from crawl.models import Crawl, PageReference
from crawl.serializers import CrawlSerialize... | {
"content_hash": "d12b3bc75b3ba25c52853d48ba7e6e53",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 70,
"avg_line_length": 34.5,
"alnum_prop": 0.6774193548387096,
"repo_name": "ethan-lau/mars",
"id": "84b4fe55e82984a9c7151fcd114efa4b996d33cc",
"size": "2139",
"binary": ... |
import fbchisellldbbase as fb
import fbchisellldbobjcruntimehelpers as runtimeHelpers
import fbchisellldbviewcontrollerhelpers as viewControllerHelpers
import fbchisellldbviewhelpers as viewHelpers
import lldb
def lldbcommands():
return [
FBCoreAnimationFlushCommand(),
FBDrawBorderCommand(),
... | {
"content_hash": "025cb1356de1aa1e3175649f69776ee5",
"timestamp": "",
"source": "github",
"line_count": 359,
"max_line_length": 173,
"avg_line_length": 28.779944289693592,
"alnum_prop": 0.5429732868757259,
"repo_name": "facebook/chisel",
"id": "5902ba95e3b1511c47795154cd6cb051e4d2d03d",
"size": "10... |
#######################################################################
#
# Copyright 2009-2010 by Ullrich Koethe
#
# This file is part of the VIGRA computer vision library.
# The VIGRA Website is
# http://hci.iwr.uni-heidelberg.de/vigra/
# Please direct questions, bug reports, and contribution... | {
"content_hash": "07c4fa68d81a861f3f6101ea512b7e8d",
"timestamp": "",
"source": "github",
"line_count": 1704,
"max_line_length": 218,
"avg_line_length": 36.505868544600936,
"alnum_prop": 0.617110889624795,
"repo_name": "dstoe/vigra",
"id": "c5764cd97122797ce8304cb791e574c6df3bb9b3",
"size": "62208"... |
import os
from tests.providers.google.cloud.operators.test_dataproc_operator_system_helper import DataprocTestHelper
from tests.providers.google.cloud.utils.gcp_authenticator import GCP_DATAPROC_KEY
from tests.test_utils.gcp_system_helpers import CLOUD_DAG_FOLDER, provide_gcp_context, skip_gcp_system
from tests.test_u... | {
"content_hash": "712f66779e61a305519f6a2d983f8ba8",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 106,
"avg_line_length": 40.3,
"alnum_prop": 0.738626964433416,
"repo_name": "wileeam/airflow",
"id": "7c69c6b8e25c1258e74f28ae93a24a39dfe4042a",
"size": "1996",
"binary":... |
import os
import numpy as np
import pytest
from spotlight.cross_validation import user_based_train_test_split
from spotlight.datasets import synthetic
from spotlight.evaluation import sequence_mrr_score
from spotlight.layers import BloomEmbedding
from spotlight.sequence.implicit import ImplicitSequenceModel
from spo... | {
"content_hash": "2152577b4b74c3968bc96ec70ac854ed",
"timestamp": "",
"source": "github",
"line_count": 340,
"max_line_length": 84,
"avg_line_length": 35.63235294117647,
"alnum_prop": 0.4741229880313661,
"repo_name": "maciejkula/spotlight",
"id": "a3f89eb66d113b6c73147ee4e4684abac7fca88d",
"size": ... |
from keystoneclient import base
from keystoneclient import utils
class Token(base.Resource):
def __repr__(self):
return "<Token %s>" % self._info
@property
def id(self):
return self._info['token']['id']
@property
def expires(self):
return self._info['token']['expires']
... | {
"content_hash": "69e9349f3f9518a246ca67292840af09",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 78,
"avg_line_length": 32.58490566037736,
"alnum_prop": 0.5639837869137232,
"repo_name": "jamielennox/python-keystoneclient",
"id": "53ea1da97333c44e90a79c42f1383a29edf00c00"... |
from fixture.TestBase import BaseClass
from selenium.webdriver.firefox.webdriver import WebDriver
class Contract:
def __init__(self, first_name=None, middle_name=None, last_name=None, nickname=None, title=None, company_name=None,
address_name=None, home=None, mobile=None, work=None, fax=None, ema... | {
"content_hash": "ed4b49b55a34f923305b41ddc58db23c",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 119,
"avg_line_length": 44.79874213836478,
"alnum_prop": 0.59581636950723,
"repo_name": "werbk/task-2.3",
"id": "58706f53a76b42357b578e35ab873941de1f6489",
"size": "7123",... |
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
import sys
import logging
from .ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
class Iface(object):
def add(self, a, ... | {
"content_hash": "f270f20b828a91429b1c82d9e860a375",
"timestamp": "",
"source": "github",
"line_count": 232,
"max_line_length": 134,
"avg_line_length": 30.935344827586206,
"alnum_prop": 0.5466072175003484,
"repo_name": "snower/TorThrift",
"id": "0833e3ea66670ecae87397d6e7f004c7e8acae3f",
"size": "7... |
import sys
from setuptools import setup
needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
setup_requires = ['pytest-runner>=2.0,<3.0'] if needs_pytest else []
setup(
name='NearPy',
version='0.2.2',
author='Ole Krause-Sparmann',
author_email='ole@pixelogik.de',
packages=[
'nea... | {
"content_hash": "ffa348dff659f7b99401ad2596f4cc5b",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 76,
"avg_line_length": 25,
"alnum_prop": 0.5821052631578948,
"repo_name": "akabos/NearPy",
"id": "9cdb26b4ba1f6d91f8d934ea030eff9d11b7dd96",
"size": "972",
"binary": fals... |
import numpy as np
from chainermn.communicators import _memory_utility
from chainermn.communicators import mpi_communicator_base
class FlatCommunicator(mpi_communicator_base.MpiCommunicatorBase):
def __init__(self, mpi_comm):
super(FlatCommunicator, self).__init__(mpi_comm)
self.gpu_buffer_a = ... | {
"content_hash": "29d90cf40062f237ef579e2deee82580",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 78,
"avg_line_length": 41.14705882352941,
"alnum_prop": 0.5975696926375983,
"repo_name": "hvy/chainer",
"id": "c3407f3dbb6b75515106b4447daf5c490f7e11bf",
"size": "1399",
... |
"""
Name: u12.py
Desc: Defines the U12 class, which makes working with a U12 much easier. The
functions of the U12 class are divided into two categories: UW and
low-level.
Most of the UW functions are exposed as functions of the U12 class. With
the exception of the "e" functions, UW fun... | {
"content_hash": "1ecba101c153a518b2059085df247723",
"timestamp": "",
"source": "github",
"line_count": 2982,
"max_line_length": 327,
"avg_line_length": 38.469818913480886,
"alnum_prop": 0.5403383979706582,
"repo_name": "jf87/smap",
"id": "3c16410bee7a6779d94bf38c9a080706615c8ad1",
"size": "114717"... |
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
import webapp.apps.taxbrain.models
import jsonfield.fields
import django.db.models.deletion
from django.conf import settings
import uuidfield.fields
class Migration(migrations.Migration):
dependencies = [
('... | {
"content_hash": "82a89a224b616b769aa74d216f4f9869",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 143,
"avg_line_length": 53.93150684931507,
"alnum_prop": 0.6217932435864871,
"repo_name": "zrisher/webapp-public",
"id": "23d5ee54cc9a5ec20897f9a10556b1a4e54fd619",
"size":... |
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
ex... | {
"content_hash": "9ed62d69a75a5719eb98e6b90535b92b",
"timestamp": "",
"source": "github",
"line_count": 685,
"max_line_length": 317,
"avg_line_length": 68.97080291970804,
"alnum_prop": 0.7347444173986665,
"repo_name": "JosephGoulden/PyBitmessageF2F",
"id": "e35b30cd22b32c2e7e8a611dc4395cb33f36492f",
... |
"""Input functions."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import pandas as pd
SCHEMA = {{ schema }}
TARGET = "{{ target }}"
def download_data(train_path, eval_path):
"""Downloads train and eval datasets from GCP.
... | {
"content_hash": "8715f898d799f60fcc5d7016b83d6031",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 70,
"avg_line_length": 28.705882352941178,
"alnum_prop": 0.6495901639344263,
"repo_name": "GoogleCloudPlatform/ml-pipeline-generator-python",
"id": "a400cc66126034f4ba1868bda... |
"""Test extension array for storing nested data in a pandas container.
The JSONArray stores lists of dictionaries. The storage mechanism is a list,
not an ndarray.
Note:
We currently store lists of UserDicts (Py3 only). Pandas has a few places
internally that specifically check for dicts, and does non-scalar things
... | {
"content_hash": "505e79f030b647fb1b893d6bae2a1a11",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 79,
"avg_line_length": 33.06532663316583,
"alnum_prop": 0.5737082066869301,
"repo_name": "GuessWhoSamFoo/pandas",
"id": "10fd21f89c5641b7e73e7bef609b3938d932230d",
"size":... |
""" handle_webhook will return the correct fullfilment response dependong the tag that is sent in the request"""
# [START dialogflow_cx_webhook]
# TODO(developer): change entry point to handle_webhook in cloud function
def handle_webhook(request):
req = request.get_json()
tag = req["fulfillmentInfo"]["tag... | {
"content_hash": "e5e0b9eba86fdd564b4d8322a21ec9a8",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 180,
"avg_line_length": 30.375,
"alnum_prop": 0.5851851851851851,
"repo_name": "googleapis/python-dialogflow-cx",
"id": "516000cd45f6d19ff6eed65bb21529022c5cd393",
"size": ... |
"""Paddings."""
from haiku._src.pad import causal
from haiku._src.pad import create_from_padfn
from haiku._src.pad import create_from_tuple
from haiku._src.pad import full
from haiku._src.pad import is_padfn
from haiku._src.pad import PadFn
from haiku._src.pad import reverse_causal
from haiku._src.pad import same
from... | {
"content_hash": "3971a20b5c96fdb84870d0a2407d9d2f",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 44,
"avg_line_length": 22.115384615384617,
"alnum_prop": 0.671304347826087,
"repo_name": "deepmind/dm-haiku",
"id": "d2a84aaaf509b733cf96c77151b29b22a2bace90",
"size": "130... |
import random
try:
import nltk.data
except Exception as e:
print "cannot import nltk"
import copy
import client
try:
import corenlp
except Exception as e:
print "cannot import corenlp"
import time
from unidecode import unidecode
import database
import rewrite_rules as rr
import depend_tree as deptree
c... | {
"content_hash": "9645a4ea083c415cfb6f21cbcf537747",
"timestamp": "",
"source": "github",
"line_count": 457,
"max_line_length": 190,
"avg_line_length": 38.29978118161926,
"alnum_prop": 0.5772153345140832,
"repo_name": "jvictor0/TiaraBoom",
"id": "c0b329239fdeeda3a0d990e5a48384274c545410",
"size": "... |
"""
Unit tests for the waveform_feature module.
:copyright: Copyright 2014-2020 by the Elephant team, see `doc/authors.rst`.
:license: Modified BSD, see LICENSE.txt for details.
"""
from __future__ import division
import unittest
import numpy as np
import quantities as pq
from numpy.testing import assert_array_almo... | {
"content_hash": "58c6bacea7db94a3841d5eb737c12da7",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 79,
"avg_line_length": 37.380434782608695,
"alnum_prop": 0.6025007269555103,
"repo_name": "mdenker/elephant",
"id": "aff400afa2c20489c662401f21d0b6d4a941da69",
"size": "343... |
import sys
import pytest
from flask_debugtoolbar import _printable
def load_app(name):
app = __import__(name).app
app.config['TESTING'] = True
return app.test_client()
def test_basic_app():
app = load_app('basic_app')
index = app.get('/')
assert index.status_code == 200
assert b'<div i... | {
"content_hash": "94ffc04318f71eebdd166fa2c61f6787",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 66,
"avg_line_length": 25.70731707317073,
"alnum_prop": 0.6233396584440227,
"repo_name": "lepture/flask-debugtoolbar",
"id": "fd04ddc8f1b67461939b3b4019dadfcca2d54675",
"si... |
"""Classes and methods to create and manage Courses."""
__author__ = 'Pavel Simakov (psimakov@google.com)'
import datetime
import os
import urllib
from common import jinja_filters
from common import safe_dom
from controllers import sites
from controllers.utils import ApplicationHandler
from controllers.utils import H... | {
"content_hash": "4fc2129a73593af2fb6a1967a626e922",
"timestamp": "",
"source": "github",
"line_count": 821,
"max_line_length": 187,
"avg_line_length": 38.66991473812424,
"alnum_prop": 0.5514678089958422,
"repo_name": "ksh/gpitrainingv2",
"id": "ca6f23d34fa59ff3832eff1152cb8b7d4a5bda2a",
"size": "3... |
import os.path
ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
PROJECT_NAME = os.path.basename(ROOT_DIR)
def ABS_PATH(*args):
return os.path.join(ROOT_DIR, *args)
def ENV_SETTING(key, default):
import os
return os.environ.get(key, default)
ADMINS = (
# ('Your Name', 'you... | {
"content_hash": "039813fab6b4ec00e2a0b6bb4beb11a8",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 79,
"avg_line_length": 30.720183486238533,
"alnum_prop": 0.657010601761983,
"repo_name": "c4all/c4all",
"id": "1f79ca259dd00bcac84f8ea0728c823393cc14ba",
"size": "6716",
... |
"""
Copyright (c) 2008 Marian Tietz
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following... | {
"content_hash": "a646b3f239eacb254f46d9a9a82bd21f",
"timestamp": "",
"source": "github",
"line_count": 397,
"max_line_length": 74,
"avg_line_length": 24.869017632241814,
"alnum_prop": 0.6709206927985415,
"repo_name": "sushi-irc/tekka",
"id": "e7b94f9609f1de3df18923c4a13677cf2cdf3dab",
"size": "988... |
#!/usr/bin/env python
"""
"""
from cortical.models.fingerprint import Fingerprint
class Text(object):
def __init__(self, text=None, fingerprint=None):
#The text as a string
self.text = text # str
#The semantic fingerprint representation of the text.
self.fingerprint = Fingerprint(*... | {
"content_hash": "8c852cebd202b8c92f6d2a423c25e331",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 117,
"avg_line_length": 31.307692307692307,
"alnum_prop": 0.6781326781326781,
"repo_name": "cortical-io/python-client-sdk",
"id": "511cfc96ba83f8fa2cc5298b69b91f8c63abd90e",
... |
from psychopy import visual, monitors, event, core, sound
from numpy import linspace
from math import sin, cos, pi
from PIL import Image
import array, string, pylink, psychopy, pygaze
from pygaze import settings
from pygaze.screen import Screen
class EyeLinkCoreGraphicsPsychoPy(pylink.EyeLinkCustomDisplay):
def __... | {
"content_hash": "3ae0b79d2675271b6b33c94ee84af487",
"timestamp": "",
"source": "github",
"line_count": 464,
"max_line_length": 150,
"avg_line_length": 42.82543103448276,
"alnum_prop": 0.5430023652559005,
"repo_name": "StevenM1/flashtask",
"id": "13e64ad26b1a5a95d0559d9a9f6e1d4c94644280",
"size": "... |
import os, argparse, json, collections, time, re, logging
from snimpy.manager import Manager as M
from snimpy.manager import load
from pyasn1.type import univ
try:
from ipcalc import Network
except:
os.system("sudo pip install ipcalc")
from ipcalc import Network
try:
from termcolor import colored
except:
os.sy... | {
"content_hash": "38b797b27a09a81f3bf012778829d5dc",
"timestamp": "",
"source": "github",
"line_count": 552,
"max_line_length": 175,
"avg_line_length": 35.41123188405797,
"alnum_prop": 0.6369775413106871,
"repo_name": "mft3000/snmpEngine",
"id": "5d24ee6782f0df5f0cf0f40deeee7b119bf96b54",
"size": "... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('tablemanager', '0011_auto_20151021_1354'),
('tablemanager', '0011_auto_20151020_0912'),
]
operations = [
]
| {
"content_hash": "6e43f78e5aa627b819627a809b8d234b",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 52,
"avg_line_length": 20.214285714285715,
"alnum_prop": 0.6501766784452296,
"repo_name": "rockychen-dpaw/borgcollector",
"id": "a61196678c9d87f00ab37295e10d7e5584d95d23",
... |
import abc
import base64
import json
from enum import Enum
from typing import TYPE_CHECKING, Optional, Any, Union
from ..exceptions import HttpResponseError, DecodeError
from . import PollingMethod
from ..pipeline.policies._utils import get_retry_after
from ..pipeline._tools import is_rest
from .._enum_meta import Cas... | {
"content_hash": "5a9d09aaac06881e6f4954cdcd83f111",
"timestamp": "",
"source": "github",
"line_count": 612,
"max_line_length": 118,
"avg_line_length": 33.82516339869281,
"alnum_prop": 0.6354282401816337,
"repo_name": "Azure/azure-sdk-for-python",
"id": "7a97ab514a8bfc77f4e1304a1c610a31abf587c6",
"... |
import re, sys, os, argparse, hashlib, random, email
from datetime import datetime
#Ensure Import path is in syspath
pathname = os.path.abspath(os.path.dirname(sys.argv[0]))
sys.path.append(pathname + '/modules')
#Make sure requred imports are present
try:
import pefile
except:
print "[!] PEfile not installed or... | {
"content_hash": "04cf095e11e81b384414120fe73b6109",
"timestamp": "",
"source": "github",
"line_count": 324,
"max_line_length": 193,
"avg_line_length": 38.26234567901235,
"alnum_prop": 0.6604017100911511,
"repo_name": "codexgigassys/codex-backend",
"id": "1ccb602ee5762da8fc2abdfe40ea352dc75a517d",
... |
from . import base
from . import mixins
from datetime import date
class TransformedRecord(
mixins.GenericCompensationMixin, mixins.GenericDepartmentMixin,
mixins.GenericIdentifierMixin, mixins.GenericJobTitleMixin,
mixins.GenericPersonMixin, mixins.MembershipMixin,
mixins.Organization... | {
"content_hash": "e8fe0d82e3472e1420cbd2030a1c75db",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 76,
"avg_line_length": 26.696296296296296,
"alnum_prop": 0.5790788013318535,
"repo_name": "texastribune/tx_salaries",
"id": "7454b440ad42a46610d4397d5b1f507359900ad9",
"si... |
import unittest
from sklearn import datasets
class Test(unittest.TestCase):
def testIrisDataset(self):
iris = datasets.load_iris()
self.assertEqual(150,
len(iris.data),
"The dataset shall contain 150 instances")
if __name__ == "__main__":
# ... | {
"content_hash": "bbde33c427874089e90ee2cc3c5eb4fd",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 67,
"avg_line_length": 24.4375,
"alnum_prop": 0.578005115089514,
"repo_name": "sixninetynine/pygradle",
"id": "d098eff8fe5f0903b3a39e31c9e1cd8d29465d84",
"size": "391",
"... |
"""
setup routine
"""
from setuptools import setup, find_packages
import os
def read(*paths):
"""Build a file path from *paths* and return the contents."""
with open(os.path.join(*paths), 'r') as open_file:
return open_file.read()
setup(
# Metadata
name='forseti',
version='0.8.1',
de... | {
"content_hash": "89dfcedb6cf749f23856bc1953fbfc6f",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 65,
"avg_line_length": 27.930232558139537,
"alnum_prop": 0.6186511240632806,
"repo_name": "MasterOdin/forseti",
"id": "638ace8dee48cbcf4b8671f915c3fffd91dfc544",
"size": "1... |
import os
import smtplib
from email.mime.text import MIMEText
DEFAULT_SUBJECT_PREFIX = "[SEND] "
def send(fname, conf):
contents = open(fname).read()
msg = MIMEText(contents)
msg['Subject'] = DEFAULT_SUBJECT_PREFIX + os.path.basename(fname) + "..."
msg['From'] = conf['from']
msg['To'] = conf['to']... | {
"content_hash": "f8c419d52995f216f26f62be2d19bcbd",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 77,
"avg_line_length": 29.90909090909091,
"alnum_prop": 0.6306990881458967,
"repo_name": "buckheroux/send",
"id": "d1decf695ee93b37feb032d251eae4f7c26695d7",
"size": "658",... |
"""
Various configuration tests.
"""
from waflib import Task
from waflib.Configure import conf
from waflib.TaskGen import feature, before_method, after_method
import sys
LIB_CODE = '''
#ifdef _MSC_VER
#define testEXPORT __declspec(dllexport)
#else
#define testEXPORT
#endif
testEXPORT int lib_func(void) { return 9; }
... | {
"content_hash": "1aecc2aa7e21edd2db9f2ace13d94cf7",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 149,
"avg_line_length": 26.16216216216216,
"alnum_prop": 0.6389462809917356,
"repo_name": "tommo/gii",
"id": "db1826fd5149f4b96308c860b81de0c60ab2e99f",
"size": "5875",
... |
"""Variance operator."""
import numpy
import numpoly
from .expected import E
def Var(poly, dist=None, **kws):
"""
The variance of a distribution or polynomial.
Args:
poly (numpoly.ndpoly, Distribution):
Input to take variance on.
dist (Distribution):
Defines the s... | {
"content_hash": "7cf03513cc4447b58602698a51991ad5",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 72,
"avg_line_length": 28.651162790697676,
"alnum_prop": 0.5592532467532467,
"repo_name": "jonathf/chaospy",
"id": "55f24342565c78ee0fa639080f9af391788484f3",
"size": "1232... |
from synergine.test.TestSuite import TestSuite as BaseTestSuite
from tests.simulation.TestSimulation import TestSimulation
from tests.core.connection.TestTerminal import TestTerminal
from tests.core.TestActionManager import TestActionManager
from tests.core.TestConfigurationManager import TestConfigurationManager
from ... | {
"content_hash": "157d9bddeadf3cdc828458c95ea23139",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 103,
"avg_line_length": 43.785714285714285,
"alnum_prop": 0.7862969004893964,
"repo_name": "buxx/synergine",
"id": "a5f8363a4933ff7a85c0d903fc674dbbe1520594",
"size": "613"... |
from smartshark.models import Job, Plugin, Project, PluginExecution
from smartshark.datacollection.pluginmanagementinterface import PluginManagementInterface
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""Fetch Logs for set of jobs and filter them for certain keywords."""
... | {
"content_hash": "a087d12ae3a7bd96a53019db48c5d527",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 218,
"avg_line_length": 46.80597014925373,
"alnum_prop": 0.6128826530612245,
"repo_name": "smartshark/serverSHARK",
"id": "4b23bd73c7ee1c23abc16ba25d504588bf96e24f",
"size"... |
from flask import Blueprint, current_app, session, g, redirect, url_for
mod = Blueprint('home', __name__, url_prefix="/<lang_code>")
@mod.url_defaults
def add_language_code(endpoint, values):
if current_app.url_map.is_endpoint_expecting(endpoint, 'lang_code'):
values['lang_code'] = session['lang_code']
... | {
"content_hash": "bd955a23ac686bca00925af80abebc89",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 72,
"avg_line_length": 30.416666666666668,
"alnum_prop": 0.6753424657534246,
"repo_name": "nMustaki/flask-usul",
"id": "030da5d08416bd0233f3bea28cfdf61800bcffe5",
"size": "... |
import os
from .base import *
DEBUG = False
## DATABASE SETTINGS
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.',
'NAME': '',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
},
}
# I... | {
"content_hash": "bb5ee18fe9d2b46e949a3ffa8fa18b90",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 78,
"avg_line_length": 24.232558139534884,
"alnum_prop": 0.663147792706334,
"repo_name": "jajadinimueter/recipe",
"id": "c810758fbc79112ed837a89f296f76cd089aa90c",
"size": ... |
from __future__ import print_function, absolute_import, division
import sys
import numpy as np
from numba import config, unittest_support as unittest
from numba.npyufunc.ufuncbuilder import GUFuncBuilder
from numba import vectorize, guvectorize
from numba.npyufunc import PyUFunc_One
from numba.npyufunc.dufunc import... | {
"content_hash": "755948017c721b3b862c1c2db03414f7",
"timestamp": "",
"source": "github",
"line_count": 382,
"max_line_length": 79,
"avg_line_length": 31.554973821989527,
"alnum_prop": 0.5578231292517006,
"repo_name": "stefanseefeld/numba",
"id": "48474a751cc2693bf019f01f819a4f306e44e9f4",
"size": ... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('demo', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='resume',
name='timestamp',
field=model... | {
"content_hash": "080531518db9e55067bcb7503beefa78",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 58,
"avg_line_length": 23.130434782608695,
"alnum_prop": 0.5657894736842105,
"repo_name": "largescale-dfss/concept-demo",
"id": "b7595e8455b2c2e6fa421217c201e52a808f2225",
... |
from sys import stdin
from math import pi
def readLine():
return stdin.readline().strip()
def readInt():
return int(readLine())
def readInts():
return list(map(int, readLine().split()))
def main():
A, P1 = readInts()
R, P2 = readInts()
print('Whole pizza' if (A * 1.0 / P1) < ((pi * R * R) / P2) else ... | {
"content_hash": "983a3a100bb73e9c54840cd4f93f77bf",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 86,
"avg_line_length": 19.63157894736842,
"alnum_prop": 0.5978552278820375,
"repo_name": "mikebsg01/Contests-Online",
"id": "3dea8a641dd4503e654ebcee9e4710e60f142256",
"siz... |
from __future__ import print_function
from bcc import BPF
prog = """
int hello(void *ctx) {
bpf_trace_printk("Hello, World!\\n");
return 0;
}
"""
b = BPF(text=prog)
b.attach_kprobe(event=b.get_syscall_fnname("clone"), fn_name="hello")
print("PID MESSAGE")
try:
b.trace_print(fmt="{1} {5}")
except KeyboardInterr... | {
"content_hash": "578b87d1107eef27557a9801837789c9",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 69,
"avg_line_length": 21,
"alnum_prop": 0.6547619047619048,
"repo_name": "brendangregg/bcc",
"id": "1c5beef2143f322966f7f9433b9e16769bc56cb6",
"size": "589",
"binary": f... |
import json
from collections import namedtuple
from typing import Dict, Mapping, Optional, Union
from marshmallow import ValidationError, fields, pre_load, validate, validates_schema
import polyaxon_sdk
from polyaxon.parser import parser
from polyaxon.schemas.base import BaseConfig, BaseSchema
from polyaxon.utils.c... | {
"content_hash": "f00de3c47735af6f1d36d69924a36788",
"timestamp": "",
"source": "github",
"line_count": 557,
"max_line_length": 88,
"avg_line_length": 32.156193895870736,
"alnum_prop": 0.6129752665959466,
"repo_name": "polyaxon/polyaxon",
"id": "b102f5491c7d90b8808d0b8510a444f52564057d",
"size": "1... |
"""This module contains the noise models available in Pastas.
A Noise model may be used to transform the residual series into a noise
series that better represents white noise.
Examples
--------
By default, a noise model is added to a Pastas model. It is possible to
replace the default model with different models as ... | {
"content_hash": "80aaffd7aeab2f4a4c2939c77ce9f91a",
"timestamp": "",
"source": "github",
"line_count": 265,
"max_line_length": 79,
"avg_line_length": 30.10566037735849,
"alnum_prop": 0.5765856104286788,
"repo_name": "pastas/pasta",
"id": "8f421148af39631ba51e9b36fdd47f4cc06fd071",
"size": "7978",
... |
"""This module includes tests of the code object representation.
>>> def f(x):
... def g(y):
... return x + y
... return g
...
>>> dump(f.func_code)
name: f
argcount: 1
names: ()
varnames: ('x', 'g')
cellvars: ('x',)
freevars: ()
nlocals: 2
flags: 3
consts: ('None', '<code object g>')
>>> dump(f(4).f... | {
"content_hash": "6d8ec2a8ea35e3f85cdaa057ead29d51",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 80,
"avg_line_length": 21.816326530612244,
"alnum_prop": 0.5871531025880885,
"repo_name": "fkolacek/FIT-VUT",
"id": "e83a919bcf5b960157d2ba93bb46a876fff74fd3",
"size": "32... |
"""
ShellShocker CLI
================
The CLI for ShellShocker.
Interfaces to **shellshocker.exploits.ShellShocker**, a ShellShock exploiter
"""
from shellshocker.exploits import ShellShocker # Import a shellshock payload generator
# and delivery device.
import click # Click is Armin Ronacher's new CLI framework. It's... | {
"content_hash": "048ac531e3cebdd2c909d50cec2be756",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 163,
"avg_line_length": 34.03333333333333,
"alnum_prop": 0.6816846229187071,
"repo_name": "ArchimedesPi/shellshocker",
"id": "ae8e1f431f05542dd894a0bee4c844de25b54f56",
"si... |
from common.ulam_spiral import *
from common.primes import *
SIEVE = PrimeSieve(100000)
def prime_ratio_below(limit):
corners_seen = 1
primes_seen = 0
n = 3
for corners in ulam_spiral_corners_except_center():
primes_seen += len(filter(is_prime, corners))
corners_seen += len(corners)
... | {
"content_hash": "3ba1fef121ce521da103c3cc0ae8e1ff",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 55,
"avg_line_length": 25.375,
"alnum_prop": 0.625615763546798,
"repo_name": "plilja/project-euler",
"id": "f7db7bfa289d2983d0e1777a4c0c95ca7c7c3081",
"size": "406",
"bin... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Subquery'
db.create_table('smra_portal_subquery', (
('id', self.gf('django.db.models.fields.Auto... | {
"content_hash": "f2787b79132eb77b12e0731d892d319f",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 196,
"avg_line_length": 68.35570469798658,
"alnum_prop": 0.5501227295041728,
"repo_name": "tectronics/mavrec",
"id": "2c184261b9634e7182ad7962e8c1912aae724b59",
"size": "1... |
from setuptools import setup, find_packages # Always prefer setuptools over distutils
from codecs import open # To use a consistent encoding
from os import path
import io
NAME = "python-constraint"
filename = "%s/version.py" % "constraint"
with open(filename) as f:
exec(f.read())
here = path.abspath(path.dirnam... | {
"content_hash": "610513dd2a6ae23e61368a6a533aa073",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 98,
"avg_line_length": 43.62626262626262,
"alnum_prop": 0.651308173188238,
"repo_name": "python-constraint/python-constraint",
"id": "77b02534f5880d1da34645aa7123d04d987ff7fe... |
from django.core.management.base import BaseCommand
from optparse import make_option
from provisioning import okta
from provisioning.models import Okta
from litedesk.lib.airwatch import user
from litedesk.lib.airwatch import group
from provisioning.models import AirWatch
import json
class Command(BaseCommand):
he... | {
"content_hash": "442c950b07bc3d5a43bd06ce5f59d47f",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 82,
"avg_line_length": 45.333333333333336,
"alnum_prop": 0.5946691176470589,
"repo_name": "litedesk/litedesk-webserver-provision",
"id": "96309fa61b40e5f914798aa872beed33e82e... |
import logging
import signal
import asyncio
from functools import partial
from collections import defaultdict, namedtuple
from .utils.log import config_logs
from .packet import ControlPacket
from .protocol_factory import get_vyked_protocol
from .pinger import TCPPinger, HTTPPinger
from .utils.log import setup_logging
... | {
"content_hash": "f0df09b9da58beb8ac9eef6f566caa60",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 136,
"avg_line_length": 45.46825396825397,
"alnum_prop": 0.6356257636585791,
"repo_name": "pankajnits/vyked",
"id": "733215238ec567d4d2cae2082f09678f6ab2952d",
"size": "11... |
"""Remote Debugger.
Introduction
============
This is a remote debugger for Celery tasks running in multiprocessing
pool workers. Inspired by a lost post on dzone.com.
Usage
-----
.. code-block:: python
from celery.contrib import rdb
from celery import task
@task()
def add(x, y):
result =... | {
"content_hash": "4ecb473ebbc0742723baea826836c0fd",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 76,
"avg_line_length": 26.78125,
"alnum_prop": 0.5902372617658499,
"repo_name": "cloudera/hue",
"id": "019455000ef4eb4303007817e5c8eacd50f2d3e3",
"size": "5166",
"binary... |
try:
from django.urls import reverse, NoReverseMatch
except ImportError:
from django.core.urlresolvers import reverse, NoReverseMatch
from django.test.utils import override_settings
from testcases import TestCaseWithFixture
@override_settings(ROOT_URLCONF='namespaced.api.urls')
class NamespacedViewsTestCase(... | {
"content_hash": "fcb00336f8aa477690f5e0c8aca5c655",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 336,
"avg_line_length": 60.45454545454545,
"alnum_prop": 0.7157894736842105,
"repo_name": "beedesk/django-tastypie",
"id": "69f92074b87a05a86d79e29c0d4f48b4b4fe490b",
"size... |
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.sites.shortcuts import get_current_site
from django.core import mail
from django.urls import reverse
from django.http import HttpResponseRedirect
from django.test import TransactionTestCase
from caffeine_oauth2.models i... | {
"content_hash": "eb74d0f8c17209c42c8664e98fb4cb47",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 78,
"avg_line_length": 47.110047846889955,
"alnum_prop": 0.6478773105829778,
"repo_name": "coffeestats/coffeestats-django",
"id": "51095f02b70bd214520ac9211ae19e5e31018e94",... |
"""Base class for evaluations' REST calls
https://bigml.com/api/evaluations
"""
try:
import simplejson as json
except ImportError:
import json
from bigml.api_handlers.resourcehandler import ResourceHandlerMixin
from bigml.api_handlers.resourcehandler import check_resource_type, \
get_evaluation_id
f... | {
"content_hash": "2eca3fd736ebbb64e4c90f9294da4406",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 79,
"avg_line_length": 34.26966292134831,
"alnum_prop": 0.6426229508196721,
"repo_name": "mmerce/python",
"id": "6974d5aab0c2c2367afb3b3554fa54f22696b920",
"size": "3651",
... |
import argparse
import os
import subprocess
parser = argparse.ArgumentParser(description="Runs Java integration tests.")
TOOLKIT_ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))
def run():
try:
subprocess.check_call("make test_java", cwd=TOOLKIT_ROOT_DIR, shell=... | {
"content_hash": "58e839d2688fd1760e6ba57cfb5b270f",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 119,
"avg_line_length": 37.76190476190476,
"alnum_prop": 0.6708701134930644,
"repo_name": "jhuttner/dx-toolkit",
"id": "bd275cb0d73a1fcd33e2547596dc427f9a4fedef",
"size": "... |
'''Script to combine text by by file names of main three periods: 1848-1900; 1901-1948; 1949-1978'''
from os import walk
import os
from collections import defaultdict
from pprint import pprint
FOLDER = '/Users/deborah/Documents/scripts/python_work/project2016/smelly_london/Full text'
OUTPUT_FOLDER = '/Users/deborah/... | {
"content_hash": "dc81e2d83f160513263648ddf2665d29",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 113,
"avg_line_length": 27.372881355932204,
"alnum_prop": 0.6086687306501548,
"repo_name": "Smelly-London/datavisualisation",
"id": "9fe230c99ff37f1a90f32828dce8a8aaf9a72cb7"... |
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import friendship_pb2 as friendship__pb2
class FriendshipStub(object):
"""Missing associated documentation comment in .proto file."""
def __init__(self, channel):
"""Constructor.
Args:
channe... | {
"content_hash": "7d734df5c3649cbc9e97baadf6a2d35c",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 110,
"avg_line_length": 41.23809523809524,
"alnum_prop": 0.6280311778290993,
"repo_name": "ganeshmurthy/qpid-dispatch",
"id": "6510b7d78784a4018c9b2b1c012097bd2d04b590",
"... |
"""test IPython.embed_kernel()"""
#-------------------------------------------------------------------------------
# Copyright (C) 2012 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#---------------... | {
"content_hash": "023604b8ce6dd8b947ccff9fb575457d",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 99,
"avg_line_length": 29.94300518134715,
"alnum_prop": 0.516698390725039,
"repo_name": "sodafree/backend",
"id": "0bf8f62ae2200696c4a3a741d41ef2a9f8ebfc2c",
"size": "5779... |
import sys
import time
import decorator
import inspect
import itertools
import operator
def todict(obj, classkey=None):
""" Serialise object to dictionary, with optional 'classkey' """
if isinstance(obj, dict):
for k in obj.keys():
obj[k] = todict(obj[k], classkey)
return obj
el... | {
"content_hash": "21f63d72c27ba44cb76e3fe87b9fe8ae",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 95,
"avg_line_length": 33.98046875,
"alnum_prop": 0.603172778480285,
"repo_name": "evandrix/Splat",
"id": "ff8b2141213c40a35bce91d8138713fc5947fb79",
"size": "8699",
"bi... |
import unittest
from usig_normalizador_amba.commons import normalizarTexto, matcheaTexto
from usig_normalizador_amba.commons import MATCH_EXACTO, MATCH_PERMUTADO, MATCH_INCLUIDO, MATCH, NO_MATCH
class CommonsTestCase(unittest.TestCase):
def test_normalizarTexto_acentos(self):
res = normalizarTexto('ábçd... | {
"content_hash": "fa6627f9b3313bfa7a45baef5500cd0c",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 105,
"avg_line_length": 43.71084337349398,
"alnum_prop": 0.6595920617420066,
"repo_name": "usig/normalizador-amba",
"id": "78279f4ad05e2dc573c08357c91cb026a6db2758",
"size"... |
import hashlib
import os
import errno
import tempfile
from json import dumps as json_dumps
import requests
from .exception import SurvoxAPIException, SurvoxAPINotFound
class SurvoxAPIBase:
"""
Base class to use requests to interact with the Survox API
"""
def __init__(self, base_url, headers, verbos... | {
"content_hash": "2af9deaea961ab9de2828d196f2822c3",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 120,
"avg_line_length": 43.78431372549019,
"alnum_prop": 0.5867666815942678,
"repo_name": "cbeauvais/zAWygzxkeSjUBGGVsgMGTF56xvR",
"id": "60736d5841e43baeeeddea70d36efb100f2... |
# Copyright (c) 2015, LE GOFF Vincent
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and th... | {
"content_hash": "e0c111a5856668d589ed003425a0c3bb",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 80,
"avg_line_length": 45.883720930232556,
"alnum_prop": 0.7759756715661429,
"repo_name": "vlegoff/ytranslate",
"id": "c9e91b05e719583300c9284de258d6ee7783585e",
"size": "1... |
from __future__ import annotations
from pants.testutil.pants_integration_test import run_pants
_no_explicit_setting_msg = "An explicit setting will get rid of this message"
_no_repo_id_msg = 'set `repo_id = "<uuid>"` in the [anonymous-telemetry] section of pants.toml'
_bad_repo_id_msg = "must be between 30 and 60 cha... | {
"content_hash": "1ce30cd8d9e470d4ac605688f4952ae4",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 95,
"avg_line_length": 36.46296296296296,
"alnum_prop": 0.6749619095987811,
"repo_name": "patricklaw/pants",
"id": "9d1d44d581dceafc5c303e7f564c888b31379548",
"size": "2101... |
import sys
sys.path.insert(0, "../..")
from Cube import *
from Machine import *
if sys.version_info[0] >= 3:
raw_input = input
#Define global variables
globalVarCount = {} #10000
globalVarCount[BOOL] = INITIALGLOBALBOOL
globalVarCount[INT] = INITIALGLOBALINT
globalVarCount[FLOAT] = INITIALGLOBALFLOAT
globalVarC... | {
"content_hash": "65ecc0d547b366b6bcebeca7a1b1b66e",
"timestamp": "",
"source": "github",
"line_count": 806,
"max_line_length": 367,
"avg_line_length": 25.325062034739453,
"alnum_prop": 0.6660297864001568,
"repo_name": "sanchezz93/Giga-Compiler",
"id": "eed121529964593afe8075d28ac5d2c7875b8242",
"s... |
from __future__ import absolute_import
from __future__ import print_function
import sqlalchemy as sa
from buildbot.util import sautils
def upgrade(migrate_engine):
metadata = sa.MetaData()
metadata.bind = migrate_engine
schedulers_table = sautils.Table('schedulers', metadata, autoload=True)
enabled ... | {
"content_hash": "fb79ed353335e9a66e39a51a5a3fd0ee",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 75,
"avg_line_length": 30.466666666666665,
"alnum_prop": 0.7045951859956237,
"repo_name": "Alecto3-D/testable-greeter",
"id": "9ab6e77806fbe69fff4459af2e53faafaeb633b6",
"s... |
from .base import *
from ._ci import *
from ._admin import *
| {
"content_hash": "c44d2a7580773396a4514bc964f90bc8",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 21,
"avg_line_length": 20.333333333333332,
"alnum_prop": 0.6721311475409836,
"repo_name": "sunForest/AviPost",
"id": "daa423fd08597b4898f69a46783f0f98b51c74c7",
"size": "61"... |
import numpy as np
class Line():
def __init__(self):
# was the line detected in the last iteration?
self.detected = False
#polynomial coefficients for the most recent fit
self.current_fit = [np.array([False])]
self.k = 5
self.last_fits = []
self.radius_of_cu... | {
"content_hash": "095da3ddbbc7ba8449f498c9fc647f48",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 76,
"avg_line_length": 31.12676056338028,
"alnum_prop": 0.5158371040723982,
"repo_name": "camigord/Self-Driving-Car-Nanodegree",
"id": "64bb054a10c1a450abbcd531553c716d9bef8b... |
"""
Test symbolic unit handling.
"""
# -----------------------------------------------------------------------------
# Copyright (c) 2018, yt Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the LICENSE file, distributed with this software.
# ---------------... | {
"content_hash": "66d59405b2ee635881a07adf43c62b65",
"timestamp": "",
"source": "github",
"line_count": 905,
"max_line_length": 88,
"avg_line_length": 26.029834254143648,
"alnum_prop": 0.5981236999617948,
"repo_name": "yt-project/unyt",
"id": "3ba67c508c857aaa0c10810e71f03cd24c3443b9",
"size": "235... |
from weatbag import words
class Tile:
def __init__(self):
self.first_visit = True
def describe(self):
if self.first_visit:
print("You are now on the island. The children are returning back "
"to the mainland with their raft.\n"
"In front of you t... | {
"content_hash": "2012b207101cab6a7cd14ff562c8aa64",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 79,
"avg_line_length": 33.65625,
"alnum_prop": 0.532033426183844,
"repo_name": "takluyver/weatbag",
"id": "35897c3f40fe0bc3f2463b75e2ed0bb14cbee6ec",
"size": "1077",
"bin... |
"""Test Solr search using the synchronizer, i.e. as it would be used by an user
"""
import logging
import os
import time
import sys
if sys.version_info[:2] == (2, 6):
import unittest2 as unittest
else:
import unittest
sys.path[0:0] = [""]
from pymongo import MongoClient
from tests import solr_pair, mongo... | {
"content_hash": "a89883ab1cc1bb4f34ecec02099f9e05",
"timestamp": "",
"source": "github",
"line_count": 358,
"max_line_length": 79,
"avg_line_length": 35.29608938547486,
"alnum_prop": 0.5450300728078505,
"repo_name": "wowgeeker/mongo-connector",
"id": "381bcf7b5ab26936af6b4adb5dc747de11856352",
"si... |
import os
import sys
import string
import utils
from SCons.Script import *
from utils import _make_path_relative
from mkdist import do_copy_file
BuildOptions = {}
Projects = []
Rtt_Root = ''
Env = None
# SCons PreProcessor patch
def start_handling_includes(self, t=None):
"""
Causes the PreProcessor object to... | {
"content_hash": "f056592e638612d63653b53ccad72da7",
"timestamp": "",
"source": "github",
"line_count": 982,
"max_line_length": 139,
"avg_line_length": 33.95723014256619,
"alnum_prop": 0.5618365021291909,
"repo_name": "weiyuliang/rt-thread",
"id": "65af7944345fb7ce1ac63dbc260d7b152c33c536",
"size":... |
import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(self, plotly_name="color", parent_name="volume.contour", **kwargs):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | {
"content_hash": "98ec4867c2ea600fed991e534ad31e4e",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 84,
"avg_line_length": 36.833333333333336,
"alnum_prop": 0.6063348416289592,
"repo_name": "plotly/python-api",
"id": "96ede4f0c426915490b176fc32b5034805f6a9b0",
"size": "44... |
from .base import BaseTestCase
from . import utils
from webapp import utils as wutils
class UtilsTestCase(BaseTestCase):
# Issue
def test_get_prev_issue(self):
"""
Teste da função utils.get_prev_issue().
IMPORTANTE: A lista é invertida.
"""
issue1 = utils.makeOneIs... | {
"content_hash": "a1d44d1cf9ddef5a4c7f941730a24c5b",
"timestamp": "",
"source": "github",
"line_count": 208,
"max_line_length": 80,
"avg_line_length": 33.875,
"alnum_prop": 0.536474595515186,
"repo_name": "jfunez/opac",
"id": "9d94171cc3aeede00f166217d39fe6006ec4cb64",
"size": "7107",
"binary": f... |
#
import xbmcplugin
import xbmcgui
import time
from resources.lib.utils import *
class DropboxBackgroundProgress(xbmcgui.WindowXMLDialog):
"""
Dialog class that shows the progress of a Dropbox background task.
Using the DialogExtendedProgressBar.xml
"""
#DialogExtendedProgressBar IDs
HEADING... | {
"content_hash": "a916404b9c26395a544b1203261956de",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 85,
"avg_line_length": 29.782608695652176,
"alnum_prop": 0.5849148418491484,
"repo_name": "TidalPaladin/Superliminal-resin",
"id": "3447b0d21929a49b66b589e01d3be31be98e1c5d",... |
from optparse import make_option
import re
from django.core.management import BaseCommand, CommandError
from corehq.doctypemigrations.migrator_instances import get_migrator_by_slug, \
get_migrator_slugs
USAGE = """You may run either of the following commands
./manage.py run_doctype_migration <slug> --stats
./mana... | {
"content_hash": "8052acff97cac255f8972e2ddc6d94d7",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 90,
"avg_line_length": 37.825301204819276,
"alnum_prop": 0.608058608058608,
"repo_name": "qedsoftware/commcare-hq",
"id": "54af3f882c5b05f30249c8d7ef6eb4e0b3bda3fe",
"size... |
from __future__ import absolute_import
import sys
import textwrap
from pip._internal.cli.base_command import Command
from pip._internal.utils.misc import get_prog
BASE_COMPLETION = """
# pip {shell} completion start{script}# pip {shell} completion end
"""
COMPLETION_SCRIPTS = {
'bash': """
_pip_completi... | {
"content_hash": "68abb3c6026f2db94fcc9f35c700284a",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 79,
"avg_line_length": 30.967391304347824,
"alnum_prop": 0.5057915057915058,
"repo_name": "davidharvey1986/pyRRG",
"id": "910fcbfe358d6220e71c03cb9e3409590bc11802",
"size":... |
"""Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2013 Benjamin Peterson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including with... | {
"content_hash": "5b269ad1ae2f677f6e906b0d379347e0",
"timestamp": "",
"source": "github",
"line_count": 585,
"max_line_length": 129,
"avg_line_length": 36.141880341880345,
"alnum_prop": 0.6356713805987797,
"repo_name": "pombreda/swarming",
"id": "176196c05b963beaff4f9be3659f05a5124f0547",
"size": "... |
from django.contrib import admin
from accounts.models import UserGroup, UserProfile
# Register your models here.
class UserAdmin(admin.ModelAdmin):
pass
class GroupAdmin(admin.ModelAdmin):
pass
admin.site.register(UserProfile, UserAdmin)
admin.site.register(UserGroup, GroupAdmin) | {
"content_hash": "a6e7aaefdda07004eec51daccb6cc13e",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 50,
"avg_line_length": 21.857142857142858,
"alnum_prop": 0.7647058823529411,
"repo_name": "vivianbuan/cs3240-s15-team20",
"id": "a9a47077a5d35080b5da6c8d7eb195ec7fdd328d",
... |
import os
from io import BytesIO
import pytest
from twitter.common.contextutil import temporary_dir
from apache.aurora.client import config
from apache.aurora.client.config import get_config as get_aurora_config
from apache.aurora.config import AuroraConfig
from apache.aurora.config.loader import AuroraConfigLoader
f... | {
"content_hash": "28e134b16ad0428d72c41299a0fc4210",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 86,
"avg_line_length": 33.531400966183575,
"alnum_prop": 0.6622964990635355,
"repo_name": "kidaa/aurora",
"id": "986061bf0829caa0509416a3de1778c2fa40a766",
"size": "7490",... |
"""Auto-generated file, do not edit by hand. GG metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_GG = PhoneMetadata(id='GG', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='[19]\\d{2,5}', possible_length=(3, 4, 5... | {
"content_hash": "c3db3eb59be03c15084b2c2c61a042e6",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 174,
"avg_line_length": 79.125,
"alnum_prop": 0.7061611374407583,
"repo_name": "samdowd/drumm-farm",
"id": "cfb8f7bd3ce2fd9717e23ffd64162c929033fdb9",
"size": "633",
"bina... |
from wxpy import *
bot = Bot()
tuling = Tuling('你的 API KEY (http://www.tuling123.com/)')
my_friend = ensure_one(bot.friends().search('好友的名称'))
@bot.register(my_friend, TEXT)
def tuling_reply(msg):
tuling.do_reply(msg)
bot.start()
| {
"content_hash": "a583a6083d2e42a81f3d0b8d47d3be9d",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 57,
"avg_line_length": 17.142857142857142,
"alnum_prop": 0.6708333333333333,
"repo_name": "xcwstsoftware/wechat",
"id": "dc034eec74de794f93ee86bde752e78e92e7ab91",
"size": ... |
from south.db import db
from django.db import models
from knesset.tagvotes.models import *
class Migration:
def forwards(self, orm):
# Adding model 'TagVote'
db.create_table('tagvotes_tagvote', (
('id', orm['tagvotes.TagVote:id']),
('tagged_item', orm['tagvotes... | {
"content_hash": "c11bb9458e9e94e94f5220a78dcc855c",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 142,
"avg_line_length": 59.14772727272727,
"alnum_prop": 0.541402497598463,
"repo_name": "livni/old-OK",
"id": "e0fd14aae0d12f70d67b8577d8a0888b51710fc7",
"size": "5206",
... |
from setuptools import setup, find_packages
setup(
name='hamr2016',
version='0.1',
description='hackathon',
author_email='all@sonalytic.com',
packages=find_packages(),
)
| {
"content_hash": "534aa522a837356f79dc256da784b2cc",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 43,
"avg_line_length": 23,
"alnum_prop": 0.6231884057971014,
"repo_name": "tillahoffmann/hamr2016",
"id": "4de5510f40a382b770f53c9ceade8aa84a8b5341",
"size": "207",
"binar... |
from django.http import HttpResponse
from django.template import loader
# Create your views here.
def index(request):
template = loader.get_template('CareerTinder/photo.html')
context = {
'name': 'John Doe'
}
return HttpResponse(template.render(context, request))
| {
"content_hash": "d3e7918f66357b52baf0b87b2436fbcc",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 61,
"avg_line_length": 26.363636363636363,
"alnum_prop": 0.7103448275862069,
"repo_name": "sarojaerabelli/HVGS",
"id": "213e34cb13068d70e7b5532f5425ba41b997ceed",
"size": "... |
from __future__ import print_function
"""
test_app.py -- test pbm.app tornado application
"""
from contextlib import contextmanager
import tornado.testing
from urlobject import URLObject
from pbm.app import make_app
from pbm.app import BaseHandler
@contextmanager
def nop_auth(username="testuser"):
__get_curren... | {
"content_hash": "e940a028c7e7878640b3c0d13e375a98",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 81,
"avg_line_length": 32.75609756097561,
"alnum_prop": 0.5775626706378754,
"repo_name": "westurner/pbm",
"id": "4db30ca4b128eba1a67e7eaa0bd54edb8a29bd4c",
"size": "4075",... |
import sys, os
try:
import Crypto.Cipher.DES3
except ImportError:
Crypto = None
try:
from twisted.conch import unix
from twisted.conch.scripts import cftp
from twisted.conch.client import connect, default, options
from twisted.conch.test.test_filetransfer import FileTransferForTestAvatar
excep... | {
"content_hash": "e4e3653d11e958b7f4d82b928144fa59",
"timestamp": "",
"source": "github",
"line_count": 717,
"max_line_length": 79,
"avg_line_length": 34.84239888423989,
"alnum_prop": 0.5758546153230326,
"repo_name": "hortonworks/hortonworks-sandbox",
"id": "5df9dd9f69fe0f744757b1095bbdba0f8a4ab3f5",... |
from control4.maths.symbolic import apply_nonlinearity
from control4.maths.numeric import normc
from control4.config import floatX
import theano,theano.tensor as TT
import numpy as np
from control4.misc.collection_utils import concatenate
class ParameterizedFunc(object):
"""
Function with theano shared variabl... | {
"content_hash": "474dcf70e213b1682050de9514af0cb2",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 143,
"avg_line_length": 32.486486486486484,
"alnum_prop": 0.6232945091514143,
"repo_name": "SFPD/rlreloaded",
"id": "295e4f8d8e8b803869b8e9be3463fc84b70e8bc4",
"size": "60... |
'''Hybrid assignment solver. Quickly finds a candidate solution and
then improves on it iteratively through branch-and-bound search.
'''
import uuid
import random
import logging
import numpy as np
import model
from solvers import Solver
from assignments.cached import CachedAssignment
class Node(object):
'''Branc... | {
"content_hash": "b6ab7ab793899765005b811e25405b6e",
"timestamp": "",
"source": "github",
"line_count": 253,
"max_line_length": 105,
"avg_line_length": 36.29644268774704,
"alnum_prop": 0.6059022106065556,
"repo_name": "severinson/Coded-Shuffling",
"id": "6f784acafed0fbc767c26a2fecee211d8952c5a6",
"... |
"""\
============================
Simple multicast transceiver
============================
A simple component for transmitting and receiving multicast packets.
Remember that multicast is an unreliable connection - packets may be lost,
duplicated or reordered.
Example Usage
-------------
Send a file to, and rece... | {
"content_hash": "aa49c66fd40fd0532d221f1d65deb48f",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 142,
"avg_line_length": 33.12162162162162,
"alnum_prop": 0.6128110975112199,
"repo_name": "bbc/kamaelia",
"id": "12cfeca9ca1ea0414f1ae5f5f05fd3de37aa4b4a",
"size": "5803",... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/food/crafted/shared_drink_angerian_fishak_surprise.iff"
result.attribute_template_id = 5
result.stfName("food_name","angerian_fishak_surprise")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
... | {
"content_hash": "ab25956a995d6ea96140c2e9e0ec1d64",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 91,
"avg_line_length": 25.76923076923077,
"alnum_prop": 0.7164179104477612,
"repo_name": "anhstudios/swganh",
"id": "0f282a0e76888845cefb665e2fc3b4c4cfa599e7",
"size": "480... |
from pyccel.decorators import types
@types('int')
def func(n,m):
return n + m
| {
"content_hash": "5f76fdae17c498dff79326ceb47547e8",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 35,
"avg_line_length": 14,
"alnum_prop": 0.6666666666666666,
"repo_name": "ratnania/pyccel",
"id": "285f80ab8439587f5b95096cad4bdf37e73dbe43",
"size": "156",
"binary": fal... |
from django.conf.urls.defaults import *
rootpatterns = patterns('',
(r'^account/', include('registration.urls')),
)
| {
"content_hash": "a2846656530eec8e05d8bc59f9ed67ee",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 49,
"avg_line_length": 24.2,
"alnum_prop": 0.6859504132231405,
"repo_name": "stonezdj/forzdj",
"id": "38cb6c446e8e10797f13b027e013c3e635f32e50",
"size": "121",
"binary": f... |
"""This module contains Melange cron jobs."""
| {
"content_hash": "8b11845f5b43d419c37ae97bf9b9b03d",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 45,
"avg_line_length": 46,
"alnum_prop": 0.717391304347826,
"repo_name": "jamslevy/gsoc",
"id": "e10dbbd7e2573809a0f7e944f66f488aa317b889",
"size": "631",
"binary": false,... |
import os
from subliminal import download_best_subtitles, save_subtitles
from subliminal.video import Episode
from subliminal.core import search_external_subtitles
from babelfish.language import Language
class FileSubtitler:
def __init__(self, languages, providers):
self.languages = languages
s... | {
"content_hash": "b0feeb7692988632834739df3bb73ff0",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 103,
"avg_line_length": 31.475,
"alnum_prop": 0.6799046862589356,
"repo_name": "rkohser/gustaf2",
"id": "44b5582ca5c8f5bb8a0d6cb78e64a53a92249c9c",
"size": "1259",
"binar... |
from django import forms
from django.utils.translation import ugettext as _
from search.models import Collection
from search_controller import SearchController
class QueryForm(forms.Form):
collection = forms.ChoiceField() # Aka collection_id
query = forms.CharField(label='', max_length=256, required=False, initi... | {
"content_hash": "9d05c0bd2abfabb19207ff3172d24c04",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 170,
"avg_line_length": 47.735849056603776,
"alnum_prop": 0.7043478260869566,
"repo_name": "2013Commons/HUE-SHARK",
"id": "31593397b83ed5d53ac162a5b30d069e2fbc6ddb",
"size"... |
import contextlib
import io
import os
import sys
import tempfile
try:
import fcntl
except ImportError:
fcntl = None
# `fspath` was added in Python 3.6
try:
from os import fspath
except ImportError:
fspath = None
__version__ = '1.4.0'
PY2 = sys.version_info[0] == 2
text_type = unicode if PY2 else s... | {
"content_hash": "043c95c2f4cedc2641a35db7407125b1",
"timestamp": "",
"source": "github",
"line_count": 229,
"max_line_length": 111,
"avg_line_length": 30.436681222707424,
"alnum_prop": 0.5951219512195122,
"repo_name": "untitaker/python-atomicwrites",
"id": "0b9f92ab863bde9e146407956160091c094580ef",... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.