text stringlengths 4 1.02M | meta dict |
|---|---|
from .. import Availability, Class, Constant, Define, Method, Parameter, Type
gx_class = Class('DATAMINE',
doc="""
:class:`DATAMINE` functions provide an interface to Datamine Software Limited files.
See also :class:`GIS` for various other Datamine-specific functions.... | {
"content_hash": "639d220d80642cb873833cf08e62a82e",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 106,
"avg_line_length": 44.854838709677416,
"alnum_prop": 0.5142035239122618,
"repo_name": "GeosoftInc/gxapi",
"id": "e2cd49b38cef55f0c4f07c7bda9be2da4c4ed7b5",
"size": "27... |
from google.cloud import aiplatform_v1
async def sample_delete_data_labeling_job():
# Create a client
client = aiplatform_v1.JobServiceAsyncClient()
# Initialize request argument(s)
request = aiplatform_v1.DeleteDataLabelingJobRequest(
name="name_value",
)
# Make the request
oper... | {
"content_hash": "bb0ce0c30f0ef286d193218e3fd3d23e",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 81,
"avg_line_length": 26.043478260869566,
"alnum_prop": 0.7212020033388982,
"repo_name": "googleapis/python-aiplatform",
"id": "5393c948653f93ec5d913c7543bb986a318b0f3e",
... |
from app import app
from flask import render_template
@app.route("/")
def servicos():
return render_template("servicos.html")
| {
"content_hash": "326e77579d587002c0b3f34d6db7b99d",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 43,
"avg_line_length": 18.857142857142858,
"alnum_prop": 0.7272727272727273,
"repo_name": "h01000110/gerenciador-oficina-web",
"id": "c08299378f7a69b98e6c04bd6e0b98c3533a6be8"... |
from __future__ import division
import re
# This is a naive text summarization algorithm
# Created by Shlomi Babluki
# April, 2013
class SummaryTool(object):
# Naive method for splitting a text into sentences
def split_content_to_sentences(self, content):
content = content.replace("\n", ". ")
... | {
"content_hash": "686db9bbdfbbd4b5bb74bb646cd24d00",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 568,
"avg_line_length": 49.394444444444446,
"alnum_prop": 0.682712855696772,
"repo_name": "minhhahl/tinvan",
"id": "adea73034dcbedec6169cd2a8d493cdc820416d0",
"size": "896... |
import os
import shutil
import glob
import time
import sys
import subprocess
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
ADB_CMD = "adb"
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool do it
print "-->> ... | {
"content_hash": "01df02da09380854b85adb70207ea254",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 92,
"avg_line_length": 30.37735849056604,
"alnum_prop": 0.5450310559006211,
"repo_name": "yugang/crosswalk-test-suite",
"id": "10db5246010fbde79829dbb6f44ae52edb2403eb",
"... |
"""
DB persistence layer.
At this time, the persistence features of txOpenID are fairly dependant
on MySQL. However, every attempt has been made to keep MySQL-specific
code in this module, in hopes of making it easy to support new DB types.
"""
import time
from MySQLdb import cursors
from twisted.internet.defer imp... | {
"content_hash": "0b4a2547aa0ee44995e700a4a48085f1",
"timestamp": "",
"source": "github",
"line_count": 310,
"max_line_length": 117,
"avg_line_length": 27.861290322580643,
"alnum_prop": 0.6729188375593377,
"repo_name": "philchristensen/txOpenID",
"id": "fed93cdc76b3bb47e15d8e28f7899700262f1123",
"s... |
import unittest
import thread_cert
from pktverify.consts import MLE_ADVERTISEMENT, MLE_PARENT_REQUEST, MLE_CHILD_ID_RESPONSE, MLE_CHILD_ID_REQUEST, MGMT_ACTIVE_SET_URI, MGMT_ACTIVE_GET_URI, RESPONSE_TLV, LINK_LAYER_FRAME_COUNTER_TLV, MODE_TLV, TIMEOUT_TLV, VERSION_TLV, TLV_REQUEST_TLV, CHALLENGE_TLV, SCAN_MASK_TLV, AD... | {
"content_hash": "ff5df8484bb5fff52bf28ff6b8582668",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 306,
"avg_line_length": 38.75438596491228,
"alnum_prop": 0.5937830089029726,
"repo_name": "chshu/openthread",
"id": "654393e1500419a7bf5dcf57738de42c424c1d74",
"size": "82... |
from __future__ import unicode_literals
from django.db import connections
from django.db import migrations
def forwards(_, __):
fill_organization_table()
def fill_organization_table():
insert_default_query = build_insert_default_query()
#query = build_insert_query()
execute_insert_query(insert_defa... | {
"content_hash": "c8b1ce460377dd338919ef883b72122a",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 74,
"avg_line_length": 24.53191489361702,
"alnum_prop": 0.6209887250650477,
"repo_name": "dipapaspyros/bdo_platform",
"id": "615f52259261553092d2f51264cb34f0cd609fbd",
"siz... |
"""
Generate a Flocker package that can be deployed onto cluster nodes.
"""
import os
import platform
from setuptools import setup, find_packages
import versioneer
versioneer.vcs = "git"
versioneer.versionfile_source = "flocker/_version.py"
versioneer.versionfile_build = "flocker/_version.py"
versioneer.tag_prefix = ... | {
"content_hash": "d5263632a930010e71feecdfea30b44c",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 97,
"avg_line_length": 31.852534562211982,
"alnum_prop": 0.6193576388888888,
"repo_name": "lukemarsden/flocker",
"id": "629836c9b48aa3213c6dd94b450fa1865819c556",
"size": ... |
"""
* *******************************************************
* Copyright (c) VMware, Inc. 2016. All Rights Reserved.
* SPDX-License-Identifier: MIT
* *******************************************************
*
* DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, WHETHER O... | {
"content_hash": "a211b6425934f12d0539c0a891493410",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 91,
"avg_line_length": 37.705882352941174,
"alnum_prop": 0.5179407176287052,
"repo_name": "pgbidkar/vsphere-automation-sdk-python",
"id": "6701673654e091f1c3988cfc868d52212a... |
#!/usr/bin/python
# This is a modified version by Davide Callegari (http://www.brokenseal.it/)
#
# This code is original from jsmin by Douglas Crockford, it was translated to
# Python by Baruch Even. The original code had the following copyright and
# license.
#
#
from StringIO import StringIO
def jsmin... | {
"content_hash": "56f427b78ddeb61b9980fc782d4404bd",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 110,
"avg_line_length": 34.35204081632653,
"alnum_prop": 0.41155502747660777,
"repo_name": "brokenseal/broke",
"id": "499b694e74aa2c6cdcdde12411657746c6a3a02b",
"size": "7... |
import networkzero as nw0
address = nw0.discover("news1")
while True:
topic, temperature = nw0.wait_for_news_from(address)
print("Temperature is:", temperature)
| {
"content_hash": "0b6e1ca5c21dc341ae62b506ee681473",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 56,
"avg_line_length": 24.428571428571427,
"alnum_prop": 0.7251461988304093,
"repo_name": "tjguk/networkzero",
"id": "557a3e1074e6c8b79f731e3dde7a761b170d1967",
"size": "171... |
from setuptools import setup, find_packages
setup(
name="hash",
version="3.0.0",
author="Wesley Shields <wxs@atarininja.org>, Marcus LaFerrera <@mlaferrera>",
url="https://github.com/PUNCH-Cyber/stoq-plugins-public",
license="Apache License 2.0",
description="Hash content",
packages=find_pa... | {
"content_hash": "03ca9adee417641d6a4946c656b4afd9",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 81,
"avg_line_length": 31.785714285714285,
"alnum_prop": 0.6764044943820224,
"repo_name": "PUNCH-Cyber/stoq-plugins-public",
"id": "19a18c5fb06b5c192bc4a2d160563e800ecb5b44",... |
"""
None
"""
class Logger:
def __init__(self):
"""
Initialize your data structure here.
"""
self.track = {}
def shouldPrintMessage(self, timestamp: int, message: str) -> bool:
"""
Returns true if the message should be printed in the given timestamp, otherwise... | {
"content_hash": "c160e1b655c4f8122c88b6a45c21ed68",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 102,
"avg_line_length": 25.375,
"alnum_prop": 0.5948275862068966,
"repo_name": "franklingu/leetcode-solutions",
"id": "47143a03f6b8537835c12e6423692c6a80fd5a18",
"size": "8... |
"""Speaker diarization pipelines"""
import itertools
import math
from typing import Callable, Optional, Text, Union
import numpy as np
import torch
from einops import rearrange
from pyannote.core import Annotation, SlidingWindow, SlidingWindowFeature
from pyannote.metrics.diarization import GreedyDiarizationErrorRate... | {
"content_hash": "da22425c8364e586a5ed9b40125d76fc",
"timestamp": "",
"source": "github",
"line_count": 521,
"max_line_length": 112,
"avg_line_length": 37.21880998080614,
"alnum_prop": 0.6024960033005002,
"repo_name": "pyannote/pyannote-audio",
"id": "348e1cf117d7eb6ea5f930512f7a474fa38371c7",
"siz... |
CHASSIS_FIELDS = ['uuid', 'description', 'created_at', 'updated_at', 'extra']
CHASSIS_FIELD_LABELS = ['UUID', 'Description', 'Created At', 'Updated At',
'Extra']
CHASSIS_LIST_FIELDS = ['uuid', 'description']
CHASSIS_LIST_FIELD_LABELS = ['UUID', 'Description']
# Nodes
NODE_FIELDS = ['chassi... | {
"content_hash": "570149dd9be86c268672fabfaddc8c05",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 79,
"avg_line_length": 40.020833333333336,
"alnum_prop": 0.551795939614784,
"repo_name": "rdo-management/python-ironicclient",
"id": "e54bcd541b053ad797c8f7edbe39e20c0e6dd842... |
import argparse
import contextlib
import os
import signal
import tempfile
from enum import Enum
import shlex
import subprocess
from tempfile import TemporaryDirectory, mkdtemp, mkstemp
import attr
import logging
import shutil
from dmpy.objects.dm_rule import DMRule
logger = logging.getLogger(__name__)
class Schedu... | {
"content_hash": "c974ed65ea49a224ac476cd5cef91665",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 100,
"avg_line_length": 35.395161290322584,
"alnum_prop": 0.5694919115971747,
"repo_name": "kvg/dmpy",
"id": "a428791bdd7aa3c52ba73e51d3bc3c825fbb03c5",
"size": "8778",
... |
from pkg_resources import Requirement
import pkg_resources
import sys
if __name__ == "__main__":
installed = []
for pkg in sys.stdin.readlines():
pkg = pkg.strip()
if len(pkg):
req = Requirement.parse(pkg)
try:
found = pkg_resources.working_set.find(req... | {
"content_hash": "66afa3475ffaa5a8a880d63b053d0ff2",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 59,
"avg_line_length": 25.75,
"alnum_prop": 0.537864077669903,
"repo_name": "pywizard/pywizard",
"id": "ed97d905c6c50beb98c81a2e8ebbccb963617aa1",
"size": "515",
"binary"... |
"""Script to parse CUPS Internet Printing Protocol (IPP) files."""
import argparse
import logging
import sys
from dtformats import cups_ipp
from dtformats import output_writers
def Main():
"""The main program function.
Returns:
bool: True if successful or False if not.
"""
argument_parser = argparse.Ar... | {
"content_hash": "afb4ada99caf7a85ab75760daadcb716",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 72,
"avg_line_length": 22.6231884057971,
"alnum_prop": 0.66944266495836,
"repo_name": "libyal/dtformats",
"id": "c34b3a58ea5ca4706025fca3a75614a1b9bed6a2",
"size": "1607",
... |
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template.loader import get_template
from django.template import Context
from django.core.cache import cache
from app.models import *
import urllib
import urllib2
from math import floor
from time import... | {
"content_hash": "27eb195f8b3fce19a1fdb8173adac895",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 111,
"avg_line_length": 37.80864197530864,
"alnum_prop": 0.656,
"repo_name": "lstoll/tetherme",
"id": "86f5d0681e2913ef948bceb8c6a6319bc26f02b9",
"size": "6125",
"binary... |
import unittest
from pydirections.director import Director
from pydirections.route_requester import DirectionsRequest
from pydirections.exceptions import InvalidModeError, InvalidAPIKeyError, InvalidAlternativeError
from pydirections.exceptions import InvalidRouteRestrictionError
import os
MAPS_API_KEY = os.environ['M... | {
"content_hash": "45ed59dd8cdf6a7296a65b085c77174b",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 106,
"avg_line_length": 38.58,
"alnum_prop": 0.7662001036806636,
"repo_name": "apranav19/pydirections",
"id": "4023c19111304b6896ea9e3044c590baf9159dc5",
"size": "1929",
... |
import numpy as np
from rlscore.utilities import creators
from rlscore.kernel import LinearKernel
from rlscore.utilities.adapter import SvdAdapter
from rlscore.utilities.adapter import LinearSvdAdapter
from rlscore.utilities.adapter import PreloadedKernelMatrixSvdAdapter
from rlscore.utilities import array_tools
cla... | {
"content_hash": "465770eedc7e7ff6962a687efa36bddd",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 143,
"avg_line_length": 30.793548387096774,
"alnum_prop": 0.6067462811648858,
"repo_name": "max291/RLScore",
"id": "49a254c1e7060fa885b7ead8f14a93621163236b",
"size": "477... |
from .base import StreamProtocol
from struct import Struct
class MessageProtocol(StreamProtocol):
HEADER = Struct("!I")
# compression? max size?
def connected(self):
self._buffer = ""
self._length = None
def disconnected(self):
self._process()
def _proce... | {
"content_hash": "123820280461e956f4f1daa45435d86a",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 82,
"avg_line_length": 18.076923076923077,
"alnum_prop": 0.5255319148936171,
"repo_name": "tomerfiliba/tangled",
"id": "4f87687ecbbd5c3de544f5f12d1db3580324ee78",
"size": "... |
import sys, os
sys.path.insert(0, os.path.abspath(".."))
from flask_pymongo._version import __version__
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it abs... | {
"content_hash": "327bd5064101502ed422f09df8d79bab",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 80,
"avg_line_length": 32.278225806451616,
"alnum_prop": 0.6984384759525296,
"repo_name": "dcrosta/flask-pymongo",
"id": "a1823a4752a19cca5a26620236919d94a0a037bb",
"size"... |
"""Test wrapper to /bin/compare_results.py
"""
import os
import subprocess
from pycits.tools import NotExecutableError
from nose.tools import nottest, assert_equal
from pycits.tools import reformat_swarm_cls
INFILE = os.path.join("tests", "test_data", "compare_clusters",
"compare_list.txt")
OUT... | {
"content_hash": "e1358f2f0bfe2f3b4e5490d0d6d4416e",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 79,
"avg_line_length": 31.721311475409838,
"alnum_prop": 0.5901808785529715,
"repo_name": "widdowquinn/THAPBI-pycits",
"id": "e5f81c6767656815cc6c5854259512345364e529",
"si... |
import base58
import json
import logging
import os
import re
import sys
import yaml
import envparse
from appdirs import user_data_dir, user_config_dir
from lbrynet.core import utils
from lbrynet.core.Error import InvalidCurrencyError
from lbrynet.androidhelpers.paths import (
android_internal_storage_dir,
andro... | {
"content_hash": "50571620ff5fc8edc0a6677a55829ade",
"timestamp": "",
"source": "github",
"line_count": 571,
"max_line_length": 100,
"avg_line_length": 36.9492119089317,
"alnum_prop": 0.612806901128069,
"repo_name": "zestyr/lbry",
"id": "9fde690adc7c4169f6dd934001470999853b10fb",
"size": "21098",
... |
def identity(x):
return x
def cyclist(tree):
res = []
reschildren = yield res
res.extend(reschildren)
yield
def foldcyc(tree,branch=cyclist,leaf=identity,shared=identity,getchildren=iter):
mem = dict()
def _fold(tree):
if id(tree) in mem:
return shared(mem[id(tree)]... | {
"content_hash": "0325a818b20e1e76097c84079db8d6fb",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 80,
"avg_line_length": 27.392857142857142,
"alnum_prop": 0.5215123859191656,
"repo_name": "ActiveState/code",
"id": "c6465f4f64bcc205e39481a17b9e97ea7df31347",
"size": "767... |
from argparse import ArgumentParser, Namespace
from typing import List
import numpy
from keras import Model
from PIL import Image
from pprint import pprint
from acquisition.ebay_downloader_io import EbayDownloaderIO
from data_sets.contains_images import ContainsImages
from utils.with_verbose import WithVerbose
from t... | {
"content_hash": "3c9eeebc12b191de4d5633e343bbebfb",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 108,
"avg_line_length": 34.349514563106794,
"alnum_prop": 0.6353872244205766,
"repo_name": "lene/style-scout",
"id": "bd711bd661e73b1f4f3ffae0a623b01fb416e5e9",
"size": "3... |
from baselines.bench.benchmarks import *
from baselines.bench.monitor import *
| {
"content_hash": "d027012c0021762d77d4009ab8958ae2",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 40,
"avg_line_length": 39.5,
"alnum_prop": 0.8227848101265823,
"repo_name": "dsbrown1331/CoRL2019-DREX",
"id": "4cbd5bba3d615bbd65f3c0ca4070da96a695553c",
"size": "79",
"b... |
from functools import reduce
import gc
import io
import locale # system locale module, not tornado.locale
import logging
import operator
import textwrap
import sys
import unittest
import warnings
from tornado.httpclient import AsyncHTTPClient
from tornado.httpserver import HTTPServer
from tornado.netutil import Resol... | {
"content_hash": "f9761d0e1cf2789ce5706f5865968157",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 100,
"avg_line_length": 34.63900414937759,
"alnum_prop": 0.6436272160996646,
"repo_name": "tornadoweb/tornado",
"id": "6075b1e2bd981a45fa6b902d9162ba36c5f1da72",
"size": "... |
"""
Django settings for population project.
Generated by 'django-admin startproject' using Django 1.9.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os... | {
"content_hash": "8e2b5d76dc52385bbc75045e0d3ecfac",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 91,
"avg_line_length": 26.246268656716417,
"alnum_prop": 0.6912141029286324,
"repo_name": "Chromium97/lnmiithackathon",
"id": "370512ef8e8d8bef233e57f04f7f8e9ef94a4fde",
"... |
from typing import Any
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
VERSION = "unknown"
class AzureCommunicationJobRouterServiceConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
"""Configuration for AzureCommunicationJobRouterService.
... | {
"content_hash": "d58d34f50423783554af7749ded34542",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 117,
"avg_line_length": 50.651162790697676,
"alnum_prop": 0.7171717171717171,
"repo_name": "Azure/azure-sdk-for-python",
"id": "17be90fca9d5115c50a9d6ce96c9eb40eacd52c9",
"... |
from google.cloud.bigquery import analyticshub_v1
def sample_list_org_data_exchanges():
# Create a client
client = analyticshub_v1.AnalyticsHubServiceClient()
# Initialize request argument(s)
request = analyticshub_v1.ListOrgDataExchangesRequest(
organization="organization_value",
)
... | {
"content_hash": "1bc6af74fda2fc021823039313baf184",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 79,
"avg_line_length": 28.5,
"alnum_prop": 0.7350877192982456,
"repo_name": "googleapis/python-bigquery-analyticshub",
"id": "e59812baebb967eed66ac64cf0262a5b1a9170a7",
"si... |
import mongoengine as me
from st2common import log as logging
from st2common.models.db import MongoDBAccess
from st2common.models.db import stormbase
from st2common.constants.types import ResourceType
__all__ = [
'RunnerTypeDB',
]
LOG = logging.getLogger(__name__)
PACK_SEPARATOR = '.'
class RunnerTypeDB(stor... | {
"content_hash": "3e38902ad7f12c14a119a260e14e5fe2",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 89,
"avg_line_length": 31.775862068965516,
"alnum_prop": 0.6983179598480738,
"repo_name": "pixelrebel/st2",
"id": "ecdc42f515a46f1dcca87e4d12563743909a90bb",
"size": "2623"... |
from unittest import TestCase
from .models import Cat, Dog
from relatedentities.models import RelatedEntity
from relatedentities.utils import add_related
class RelatedEntityModelTests(TestCase):
def test_delete_removes_both_sides_of_relationship(self):
cat = Cat.objects.create(name='Test Cat')
do... | {
"content_hash": "ab994a461d1e2c4c743684ed6c7d8fdd",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 82,
"avg_line_length": 32.51219512195122,
"alnum_prop": 0.673668417104276,
"repo_name": "grantmcconnaughey/django-related-entities",
"id": "b1653d27d5b942d798f00b4e66cd9d4862... |
from pkg_resources import require
require('pypes')
# import the Dataflow module
from pypes.pipeline import Dataflow
# import the Component Interface
from pypes.component import Component
# import the built-in ConsoleOutputWriter
from pypes.filters import ConsoleOutputWriter
class HelloWorld(Component):
__metatype... | {
"content_hash": "b1aab08aabf5738c59d6872fe64dc429",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 60,
"avg_line_length": 26.342105263157894,
"alnum_prop": 0.6223776223776224,
"repo_name": "rasata/pypes",
"id": "a6078dc54ed4c563fe02916e834cfc0799194e20",
"size": "1028",
... |
from CTFd.models import Users
from tests.helpers import (
create_ctfd,
destroy_ctfd,
gen_award,
login_as_user,
register_user,
)
def test_accessing_hidden_users():
"""Hidden users should not give any data from /users or /api/v1/users"""
app = create_ctfd()
with app.app_context():
... | {
"content_hash": "d8db790fe124482f93f8ed98a694a693",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 90,
"avg_line_length": 38.23863636363637,
"alnum_prop": 0.575334323922734,
"repo_name": "LosFuzzys/CTFd",
"id": "d9a0288b2aa901bb9d3215a8d39ba3fd1b717ab1",
"size": "3412",
... |
"""
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distrib... | {
"content_hash": "d44c683134b02dad0ad97f30862deb99",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 639,
"avg_line_length": 49.92215568862275,
"alnum_prop": 0.5284874655151733,
"repo_name": "google/debaised-analysis",
"id": "434ace1ed0772654b472efe99797a9cca03d4e2a",
"si... |
import numpy as np
import pandas as pd
from holoviews import Tiles
from holoviews.element.comparison import ComparisonTestCase
class TestCoordinateConversion(ComparisonTestCase):
def test_spot_check_lonlat_to_eastingnorthing(self):
# Anchor implementation with a few hard-coded known values.
# Gen... | {
"content_hash": "ba2cfc2aba721236844070b232e0a279",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 87,
"avg_line_length": 42.14912280701754,
"alnum_prop": 0.6522372528616025,
"repo_name": "ioam/holoviews",
"id": "ecdbfa0bc9232e7ca92c5ec0e570a425f87ecfa1",
"size": "4805"... |
"""
This module is deprecated. Please use `airflow.providers.google.cloud.operators.local_to_gcs`.
"""
import warnings
from airflow.providers.google.cloud.operators.local_to_gcs import LocalFilesystemToGCSOperator
warnings.warn(
"This module is deprecated. Please use `airflow.providers.google.cloud.operators.loc... | {
"content_hash": "fa8adb32e71df18684fa88e9eafee3d2",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 101,
"avg_line_length": 32.857142857142854,
"alnum_prop": 0.7032608695652174,
"repo_name": "mtagle/airflow",
"id": "6bf4986390c3ed4a96e964e05fb55a9dd73cf232",
"size": "1707... |
""" Test the quoted APOGEE uncertainties from individual (rebinned) spectra. """
__author__ = "Andy Casey <arc@ast.cam.ac.uk>"
import numpy as np
import matplotlib.pyplot as plt
from astropy.io import fits
from glob import glob
from itertools import combinations
def get_differences(apStar_filename):
image = fi... | {
"content_hash": "b80a0e97747a04009a6661e9a3331133",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 87,
"avg_line_length": 29.041095890410958,
"alnum_prop": 0.5872641509433962,
"repo_name": "andycasey/luminosity-cannon",
"id": "79083f742da3f3eee14c296fe653dcc7712b69ac",
"... |
import datetime
from django.contrib.auth.models import User
from django.http import HttpRequest
from eav.models import Attribute
from education.models import Role, School, UserProfile, EmisReporter
from poll.models import Poll
from rapidsms.contrib.locations.models import LocationType, Location, Point
from rapidsms.mod... | {
"content_hash": "3201186e7ab214dd7994d749442831b4",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 92,
"avg_line_length": 34.6,
"alnum_prop": 0.7026332691072575,
"repo_name": "unicefuganda/edtrac",
"id": "2f32b6bc1e9bc9560327f6f04fb1771ae7f54da3",
"size": "3158",
"bina... |
from copy import deepcopy
from typing import Any, TYPE_CHECKING
from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient
from . import models
from .._serialization import Deserializer, Serializer
from ._configuration import NetworkManagementClientConfiguration
from .operatio... | {
"content_hash": "ca2038d7b14fcb37c7adbf09d8485b05",
"timestamp": "",
"source": "github",
"line_count": 232,
"max_line_length": 119,
"avg_line_length": 52.30172413793103,
"alnum_prop": 0.7422943794297017,
"repo_name": "Azure/azure-sdk-for-python",
"id": "7b6dc19eae83bc7e951aabdd60845b2805c43b8f",
"... |
from unittest import TestCase
import inferi
class Tests(TestCase):
def test_combinatorics(self):
# How many ways of arranging six objects are there?
self.assertEqual(inferi.permutations(6), 720)
# How many ways of arranging three of five objects are there?
self.assertEqual(inferi.... | {
"content_hash": "0439c7cf7cb26cf02e604738cf986f38",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 88,
"avg_line_length": 49.321917808219176,
"alnum_prop": 0.571726149145952,
"repo_name": "samirelanduk/inferi",
"id": "ba216f6ad2d3c453bb7f3acfa1a1df7528c584d0",
"size": "... |
'''
TODO Add a proper introduction of the package.
'''
from pkg_resources import resource_filename # @UnresolvedImport # pylint: disable=E0611
# S-W direction parameters
UPPER_LEFT_DIRECTION = 1
UPPER_DIRECTION = 2
LEFT_DIRECTION = 3
NO_DIRECTION = 2**5
STOP_DIRECTION = 2**6
IN_ALIGNMENT = 2**5 + 2**6
def read_fil... | {
"content_hash": "3a8fb3a043e9775c5cca166347177c3b",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 89,
"avg_line_length": 26.88888888888889,
"alnum_prop": 0.7024793388429752,
"repo_name": "swarris/pyPaSWAS",
"id": "a9b75fc15b43d15e528ee1c9f934037f68f6f84e",
"size": "484"... |
"""
Utility for caching master images.
"""
import os
import tempfile
import time
import uuid
from oslo_concurrency import lockutils
from oslo_log import log as logging
from oslo_utils import fileutils
import six
from ironic.common import exception
from ironic.common.glance_service import service_utils
from ironic.co... | {
"content_hash": "95e12f2ae5d8eca38abeb4f6117bd7e6",
"timestamp": "",
"source": "github",
"line_count": 415,
"max_line_length": 79,
"avg_line_length": 42.12771084337349,
"alnum_prop": 0.5914888749070526,
"repo_name": "ruyang/ironic",
"id": "11702a5b7325199bef12b049b8cd9cb315f37c9e",
"size": "18148"... |
"""
QUESTION:
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the
original list.
For example,
Given 1->2->3->3->4->4->5, return 1->2->5.
Given 1->1->1->2->3, return 2->3.
ANSWER:
Iterate list and compare
"""
# Definition for singly-linked list.
# class List... | {
"content_hash": "2f2beb00f2f30c407d2bacb3c254a01c",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 112,
"avg_line_length": 23.82051282051282,
"alnum_prop": 0.527448869752422,
"repo_name": "tktrungna/leetcode",
"id": "73129d20d84e8c3dc4c23d9eef9ee17f8bb63e0b",
"size": "92... |
"""Switching v2 features on and off."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python import tf2
from tensorflow.python.data.experimental.ops import counter
from tensorflow.python.data.experimental.ops import interleave_ops
from ten... | {
"content_hash": "9911233ba87001ccabae615508cafbd5",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 80,
"avg_line_length": 46.505050505050505,
"alnum_prop": 0.7821459600347523,
"repo_name": "aam-at/tensorflow",
"id": "eac841fb2fee928b0503ba79afaaef9848938dd4",
"size": "52... |
import dbus
bus = dbus.SystemBus()
dummy = dbus.Interface(bus.get_object('org.bluez', '/'), 'org.freedesktop.DBus.Introspectable')
#print dummy.Introspect()
manager = dbus.Interface(bus.get_object('org.bluez', '/'), 'org.bluez.Manager')
try:
adapter = dbus.Interface(bus.get_object('org.bluez', manager.DefaultAd... | {
"content_hash": "b1a0a969c4cba8c935c012f60804002f",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 101,
"avg_line_length": 22.8125,
"alnum_prop": 0.7123287671232876,
"repo_name": "sergecodd/FireFox-OS",
"id": "5af61535ba4d37477213760a4862545136c00a15",
"size": "365",
"... |
"""Configure py.test."""
import pytest
from pyvizio.const import DEVICE_CLASS_SPEAKER, MAX_VOLUME
from .const import (
ACCESS_TOKEN,
APP_LIST,
CH_TYPE,
CURRENT_APP_CONFIG,
CURRENT_EQ,
CURRENT_INPUT,
EQ_LIST,
INPUT_LIST,
INPUT_LIST_WITH_APPS,
MODEL,
RESPONSE_TOKEN,
UNIQUE... | {
"content_hash": "8d406aabbce89abadf1e1050cc36f5da",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 93,
"avg_line_length": 31.535135135135135,
"alnum_prop": 0.673808707576277,
"repo_name": "robbiet480/home-assistant",
"id": "f7448a71c3168af12638e2dfed6518817b50b0f5",
"si... |
debug = True
debug = False
# from CommonClasses import * # hxl: comment out this line for submission
class Solution:
# @param A, a list of integers
# @param target, an integer to be searched
# @return an integer
def search(self, A, target):
# hxl: add this IF ... | {
"content_hash": "0620cde16c6409d28467c326ed5ef0df",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 100,
"avg_line_length": 34.096774193548384,
"alnum_prop": 0.47445600756859035,
"repo_name": "54lihaoxin/leetcode_python",
"id": "467ac0ac2adb528888b7c097d0e6c55b39a4bf8f",
... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('account', '0016_auto_20160413_1649'),
]
operations = [
migrations.RenameField(
model_name='account',
old_name='test_repos',
... | {
"content_hash": "595c13a1b805d9fbf5b55aa152694089",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 47,
"avg_line_length": 20.5,
"alnum_prop": 0.5799457994579946,
"repo_name": "iModels/ffci",
"id": "e0d37c9396daaa2a9eb5bab0587af1163c534621",
"size": "441",
"binary": fal... |
"""
Parser for ACE files output by PHRAP.
Written by Frank Kauff (fkauff@duke.edu) and
Cymon J. Cox (cymon@duke.edu)
Uses the Biopython Parser interface: ParserSupport.py
Usage:
There are two ways of reading an ace file:
1) The function 'read' reads the whole file at once;
2) The function 'parse' reads the file con... | {
"content_hash": "d9686206036f3746c163cb18ed6ce855",
"timestamp": "",
"source": "github",
"line_count": 537,
"max_line_length": 115,
"avg_line_length": 34.787709497206706,
"alnum_prop": 0.5000802954873936,
"repo_name": "LyonsLab/coge",
"id": "0025ecd5e501b7a1a3ea2da282c5e2d2a7a09aa7",
"size": "1892... |
def fatal_error(error):
"""Print out the error message that gets passed, then quit the program.
Inputs:
error = error message text
:param error: str
:return:
"""
raise RuntimeError(error)
| {
"content_hash": "edb410546fe0362441d70e8016176a42",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 75,
"avg_line_length": 19.90909090909091,
"alnum_prop": 0.6438356164383562,
"repo_name": "stiphyMT/plantcv",
"id": "5b2869096f841514f4e673f56648bd0ecbd4a2ed",
"size": "238"... |
from django.conf import settings
OVERRIDE_MIDDLEWARE = getattr(
settings, 'STATICTEMPLATE_OVERRIDE_MIDDLEWARE', True
)
| {
"content_hash": "5cce7d228a415b153c89d166a13163b5",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 56,
"avg_line_length": 24.8,
"alnum_prop": 0.782258064516129,
"repo_name": "ojii/django-statictemplate",
"id": "3f94083e8fae0af88fd8908acfa0a294459fe0cb",
"size": "148",
"... |
import os
from i3pystatus.mail import Backend
class MaildirMail(Backend):
"""
Checks for local mail in Maildir
"""
settings = (
"directory",
)
required = ("directory",)
directory = ""
def init(self):
self.directory = os.path.expanduser(self.directory)
@property
... | {
"content_hash": "462cfb6cf93fc63ada778fd622f3f19c",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 90,
"avg_line_length": 30.22222222222222,
"alnum_prop": 0.6110294117647059,
"repo_name": "Arvedui/i3pystatus",
"id": "0f21422fd39b5962ef9d50ef71435682583cad10",
"size": "13... |
"""
Base Driver Module
"""
import asyncpg
from autobahn.wamp.types import SubscribeOptions, PublishOptions
from eventify.exceptions import SENTRY_CLIENT, SENTRY_DSN
from eventify.persist.constants import EVENT_DB_HOST, \
EVENT_DB_USER, \
EV... | {
"content_hash": "4594218ec980c91cf5f1f83fed75bef1",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 95,
"avg_line_length": 32.91025641025641,
"alnum_prop": 0.5909622126996494,
"repo_name": "eventifyio/eventify",
"id": "b5be7217400d014188dfed2052eccdffda079c2a",
"size": "2... |
from __future__ import print_function, absolute_import, division, unicode_literals
# TEST_UNICODE_LITERALS
import numpy as np
import pytest
import os
from astropy.units import Quantity
from astropy import units as u
from frb.dlas import approx_avgDM
from frb.dlas import monte_DM
from frb.dlas import monte_tau
def... | {
"content_hash": "0bfd37e67e312b17c1502e2390b51012",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 82,
"avg_line_length": 23.34090909090909,
"alnum_prop": 0.6465433300876339,
"repo_name": "FRBs/DM",
"id": "5ce586463b76644df5bb6f0b37199b016ced47c1",
"size": "1080",
"bin... |
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from direct.directnotify import DirectNotifyGlobal
from direct.showbase.DirectObject import DirectObject
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer
from toontown.toonbase import ToontownTimer
from direct.ta... | {
"content_hash": "d58fce570ca50dad224af726840bf2eb",
"timestamp": "",
"source": "github",
"line_count": 528,
"max_line_length": 555,
"avg_line_length": 57.75568181818182,
"alnum_prop": 0.635284472864404,
"repo_name": "Spiderlover/Toontown",
"id": "affb7ee9c825631aaeca090664ffaf8a1e93b7f3",
"size": ... |
"""
Support for Russound multizone controllers using RIO Protocol.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.russound_rio/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.core import callback
from homeas... | {
"content_hash": "62d121ae2d5df3cbb6977d839fc27cec",
"timestamp": "",
"source": "github",
"line_count": 213,
"max_line_length": 79,
"avg_line_length": 31.323943661971832,
"alnum_prop": 0.5912769784172662,
"repo_name": "stefan-jonasson/home-assistant",
"id": "31b04ceb3cdee8a7116aef9fe85dd4fdaae38593",... |
"""Base class for iRobot devices."""
from __future__ import annotations
import asyncio
import logging
from homeassistant.components.vacuum import (
ATTR_STATUS,
STATE_CLEANING,
STATE_DOCKED,
STATE_ERROR,
STATE_RETURNING,
StateVacuumEntity,
VacuumEntityFeature,
)
from homeassistant.const im... | {
"content_hash": "e4d123869267fca6dafdc5934f7db435",
"timestamp": "",
"source": "github",
"line_count": 270,
"max_line_length": 86,
"avg_line_length": 34.129629629629626,
"alnum_prop": 0.6119370591427021,
"repo_name": "nkgilley/home-assistant",
"id": "f443f72279f44576ae4b93524f08947f359f4e62",
"siz... |
import os
import sys
import csv
import json
OUTPUT_FORMATS = ('csv', 'json', 'yara', 'data', 'netflow', )
def getHandler(output_format):
output_format = output_format.lower()
if output_format not in OUTPUT_FORMATS:
print("[WARNING] Invalid output format specified.. using CSV")
output_format = ... | {
"content_hash": "ddedec115c1ca75cb28e21bf3f93b2ba",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 128,
"avg_line_length": 27.770491803278688,
"alnum_prop": 0.5481109799291618,
"repo_name": "ttufts/ioc_parser",
"id": "c4297033bf65d9df47c939b9fac9a30cbda04967",
"size": "... |
import sqliteDefaults
import os
import extraction_text_manip
os.system("reset")
conn = sqliteDefaults.get_conn("article_extract_db.db")
conn.execute('''CREATE TABLE IF NOT EXISTS `articles_clean` (
`company_or_sector` TEXT,
`article_url` TEXT,
PRIMARY KEY(company_or_sector, article_url)
);
''')
conn.commit()
... | {
"content_hash": "821fea827415afe51f0df712ed6f8766",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 146,
"avg_line_length": 28.63917525773196,
"alnum_prop": 0.6364290856731462,
"repo_name": "ARDivekar/SearchDistribute",
"id": "eeba0389cf1fb38257f7b99d1735fa3f81e10ecf",
"... |
"""Contains WmsGetMapRequest."""
import logging
import StringIO
import wms.ogc.common.geom as geom
import wms.ogc.common.image_specs as image_specs
import wms.ogc.common.tiles as tiles
import wms.ogc.common.utils as utils
OPERATIONS = set(["GetMap", "GetCapabilities"])
# These are all of the 1.3.0 official codes. 1... | {
"content_hash": "c0c0ad9124ee2b54fe97693de68462cb",
"timestamp": "",
"source": "github",
"line_count": 281,
"max_line_length": 80,
"avg_line_length": 37.10320284697509,
"alnum_prop": 0.6654517552273164,
"repo_name": "iparanza/earthenterprise",
"id": "d7ad1ef3e82db7bb4d7a2f9e985dc071fd2e4607",
"siz... |
from sklearn2sql_heroku.tests.regression import generic as reg_gen
reg_gen.test_model("Ridge" , "freidman2" , "postgresql")
| {
"content_hash": "668de6b2cc74c8ab03dbcda4725588ba",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 66,
"avg_line_length": 31.5,
"alnum_prop": 0.7619047619047619,
"repo_name": "antoinecarme/sklearn2sql_heroku",
"id": "73147cfde4ee1784fa6d8e8b1faceefb2fc1c876",
"size": "126... |
"""
WSGI config for bugTracking project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_S... | {
"content_hash": "dbb8372dd8b2d365dd9d2d1ea1757e18",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 24.9375,
"alnum_prop": 0.7744360902255639,
"repo_name": "YikaiLee/bugTracker",
"id": "83782d29c3e9b0f273ad0b84e0e1c81d273f8b14",
"size": "399",
"bi... |
"""
sentry.management.commands.create_sample_event
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from django.core.management.base import BaseCommand, CommandE... | {
"content_hash": "5c0754c77f70bc6069368fe9b0fcf97f",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 105,
"avg_line_length": 39.285714285714285,
"alnum_prop": 0.6206060606060606,
"repo_name": "BayanGroup/sentry",
"id": "b617a1ce31f5fb3c0cac608d2b74f82f5c080218",
"size": "1... |
'''
Created on 11 Nov 2014
@author: maxz
'''
from observable import Observable
class Updateable(Observable):
"""
A model can be updated or not.
Make sure updates can be switched on and off.
"""
_updates = True
def __init__(self, *args, **kwargs):
super(Updateable, self).__init__(*args... | {
"content_hash": "435aa9ef9f6c19ee2476dbde59aeafb5",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 89,
"avg_line_length": 32.43636363636364,
"alnum_prop": 0.5997757847533632,
"repo_name": "strongh/GPy",
"id": "593f3c0509027c769a3f96fc386e682000c0d5d4",
"size": "1784",
... |
"""This example gets all disapproved ads for a given campaign.
To add an ad, run add_ads.py.
The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" file. By default, it looks for this file in your home
directory. For more information, see the "Caching authentication information"
sect... | {
"content_hash": "4fc53de52c64d54da6f1062a365d02cf",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 80,
"avg_line_length": 33.229885057471265,
"alnum_prop": 0.612590799031477,
"repo_name": "Aloomaio/googleads-python-lib",
"id": "a9fbc25832cfbd4776c01937ae8c85c2e3fbc62c",
... |
from .sub_resource import SubResource
class BackendAddressPool(SubResource):
"""Pool of backend IP addresses.
Variables are only populated by the server, and will be ignored when
sending a request.
:param id: Resource ID.
:type id: str
:ivar backend_ip_configurations: Gets collection of refe... | {
"content_hash": "9cb735f5451a0caebe1254212b4e9e27",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 128,
"avg_line_length": 43.23728813559322,
"alnum_prop": 0.6675813406507252,
"repo_name": "SUSE/azure-sdk-for-python",
"id": "011aa60e2ff5b4ffd0f055eaadc857d0f302563a",
"si... |
def get_data(entry, source_database, config):
if entry == 'structures':
return {
'description': "A structure.",
"properties": {
"id": "An entry's ID",
"modification_date": "A date representing when the entry was last modified.",
"elemen... | {
"content_hash": "be1c0adab47b46c4e949a2ad92799ee9",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 113,
"avg_line_length": 40.02272727272727,
"alnum_prop": 0.43668370244179444,
"repo_name": "rartino/optimadeapi",
"id": "98cd48d6a6e5b3bcbe69b54da683e84132e0a45c",
"size": ... |
from django.utils.translation import ugettext_lazy as _ # noqa
import horizon
from openstack_dashboard.dashboards.admin import dashboard
class Quotas(horizon.Panel):
name = _("System Info")
slug = 'info'
dashboard.Admin.register(Quotas)
| {
"content_hash": "665c95f7ff40e209e9ae798f665f98e6",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 63,
"avg_line_length": 19.384615384615383,
"alnum_prop": 0.746031746031746,
"repo_name": "deepakselvaraj/federated-horizon",
"id": "413903143cafe9e61b421eb80fbe2408646d5ace",... |
"""
scrapy.linkextractors
This package contains a collection of Link Extractors.
For more info see docs/topics/link-extractors.rst
"""
import re
from six.moves.urllib.parse import urlparse
from parsel.csstranslator import HTMLTranslator
from w3lib.url import canonicalize_url
from scrapy.utils.misc import arg_to_ite... | {
"content_hash": "03a96efc2a712455a73935ad44e5c392",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 95,
"avg_line_length": 34.84070796460177,
"alnum_prop": 0.6121412242824485,
"repo_name": "ssteo/scrapy",
"id": "2d7115cc50475bf962af3ab38340ebd65dcc182b",
"size": "3937",
... |
from string import Template
from flask_mail import Mail, Message
from ifsApprover import db, config
from ifsApprover.Log import get_logger
from ifsApprover.web import app
#
# mail templates
# (subject, body)
#
NEW_IMAGE_MAIL = (u"Neues IfS ($amount)!", u"""\
Hallo,
$owner hat ein neues Image from Space hochgeladen... | {
"content_hash": "4f81a7f84ae622b56e6158d4cc45828b",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 131,
"avg_line_length": 29.883333333333333,
"alnum_prop": 0.6837702175125489,
"repo_name": "ktt-ol/ifs-approver",
"id": "b2ce34fc99462e615bf4fee8b7ce9f0e348d9535",
"size":... |
import array
import struct
import zlib
from enum import Enum
from pkg_resources import parse_version
from kaitaistruct import __version__ as ks_version, KaitaiStruct, KaitaiStream, BytesIO
if parse_version(ks_version) < parse_version('0.7'):
raise Exception(
"Incompatible Kaitai Struct Python API: 0.7 or ... | {
"content_hash": "e85d61c2fde0dfee76842d7c467d9372",
"timestamp": "",
"source": "github",
"line_count": 244,
"max_line_length": 106,
"avg_line_length": 38.59836065573771,
"alnum_prop": 0.5262263750265449,
"repo_name": "sonusz/PhasorToolBox",
"id": "cef3ac1b673ed50a5efd8fdc567a73fcf8fa4fe9",
"size":... |
from portality.lib import dates, plugin
from datetime import datetime
import json
DO_TYPE_TO_JSON_TYPE = {
"str": "string",
"utcdatetime": "timestamp",
"integer": 0,
"bool": True,
"float": 0.0,
"isolang": "string",
"url": "string",
"isolang_2letter": "string",
"bigenddate" : "datest... | {
"content_hash": "fcc064111e6011aefa55b5aeb5517689",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 251,
"avg_line_length": 34.52348993288591,
"alnum_prop": 0.5746500777604977,
"repo_name": "DOAJ/doaj",
"id": "dafb8b8d957ad51b113da95d8e4b38320ae10c26",
"size": "5144",
... |
import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="size", parent_name="funnel.hoverlabel.font", **kwargs
):
super(SizeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=par... | {
"content_hash": "9cc49b6ded0f88effd6dc80426886f91",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 80,
"avg_line_length": 34.4375,
"alnum_prop": 0.573502722323049,
"repo_name": "plotly/python-api",
"id": "57782598c7b1f6819a9766979d9c596198011dff",
"size": "551",
"binar... |
from pptx import Presentation
from pptx.util import Inches
import io
from os.path import join as opj
import os
__all__ = ['BasicPresentation']
""" (text, fig, table) """
layouts = {(True, True, True):0,
(True, True, False):1,
(True, False, True):2,
(True, False, False):3,
(... | {
"content_hash": "bf420edfe7de76e751f9bf924068da09",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 102,
"avg_line_length": 35.08620689655172,
"alnum_prop": 0.5120393120393121,
"repo_name": "agartland/utils",
"id": "bbe8596274ce3c85201c251f5b6ddc9358572d7d",
"size": "407... |
from django.conf.urls.defaults import *
from django_de.apps.authors.models import Author
urlpatterns = patterns('django.views.generic.list_detail',
(r'^$', 'object_list',
dict(
queryset = Author.objects.order_by('name', 'slug'),
template_object_name = 'author',
allow_emp... | {
"content_hash": "483323a5d33f79b4bb469faacdcee603",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 63,
"avg_line_length": 29,
"alnum_prop": 0.6005747126436781,
"repo_name": "django-de/django-de-v2",
"id": "ec6fc365fba5cf24eaa65c0fc66ac4f868483a76",
"size": "348",
"bina... |
#!/usr/bin/python
# IPC - Instructions Per Cycles using Perf Events and
# uprobes
# 24-Apr-2020 Saleem Ahmad Created this.
from bcc import BPF, utils
from optparse import OptionParser
# load BPF program
code="""
#include <uapi/linux/ptrace.h>
struct perf_delta {
u64 clk_delta;
u64 inst_delta;
u64 time_de... | {
"content_hash": "b24d56b05d07e9153b2bd9af01be4b17",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 120,
"avg_line_length": 29.605555555555554,
"alnum_prop": 0.6535935447551136,
"repo_name": "tuxology/bcc",
"id": "51d15f6c0119f937f56e1d81a7a09a1aeb6e8c89",
"size": "5329"... |
"""
[01/14/13] Challenge #117 [Easy] Hexdump to ASCII
https://www.reddit.com/r/dailyprogrammer/comments/16jiuq/011413_challenge_117_easy_hexdump_to_ascii/
# [](#EasyIcon) *(Easy)*: Hexdump to ASCII
Hexadecimal is a base-16 representation of a number. A single byte of information, as an unsigned integer, can have a
va... | {
"content_hash": "a20c49ce2dd528bc4795579d45009e55",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 118,
"avg_line_length": 45.72549019607843,
"alnum_prop": 0.7165523156089194,
"repo_name": "DayGitH/Python-Challenges",
"id": "8628832167b30d3bcaeadd49e22faceea7b74669",
"si... |
from __future__ import absolute_import
from __future__ import division, print_function, unicode_literals
from itertools import chain
from operator import attrgetter
from .._compat import ffilter
from ._summarizer import AbstractSummarizer
class EdmundsonLocationMethod(AbstractSummarizer):
def __init__(self, stem... | {
"content_hash": "38aa771af905c1fa4453a8785272dcb6",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 93,
"avg_line_length": 38.9375,
"alnum_prop": 0.6292134831460674,
"repo_name": "miso-belica/sumy",
"id": "04ec5db84ee15322b899cf1d02922a0e6177a506",
"size": "2517",
"bina... |
print f['adieresis'].components[0].baseGlyph
print f['adieresis'].components[1].baseGlyph
# move the component in the base glyph
f['adieresis'].components[1].offset = (100,100)
# scale the component in the base glyph
f['adieresis'].components[0].scale = (.5, .25)
| {
"content_hash": "acb57ee64d53787e79c6a37519d9ecea",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 47,
"avg_line_length": 33.25,
"alnum_prop": 0.7255639097744361,
"repo_name": "daltonmaag/robofab",
"id": "b8e9fe291ae6fe415dff20c8133e09e310e49ee2",
"size": "324",
"binary... |
from .th import *
| {
"content_hash": "498a3e819723517a8bd5f61047f8150a",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 17,
"avg_line_length": 18,
"alnum_prop": 0.6666666666666666,
"repo_name": "hangzhaomit/semantic-segmentation-pytorch",
"id": "abe3cbe49477fe37d4fc16249de8a10f4fb4a013",
"siz... |
import requests, xmltodict
def getChannels():
''' This function gets all the channels and saves them in a dictionairy and returns the channels '''
r = requests.get("http://api.sr.se/api/v2/channels/")
channelsDict = xmltodict.parse(r.content)
formattedDict = channelsDict['sr']['channels']
return... | {
"content_hash": "ce721e5c8f089b784949120909dc9d4b",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 112,
"avg_line_length": 39.765625,
"alnum_prop": 0.6978388998035363,
"repo_name": "mariaholmberg283/WebbtjansterGruppDiggarn",
"id": "c1f372cfddab4a5dda7b7df62c1513f72026a891... |
from .base import View
class EchoView(View):
"""returns the content, debug use"""
def get(self):
"""
returns the query string as JSON
.. note::
.. code-block:: text
/api/echo?a=b&a=c&c=d
gives:
.. code-block:: json
... | {
"content_hash": "48f16743a84aff48cd4caecb0bb7ed11",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 43,
"avg_line_length": 18.487179487179485,
"alnum_prop": 0.47295423023578365,
"repo_name": "nthuion/nthuion-backend",
"id": "aac36258a0b569685a9e6510ffd4fe665eb8429b",
"siz... |
"""MB - the Meta-Build wrapper around GYP and GN
MB is a wrapper script for GYP and GN that can be used to generate build files
for sets of canned configurations and analyze them.
"""
from __future__ import print_function
import argparse
import ast
import errno
import json
import os
import pipes
import pprint
import... | {
"content_hash": "14dff62262a20ee9275d095297acbc3a",
"timestamp": "",
"source": "github",
"line_count": 798,
"max_line_length": 80,
"avg_line_length": 35.11528822055138,
"alnum_prop": 0.581400328313468,
"repo_name": "lihui7115/ChromiumGStreamerBackend",
"id": "80f2979189e2279c4c3824e32ede0874f841ba33... |
import os
import warnings
import matplotlib.pyplot as plt
#plt.interactive(True)
import matplotlib as mpl
import matplotlib.ticker as ticker
from matplotlib.colors import LogNorm
from mpl_toolkits.axes_grid1 import make_axes_locatable
# convenient dataset and projection functions
import wradlib as wrl
# georef, gis
f... | {
"content_hash": "e85063c43cba64bd6fb7dc2727c5477a",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 119,
"avg_line_length": 38.11764705882353,
"alnum_prop": 0.6554433221099888,
"repo_name": "jjhelmus/wradlib",
"id": "fa9690b260f80ffe60b652056378017aa37d2a30",
"size": "76... |
import sys
from hiclib import mapping, fragmentHiC
from mirnylib import h5dict, genome
basedir = sys.argv[1]
mapped_reads1 = h5dict.h5dict('%s/Data/Timing/mapped_reads1.hdf5' % basedir)
mapped_reads2 = h5dict.h5dict('%s/Data/Timing/mapped_reads2.hdf5' % basedir)
mapped_reads3 = h5dict.h5dict('%s/Data/Timing/mapped_r... | {
"content_hash": "d9751f44cc3ceaa2d4283e0aa9028279",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 109,
"avg_line_length": 34.12307692307692,
"alnum_prop": 0.7146077547339946,
"repo_name": "bxlab/HiFive_Paper",
"id": "39635708243888919a7c905b4b8a6e4fd9dc3dde",
"size": "2... |
'''
Load the statewide dataset and plot partial regression of high school
graduation on murder rate after removing the effects of rate of urbanization,
poverty, and rate of single household.
'''
import statsmodels.api as sm
import matplotlib.pyplot as plt
crime_data = sm.datasets.statecrime.load_pandas()
sm.graphics... | {
"content_hash": "9bde674c1e92a0726a8d776a3f53d425",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 77,
"avg_line_length": 35,
"alnum_prop": 0.6819047619047619,
"repo_name": "statsmodels/statsmodels.github.io",
"id": "c68751d7c0af7d5a398872a47f40b7387cfb86e2",
"size": "54... |
import logging
from ..analysis import Analysis, register_analysis
from networkx import DiGraph
from copy import copy
l = logging.getLogger(name="angr.analyses.dfg")
class DFG(Analysis):
def __init__(self, cfg=None, annocfg=None):
"""
Build a Data Flow Grah (DFG) for every basic block of a CFG
... | {
"content_hash": "b5875cc6df6acd3f8e43d1809111abf8",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 124,
"avg_line_length": 40.61904761904762,
"alnum_prop": 0.46468347010551,
"repo_name": "haylesr/angr",
"id": "5bf5d4b58292ae2ba69a29b18aecb8fa7bd4c257",
"size": "6824",
... |
from som.primitives.primitives import Primitives
from som.vm.globals import trueObject, falseObject
from som.vmobjects.primitive import UnaryPrimitive, BinaryPrimitive
def _not(_rcvr):
return trueObject
def _and(_rcvr, _arg):
return falseObject
class FalsePrimitivesBase(Primitives):
def install_primi... | {
"content_hash": "f7db76a3780f6de85b633a5214869738",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 87,
"avg_line_length": 31.210526315789473,
"alnum_prop": 0.7403035413153457,
"repo_name": "SOM-st/RPySOM",
"id": "bbd490dd1a9cc7a936ead9579e0a8087d8d32ee7",
"size": "593",
... |
import sys
import traceback
import threading
import logging
import time
from ginga.misc import Task, Future, Callback
from collections import deque
import queue as Queue
class GwMain(Callback.Callbacks):
def __init__(self, queue=None, logger=None, ev_quit=None, app=None,
thread_pool=None):
... | {
"content_hash": "1cf960d48b5b7ef48d96e84443209eb1",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 77,
"avg_line_length": 30.502024291497975,
"alnum_prop": 0.559729227501991,
"repo_name": "ejeschke/ginga",
"id": "b360ac4f7d809982dc9ab243285c73aedb3c6d32",
"size": "7700"... |
from common_fixtures import * # NOQA
from cattle import ApiError
def _get_agent_for_container(container):
agent = None
for map in container.hosts()[0].instanceHostMaps():
c = map.instance()
if c.agentId is not None:
agent = c.agent()
assert agent is not None
return agent
... | {
"content_hash": "f50bcd046927ee977838de4ec6f864b2",
"timestamp": "",
"source": "github",
"line_count": 269,
"max_line_length": 77,
"avg_line_length": 37.405204460966544,
"alnum_prop": 0.646789902603856,
"repo_name": "stresler/cattle",
"id": "37b1670f8ed201731ab28d31f68580ef7e0c4cdf",
"size": "1006... |
from __future__ import absolute_import, division, print_function, \
with_statement
import os
import sys
import hashlib
import logging
import binascii
import struct
import base64
import time
import random
import hmac
import hashlib
import string
from shadowsocks import common
from shadowsocks.obfsplugin import pla... | {
"content_hash": "40f8e62aee28213168898a2c85958352",
"timestamp": "",
"source": "github",
"line_count": 296,
"max_line_length": 230,
"avg_line_length": 44.439189189189186,
"alnum_prop": 0.5552683594343926,
"repo_name": "kaneawk/shadowsocksr",
"id": "36f4af354552c5644c971ccaf7abc771420379b6",
"size"... |
import requests
import json
import sys
sys.path.append('../conn/')
import conn
#vol_name = raw_input('Input volume name:')
url = conn.url + 'storage/scrub/'
auth = conn.auth
headers = conn.headers
payload = {
"scrub_volume": 2,
"scrub_dayweek": "7",
"scrub_minute": "00",
"scrub_... | {
"content_hash": "6720e963342e7f483f3fcb2d8865a743",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 86,
"avg_line_length": 24.472727272727273,
"alnum_prop": 0.5973254086181278,
"repo_name": "PatriQ7/freenas-test-api",
"id": "70cce0c70d16449df8fa120f49b8dda6937aaf8b",
"siz... |
import unittest
import time
import os
import win32com.client
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
__author__ = 'Kan!skA'
# (C)2017,GIST,CDAC
cla... | {
"content_hash": "50e5b717adc06379594d4f88fed6759f",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 117,
"avg_line_length": 42.95238095238095,
"alnum_prop": 0.47200665188470065,
"repo_name": "GruLab/Text-To-Speech",
"id": "cbfb2fc3170a0cb1dc14840aeb69d99acc671f10",
"size"... |
"""Decorator for API proxy views"""
import functools
import json
import logging
from requests.exceptions import ConnectTimeout, ReadTimeout
TIMEOUT_RESPONSE = json.dumps({"error": "Request timeout."})
log = logging.getLogger(__name__)
def on_timeout(response=TIMEOUT_RESPONSE):
"Decorator for view functions w... | {
"content_hash": "f01b53b0d75858b77f70f83612d7d7c8",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 79,
"avg_line_length": 26.65714285714286,
"alnum_prop": 0.6441586280814576,
"repo_name": "ministryofjustice/cla_public",
"id": "b3c605a78fea5d9e6fdfaf39d117418350053f88",
"... |
import atexit
import functools
import os
import re
import sys
import time
import urllib
import uuid
import fixtures
from oslo_log import log as logging
from oslo_serialization import jsonutils as json
from oslo_utils import importutils
import six
import testscenarios
import testtools
from tempest import clients
from ... | {
"content_hash": "18d7e07d26d42ca8d795c6f7600b8497",
"timestamp": "",
"source": "github",
"line_count": 812,
"max_line_length": 79,
"avg_line_length": 41.064039408866996,
"alnum_prop": 0.5909309021113244,
"repo_name": "flyingfish007/tempest",
"id": "df6b30d236a49f3fb4e65746a52439c798641d83",
"size"... |
'''
Copyright (c) 2014 Tilman Ginzel
This code is licensed under MIT license (see LICENSE.txt for details).
Created on 20.04.2014
'''
from general.Color import Color
from general.HomVector import HomVector
from general.Camera import Camera
from general.Light import Light
from entities.Sphere import Sphere
from entitie... | {
"content_hash": "2d790de23b02f7abb1d8da9c9cccbce7",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 251,
"avg_line_length": 48.97674418604651,
"alnum_prop": 0.6818613485280152,
"repo_name": "tilmanginzel/raytracer",
"id": "8be9a9c1b597caed17b19b44427be2d57477b12a",
"size"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.