repo_name stringlengths 7 65 | path stringlengths 5 185 | copies stringlengths 1 4 | size stringlengths 4 6 | content stringlengths 977 990k | license stringclasses 14
values | hash stringlengths 32 32 | line_mean float64 7.18 99.4 | line_max int64 31 999 | alpha_frac float64 0.25 0.95 | ratio float64 1.5 7.84 | autogenerated bool 1
class | config_or_test bool 2
classes | has_no_keywords bool 2
classes | has_few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
eregs/regulations-parser | regparser/tree/xml_parser/us_code.py | 3 | 2825 | import re
import six
from regparser.tree.depth import markers as mtypes
from regparser.tree.depth import optional_rules
from regparser.tree.struct import Node
from regparser.tree.xml_parser import paragraph_processor, tree_utils
class USCodeParagraphMatcher(paragraph_processor.BaseMatcher):
"""Convert a paragra... | cc0-1.0 | eb3ea576b663e34d02baa3e97509e1a0 | 38.788732 | 77 | 0.644956 | 4.058908 | false | false | false | false |
eregs/regulations-parser | regparser/tree/xml_parser/xml_wrapper.py | 3 | 1852 | from copy import deepcopy
import six
from lxml import etree
from regparser import plugins
from regparser.tree.xml_parser.preprocessors import replace_html_entities
class XMLWrapper(object):
"""Wrapper around XML which provides a consistent interface shared by both
Notices and Annual editions of XML"""
d... | cc0-1.0 | 586efc2d566b19950872523dd7561cd9 | 36.04 | 78 | 0.649028 | 4.287037 | false | false | false | false |
eregs/regulations-parser | interpparser/preprocessors.py | 2 | 1307 | from regparser.tree.gpo_cfr import appendices
_CONTAINS_SUPPLEMENT = "contains(., 'Supplement I')"
_SUPPLEMENT_HD = "//REGTEXT//HD[@SOURCE='HD1' and {0}]".format(
_CONTAINS_SUPPLEMENT)
_SUPPLEMENT_AMD_OR_P = "./AMDPAR[{0}]|./P[{0}]".format(_CONTAINS_SUPPLEMENT)
def _set_prev_to_amdpar(xml_node):
"""Set the t... | cc0-1.0 | e28b631ab7a382f51b82aa4ca812c02b | 38.606061 | 76 | 0.651875 | 3.119332 | false | false | false | false |
eregs/regulations-parser | regparser/history/annual.py | 2 | 5454 | # -*- coding: utf-8 -*-
import logging
import os
import re
from collections import namedtuple
from datetime import date
import requests
from cached_property import cached_property
from regparser.index.http_cache import http_client
from regparser.tree.xml_parser.xml_wrapper import XMLWrapper
from regparser.web.setting... | cc0-1.0 | 4f3ae5638d97e8f6c30c581268aa903c | 34.16129 | 78 | 0.582569 | 3.789986 | false | false | false | false |
eregs/regulations-parser | regparser/layer/layer.py | 3 | 2855 | import abc
from collections import defaultdict, namedtuple
import six
SearchReplace = namedtuple('SearchReplace',
['text', 'locations', 'representative'])
class Layer(six.with_metaclass(abc.ABCMeta)):
"""Base class for all of the Layer generators. Defines the interface they
must i... | cc0-1.0 | af4147f808b958e7645a5ff380be0b08 | 36.565789 | 79 | 0.615412 | 4.440124 | false | false | false | false |
eregs/regulations-parser | regparser/notice/preamble.py | 3 | 5888 | import re
from collections import OrderedDict
from copy import deepcopy
from itertools import takewhile
from lxml import etree
from regparser.tree.depth import heuristics
from regparser.tree.depth.derive import markers as mtypes
from regparser.tree.struct import Node
from regparser.tree.xml_parser.flatsubtree_process... | cc0-1.0 | a88dd666076aa8ce250fd21d448ca0c2 | 43.270677 | 79 | 0.628057 | 3.866054 | false | false | false | false |
noisyboiler/wampy | wampy/transports/websocket/frames.py | 1 | 15187 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import array
import logging
import os
import struct
from struct import pack, unpack_from
from wampy.errors import Webso... | mpl-2.0 | 9734a38295e989391c16584d084d7f03 | 38.141753 | 79 | 0.531441 | 4.130269 | false | false | false | false |
noisyboiler/wampy | wampy/messages/event.py | 1 | 1383 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
class Event(object):
""" When a Subscriber_is deemed to be a receiver, the Broker sends
the Subscriber an "EVEN... | mpl-2.0 | 47835d497352a2fb5f7248d12eaaed61 | 29.733333 | 71 | 0.628344 | 3.831025 | false | false | false | false |
noisyboiler/wampy | wampy/messages/publish.py | 1 | 1025 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import random
class Publish(object):
""" Send a PUBLISH message to the Router.
Message is of the format ``[PU... | mpl-2.0 | 33978fad2586d7282e30198b75d7ff1e | 26.702703 | 70 | 0.580488 | 3.621908 | false | false | false | false |
noisyboiler/wampy | wampy/roles/callee.py | 1 | 1138 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import logging
import types
from functools import partial
logger = logging.getLogger(__name__)
class RegisterProcedu... | mpl-2.0 | 3a93fd4464fc375e3fed3505b0e206b6 | 31.514286 | 75 | 0.661687 | 4.262172 | false | false | false | false |
modoboa/modoboa | modoboa/core/management/commands/cleanlogs.py | 2 | 1344 | import datetime
import logging
from django.core.management.base import BaseCommand
from django.utils import timezone
from modoboa.core.models import Log
from modoboa.parameters import tools as param_tools
class Command(BaseCommand):
"""Command class."""
help = "Log table cleanup" # NOQA:A003
def add_... | isc | 81c8b7cf9451f901b45e8759eb830846 | 31.780488 | 78 | 0.63244 | 4.160991 | false | false | false | false |
modoboa/modoboa | modoboa/relaydomains/api/v1/serializers.py | 2 | 2397 | """RelayDomain serializers."""
import json
from django.utils.translation import ugettext as _
from rest_framework import serializers
from modoboa.admin import models as admin_models
from modoboa.transport import backends as tr_backends, models as tr_models
class TransportSerializer(serializers.ModelSerializer):
... | isc | ed80a680c7d41f9486c97e37b54b9906 | 32.760563 | 78 | 0.61577 | 4.488764 | false | false | false | false |
modoboa/modoboa | modoboa/admin/migrations/0006_auto_20161104_1900.py | 2 | 2194 | # Generated by Django 1.9.5 on 2016-11-04 18:00
from django.db import migrations, models
import django.utils.timezone
def move_dates(apps, schema_editor):
"""Move dates to models."""
Domain = apps.get_model("admin", "Domain")
DomainAlias = apps.get_model("admin", "DomainAlias")
Mailbox = apps.get_mode... | isc | 604805c2b29e5f9c1cb3e50550511912 | 31.746269 | 74 | 0.584777 | 4.486708 | false | false | false | false |
modoboa/modoboa | modoboa/admin/models/base.py | 1 | 2189 | """Base admin models."""
from django.contrib.contenttypes.fields import GenericRelation
from django.db import models
from django.utils import timezone
from modoboa.core import models as core_models
from modoboa.lib.permissions import (
grant_access_to_object, ungrant_access_to_object
)
class AdminObjectManager(... | isc | e8c05afd708d06c8c1cde005ac1bd9f6 | 28.986301 | 88 | 0.652353 | 4.145833 | false | false | false | false |
modoboa/modoboa | modoboa/admin/api/v2/viewsets.py | 1 | 13125 | """Admin API v2 viewsets."""
from django.utils.translation import ugettext as _
from django.contrib.contenttypes.models import ContentType
from django_filters import rest_framework as dj_filters
from drf_spectacular.utils import extend_schema, extend_schema_view
from rest_framework import (
filters, mixins, pars... | isc | 8bc2ed07f5392f9666a7683870758673 | 37.377193 | 81 | 0.636038 | 4.408801 | false | false | false | false |
modoboa/modoboa | modoboa/core/api/v1/viewsets.py | 2 | 2930 | """Core API viewsets."""
from django.utils.translation import ugettext as _
import django_otp
from django_otp.plugins.otp_static.models import StaticDevice, StaticToken
from django_otp.plugins.otp_totp.models import TOTPDevice
from rest_framework import permissions, response, viewsets
from rest_framework.decorators i... | isc | 2fcc25422f5e51cb628e0855777f882a | 36.564103 | 76 | 0.640614 | 3.997271 | false | false | false | false |
modoboa/modoboa | modoboa/core/forms.py | 2 | 5616 | """Core forms."""
import oath
from django import forms
from django.contrib.auth import (
forms as auth_forms, get_user_model, password_validation
)
from django.db.models import Q
from django.utils.translation import ugettext as _, ugettext_lazy
import django_otp
from modoboa.core.models import User
from modoboa... | isc | fe6d978c37cb940f833747ecfabd461a | 33.243902 | 78 | 0.624644 | 4.172363 | false | false | false | false |
modoboa/modoboa | modoboa/dnstools/tests.py | 2 | 8125 | """App related tests."""
from unittest import mock
from django.test import SimpleTestCase
from django.urls import reverse
from django.utils import timezone
from dns.rdtypes.ANY.TXT import TXT
from modoboa.admin import factories as admin_factories
from modoboa.admin import models as admin_models
from modoboa.lib.tes... | isc | 2d97343a2057ceaf7842d37e685f007d | 35.931818 | 79 | 0.608985 | 3.170113 | false | true | false | false |
modoboa/modoboa | modoboa/core/tests/test_ldap.py | 2 | 5494 | """Tests for core application."""
from unittest import skipIf
from django.conf import settings
from django.test import override_settings
from django.urls import reverse
from django.utils.functional import cached_property
from modoboa.lib import exceptions
from modoboa.lib.tests import NO_LDAP, ModoTestCase
from .. i... | isc | 5e00caa7561069009cf08ac26bde40f6 | 34.908497 | 79 | 0.633418 | 4.155825 | false | true | false | false |
csirtgadgets/bearded-avenger | cif/httpd/views/feed/ipv4.py | 1 | 1552 | import pytricia
import ipaddress
import sys
PERM_WHITELIST = [
"0.0.0.0/8",
"10.0.0.0/8",
"127.0.0.0/8",
"192.168.0.0/16",
"169.254.0.0/16",
"192.0.2.0/24",
"224.0.0.0/4",
"240.0.0.0/5",
"248.0.0.0/5",
]
LARGEST_PREFIX = '8'
def _normalize(i):
bits = i.split('.')
rv = []... | mpl-2.0 | 210a44158987ad884c0847013c5cc2d7 | 21.492754 | 101 | 0.47616 | 3.281184 | false | false | false | false |
csirtgadgets/bearded-avenger | cif/httpd/views/indicators.py | 1 | 4680 | from ..common import pull_token, jsonify_success, jsonify_unauth, jsonify_unknown, compress, response_compress, \
VALID_FILTERS, jsonify_busy
from flask.views import MethodView
from flask import request, current_app
from cifsdk.client.zeromq import ZMQ as Client
from cifsdk.client.dummy import Dummy as DummyClient
... | mpl-2.0 | 99c94aae22a37ae1206e07dba2301e3f | 33.925373 | 116 | 0.605342 | 4.325323 | false | false | false | false |
csirtgadgets/bearded-avenger | cif/store/zelasticsearch/indicator.py | 1 | 15288 | from elasticsearch_dsl import Index
from elasticsearch import helpers
import elasticsearch.exceptions
from elasticsearch_dsl.connections import connections
from cif.store.indicator_plugin import IndicatorManagerPlugin
from cifsdk.exceptions import AuthError, CIFException
from datetime import datetime, timedelta
from ci... | mpl-2.0 | f51ec1badd41f84a96e295dc704d72d2 | 32.452954 | 122 | 0.483582 | 4.584108 | false | false | false | false |
cdr-stats/cdr-stats | cdr_stats/apirest/view_voip_rate.py | 3 | 3905 | #
# CDR-Stats License
# http://www.cdr-stats.org
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2011-2015 Star2Billing S.L.
#
# The Initial Develope... | mpl-2.0 | 79f931e81fb19b70c66da47ab82d7983 | 35.495327 | 113 | 0.596159 | 3.964467 | false | false | false | false |
bitmovin/bitmovin-python | examples/encoding/create_per_title_encoding_dash_hls_cenc_fairplay.py | 1 | 21397 | from bitmovin import S3Input, S3Output, Encoding, StreamInput, AACCodecConfiguration, Stream, Bitmovin, CloudRegion, \
EncoderVersion, SelectionMode, H264Profile, FMP4Muxing, TSMuxing, EncodingOutput, \
MuxingStream, H264Level, EncodingMode, StartEncodingRequest, Condition, H264CodecConfiguration, StreamMode, \... | unlicense | e795751c24c80a57cd44391e56fb80a2 | 53.032828 | 120 | 0.578539 | 4.052462 | false | true | false | false |
bitmovin/bitmovin-python | bitmovin/services/encodings/stream_service.py | 1 | 1979 | from bitmovin.errors import MissingArgumentError
from bitmovin.resources.models import Stream as StreamResource
from .burn_in_srt_subtitle_service import BurnInSrtSubtitleService
from .thumbnail_service import ThumbnailService
from .sprite_service import SpriteService
from .stream_filter_service import StreamFilterServ... | unlicense | 6adcb6c5ffb2643174be5028effd4c7d | 43.977273 | 109 | 0.717534 | 3.712946 | false | false | false | false |
bitmovin/bitmovin-python | examples/encoding/create_simple_encoding.py | 1 | 11824 | import datetime
from bitmovin import Bitmovin, Encoding, HTTPSInput, S3Output, H264CodecConfiguration, \
AACCodecConfiguration, H264Profile, StreamInput, SelectionMode, Stream, EncodingOutput, ACLEntry, ACLPermission, \
FMP4Muxing, MuxingStream, CloudRegion, DashManifest, FMP4Representation, FMP4RepresentationT... | unlicense | 6d71e0c9f507e86094c370bb59a170d0 | 62.229947 | 120 | 0.506174 | 4.679066 | false | true | false | false |
bitmovin/bitmovin-python | bitmovin/resources/models/encodings/muxings/ts_muxing.py | 1 | 1782 | from .muxing import Muxing
class TSMuxing(Muxing):
def __init__(self, streams, segment_length, segment_naming=None, outputs=None, id_=None, custom_data=None,
name=None, description=None, avg_bitrate=None, max_bitrate=None, min_bitrate=None, ignored_by=None,
stream_conditions_mod... | unlicense | 85ab286092150fc45985894905ec70e3 | 48.5 | 119 | 0.566779 | 4.335766 | false | false | false | false |
bitmovin/bitmovin-python | bitmovin/services/encodings/fmp4_drm_service.py | 1 | 1189 | from .drm_service import DRMService
from .fairplay_drm_service import FairPlayDRM
from .widevine_drm_service import WidevineDRM
from .playready_drm_service import PlayReadyDRM
from .primetime_drm_service import PrimeTimeDRM
from .marlin_drm_service import MarlinDRM
from .clearkey_drm_service import ClearKeyDRM
from .ce... | unlicense | 0500eb9aa65add848e31a1554efe8b1f | 50.695652 | 100 | 0.751892 | 2.844498 | false | false | false | false |
bitmovin/bitmovin-python | bitmovin/resources/models/encodings/drms/playready_drm.py | 1 | 3411 | from .drm import DRM
from bitmovin.errors import InvalidTypeError
from bitmovin.resources.enums import PlayReadyMethod
from bitmovin.utils import Serializable
from .playready_drm_additional_information import PlayReadyDRMAdditionalInformation
class PlayReadyDRM(DRM, Serializable):
def __init__(self, key_seed=Non... | unlicense | 5d397b2f493f507968ade6ca9316c92e | 37.761364 | 120 | 0.639109 | 4.395619 | false | false | false | false |
bitmovin/bitmovin-python | tests/bitmovin/services/manifests/smooth/mp4_representation_tests.py | 1 | 13675 | import unittest
import uuid
from bitmovin import Bitmovin, ACLEntry, ACLPermission, EncodingOutput, Encoding, \
Stream, StreamInput, MuxingStream, MP4Muxing, AbstractMP4Representation, SmoothManifest, MP4Representation
from tests.bitmovin import BitmovinTestCase
class MP4RepresentationTests(BitmovinTestCase):
... | unlicense | b0f40b755a3295950ad646e7f1f59845 | 51.194656 | 120 | 0.690311 | 4.258798 | false | false | false | false |
bitmovin/bitmovin-python | bitmovin/resources/models/encodings/muxings/webm_muxing.py | 1 | 1711 | from .muxing import Muxing
class WebMMuxing(Muxing):
def __init__(self, streams, segment_length, segment_naming=None, init_segment_name=None, outputs=None,
id_=None, custom_data=None, name=None, description=None, ignored_by=None, stream_conditions_mode=None):
super().__init__(id_=id_, c... | unlicense | fd86792814b75fd8055db72e0e889e73 | 46.527778 | 120 | 0.565167 | 4.432642 | false | false | false | false |
bitmovin/bitmovin-python | bitmovin/resources/models/filters/audio_mix_source_channel.py | 1 | 1514 | from bitmovin.errors import InvalidTypeError
from bitmovin.resources.enums import AudioMixFilterChannelType
from bitmovin.utils import Serializable
class AudioMixSourceChannel(Serializable):
def __init__(self, channel_type, channel_number, gain=1.0):
super().__init__()
self._channel_type = None
... | unlicense | 49fabcf70c2a61f11f89c67d67e5faa1 | 34.209302 | 118 | 0.648613 | 4.21727 | false | false | false | false |
bitmovin/bitmovin-python | bitmovin/services/manifests/smooth_content_protection_service.py | 1 | 1726 | from bitmovin.resources import SmoothContentProtection
from bitmovin.errors import MissingArgumentError, FunctionalityNotAvailableError
from bitmovin.services.rest_service import RestService
class SmoothContentProtectionService(RestService):
BASE_ENDPOINT_URL = 'encoding/manifests/smooth/{manifest_id}/contentprot... | unlicense | 60a66bed0737dca66eb302981a943037 | 43.25641 | 114 | 0.698146 | 4.013953 | false | false | false | false |
bitmovin/bitmovin-python | tests/bitmovin/services/outputs/sftp_output_service_tests.py | 1 | 6876 | import unittest
import json
from bitmovin import Bitmovin, Response, SFTPOutput, FTPTransferVersion
from bitmovin.errors import BitmovinApiError
from tests.bitmovin import BitmovinTestCase
class SFTPOutputTests(BitmovinTestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
@classmetho... | unlicense | 0b5986a0fafc44393ad0122261b60893 | 45.147651 | 115 | 0.705934 | 4.02812 | false | true | false | false |
bitmovin/bitmovin-python | bitmovin/resources/response_error_data_detail.py | 1 | 1462 | from bitmovin.errors import InvalidTypeError
from .resource import Resource
from .link import Link
class ResponseErrorDataDetail(Resource):
def __init__(self, timestamp, type_, text, field, links):
super().__init__()
self._links = None # to suppress variable declared outside of __init__ warning
... | unlicense | 16bfbe2be6bd9e23c55b3a70b6761f57 | 30.782609 | 111 | 0.599863 | 4.225434 | false | false | false | false |
bitmovin/bitmovin-python | bitmovin/resources/models/manifests/smooth/mp4_representation.py | 1 | 1420 | from .abstract_mp4_representation import AbstractMP4Representation
class MP4Representation(AbstractMP4Representation):
def __init__(self, encoding_id, muxing_id, media_file, language=None, track_name=None, id_=None, custom_data=None):
super().__init__(id_=id_, custom_data=custom_data, encoding_id=encodin... | unlicense | ba16789692ce01f6c8dc8bf1653a84ea | 49.714286 | 119 | 0.573239 | 4.781145 | false | false | false | false |
bitmovin/bitmovin-python | bitmovin/resources/models/manifests/hls/audio_media.py | 1 | 2318 | from .abstract_standard_media import AbstractStandardMedia
class AudioMedia(AbstractStandardMedia):
def __init__(self, name, group_id, segment_path, encoding_id, stream_id, muxing_id, drm_id=None,
start_segment_number=None, end_segment_number=None, language=None, assoc_language=None,
... | unlicense | 423c33f9e7f19a4193ef162a905ead74 | 51.681818 | 118 | 0.603969 | 4.052448 | false | false | false | false |
bitmovin/bitmovin-python | bitmovin/services/outputs/output_service.py | 1 | 1123 | from bitmovin.bitmovin_object import BitmovinObject
from .s3_output_service import S3
from .gcs_output_service import GCS
from .akamai_netstorage_output_service import AkamaiNetStorage
from .azure_output_service import Azure
from .ftp_output_service import FTP
from .sftp_output_service import SFTP
from .generic_s3_outp... | unlicense | 3ea787cb179a04a4b05fb6e60f4659c9 | 43.92 | 78 | 0.732858 | 3.217765 | false | false | false | false |
mozilla/telemetry-analysis-service | atmo/forms/widgets.py | 1 | 1474 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
from django import forms
from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
... | mpl-2.0 | 4785f772564f632d46fdc2f690a0da83 | 34.095238 | 92 | 0.645862 | 3.973046 | false | false | false | false |
mozilla/telemetry-analysis-service | atmo/jobs/migrations/0002_auto_20161017_0913.py | 1 | 1301 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.10 on 2016-10-17 09:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("jobs", "0001_initial")]
operations = [
migrations.AlterField(
model_name="sparkjob",
name="interval_in_ho... | mpl-2.0 | e97ef9dc3a9578108c9d180e4191759f | 32.358974 | 97 | 0.470407 | 5.062257 | false | false | false | false |
mozilla/telemetry-analysis-service | tests/clusters/test_tasks.py | 1 | 8245 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
from datetime import timedelta
from django.conf import settings
from atmo.clusters import models, tasks
def test_deac... | mpl-2.0 | f224945f0f69f033b0ed03799866c71b | 34.085106 | 101 | 0.616616 | 3.858212 | false | false | false | false |
mozilla/telemetry-analysis-service | atmo/clusters/tasks.py | 1 | 5239 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
from datetime import timedelta
import mail_builder
from botocore.exceptions import ClientError
from celery.utils.log imp... | mpl-2.0 | cd6ec65489208990541a991e56a8c969 | 37.807407 | 85 | 0.628937 | 4.516379 | false | false | false | false |
mitre/multiscanner | multiscanner/modules/Metadata/flarefloss.py | 2 | 2257 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import division, absolute_import, with_statement, print_function, unicode_literals
import os
import subpr... | mpl-2.0 | e4ea1656407a84679cee7ce042995555 | 26.864198 | 98 | 0.576872 | 3.640323 | false | false | false | false |
mitre/multiscanner | multiscanner/modules/Signature/YaraScan.py | 2 | 3515 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import division, absolute_import, with_statement, print_function, unicode_literals
import os
import time... | mpl-2.0 | 1c728654712c63264e6a5827c40e6eb1 | 29.301724 | 120 | 0.528876 | 3.9099 | false | false | false | false |
mozilla/build-relengapi | relengapi/blueprints/auth/test_auth.py | 3 | 1039 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import json
from nose.tools import eq_
from relengapi.lib.permissions import p... | mpl-2.0 | 9f1961f0829f43d1d6b738c91aa3749a | 28.685714 | 71 | 0.698749 | 3.36246 | false | true | false | false |
mozilla/build-relengapi | relengapi/blueprints/archiver/__init__.py | 1 | 9767 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import datetime
from random import randint
import sqlalchemy as sa
import struc... | mpl-2.0 | b4de6e75bf5cc14447d7e908afc63b2f | 45.070755 | 100 | 0.675847 | 3.773957 | false | false | false | false |
mozilla/build-relengapi | relengapi/blueprints/mapper/__init__.py | 1 | 13898 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import calendar
import re
import time
import dateutil.parser
import sqlalchemy ... | mpl-2.0 | a458146aa54ab09b65a4afe459fe9100 | 36.663957 | 94 | 0.638365 | 3.758248 | false | false | false | false |
librosa/librosa | docs/examples/plot_chroma.py | 2 | 7136 | # coding: utf-8
"""
===================================
Enhanced chroma and chroma variants
===================================
This notebook demonstrates a variety of techniques for enhancing chroma features and
also, introduces chroma variants implemented in librosa.
"""
##########################################... | isc | 30502d8965b8a21a201c411231bd7030 | 39.539773 | 188 | 0.631395 | 3.042644 | false | false | false | false |
librosa/librosa | scripts/create_intervals.py | 1 | 2095 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# CREATED:2022-08-11 07:26:21 by Brian McFee <brian.mcfee@nyu.edu>
"""Construct the interval cache for just intonation systems.
This creates the data file intervals.json, which maps truncated floating point
representations of intervals to their prime factorizations.
Thi... | isc | 9c3908deeaeff7a3e072572a456bbc21 | 24.240964 | 78 | 0.608592 | 3.521008 | false | false | false | false |
cmusatyalab/opendiamond | opendiamond/dataretriever/diamond_store.py | 1 | 4494 | #
# The OpenDiamond Platform for Interactive Search
#
# Copyright (c) 2009-2018 Carnegie Mellon University
# All rights reserved.
#
# This software is distributed under the terms of the Eclipse Public
# License, Version 1.0 which can be found in the file named LICENSE.
# ANY USE, REPRODUCTION OR DISTRIBUTION OF T... | epl-1.0 | 61603e0df04e468098be76caa0e9a646 | 30.208333 | 84 | 0.609034 | 3.674571 | false | false | false | false |
cmusatyalab/opendiamond | opendiamond/scopeserver/flickr/views.py | 1 | 1909 | #
# The OpenDiamond Platform for Interactive Search
#
# Copyright (c) 2009-2019 Carnegie Mellon University
# All rights reserved.
#
# This software is distributed under the terms of the Eclipse Public
# License, Version 1.0 which can be found in the file named LICENSE.
# ANY USE, REPRODUCTION OR DISTRIBUTION OF T... | epl-1.0 | 2ba9f0cbd0d98c26f27173808db7e218 | 31.355932 | 83 | 0.618649 | 3.787698 | false | false | false | false |
cmusatyalab/opendiamond | opendiamond/blaster/__init__.py | 1 | 4788 | #
# The OpenDiamond Platform for Interactive Search
#
# Copyright (c) 2012 Carnegie Mellon University
# All rights reserved.
#
# This software is distributed under the terms of the Eclipse Public
# License, Version 1.0 which can be found in the file named LICENSE.
# ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS S... | epl-1.0 | 6b8db764ba21aae233b982b74ef65cf6 | 36.116279 | 78 | 0.637009 | 3.870655 | false | false | false | false |
cmusatyalab/opendiamond | opendiamond/filter/__init__.py | 1 | 21609 | #
# The OpenDiamond Platform for Interactive Search
#
# Copyright (c) 2011-2018 Carnegie Mellon University
# All rights reserved.
#
# This software is distributed under the terms of the Eclipse Public
# License, Version 1.0 which can be found in the file named LICENSE.
# ANY USE, REPRODUCTION OR DISTRIBUTION OF T... | epl-1.0 | 52abbf5bb87866a0238892f9eaa56244 | 36.515625 | 134 | 0.578509 | 4.268023 | false | false | false | false |
cmusatyalab/opendiamond | opendiamond/server/listen.py | 1 | 9733 | #
# The OpenDiamond Platform for Interactive Search
#
# Copyright (c) 2011-2018 Carnegie Mellon University
# All rights reserved.
#
# This software is distributed under the terms of the Eclipse Public
# License, Version 1.0 which can be found in the file named LICENSE.
# ANY USE, REPRODUCTION OR DISTRIBUTION OF T... | epl-1.0 | 9ce6aaff174c62b067251b1f145aa982 | 36.007605 | 79 | 0.562725 | 4.422081 | false | false | false | false |
eregs/regulations-site | regulations/views/sidebar.py | 4 | 1190 | from importlib import import_module
import six
from django.conf import settings
from django.views.generic.base import TemplateView
from regulations.generator import api_reader
class SideBarView(TemplateView):
""" View for handling the right-side sidebar """
template_name = 'regulations/sidebar.html'
# c... | cc0-1.0 | 5705f09ee43b4eb1b21c90dd1883fe05 | 34 | 74 | 0.642017 | 4.204947 | false | false | false | false |
eregs/regulations-site | regulations/management/commands/eregs_cache.py | 2 | 4376 | from BeautifulSoup import BeautifulSoup
import requests
import threading
import sys
import time
from six.moves.urllib_parse import urlparse
class EregsCache():
@staticmethod
def write(msg):
sys.stdout.write(msg + "\n")
@staticmethod
def write_error(msg):
sys.stderr.write(msg + "\n")... | cc0-1.0 | 90a3faf81bfa47943f91c237bf1ab68f | 31.902256 | 78 | 0.508227 | 4.38477 | false | false | false | false |
eregs/regulations-site | regulations/tests/html_builder_test.py | 2 | 10765 | # -*- coding: utf-8 -*-
from unittest import TestCase
from regulations.generator.html_builder import (
CFRChangeHTMLBuilder, CFRHTMLBuilder, HTMLBuilder, PreambleHTMLBuilder)
from regulations.generator.layers.diff_applier import DiffApplier
from regulations.generator.layers.internal_citation import (
InternalC... | cc0-1.0 | d676b101eac3c1d8f35e66064453aa2f | 35.726962 | 77 | 0.526531 | 3.65896 | false | true | false | false |
eregs/regulations-site | regulations/views/notice_home.py | 4 | 1559 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from operator import itemgetter
import logging
from django.http import Http404
from django.template.response import TemplateResponse
from django.views.generic.base import View
from regulations.generator.api_reader import ApiReader
from regulations.vie... | cc0-1.0 | 7bd87b719bb9e11c2a9d31b0dbbd0c5b | 30.18 | 79 | 0.614496 | 4.531977 | false | false | false | false |
eregs/regulations-site | regulations/settings/base.py | 2 | 9029 | import os
from os.path import join, abspath, dirname
import tempfile
from distutils.spawn import find_executable
from django.utils.crypto import get_random_string
here = lambda *x: join(abspath(dirname(__file__)), *x)
PROJECT_ROOT = here("..", "..")
root = lambda *x: join(abspath(PROJECT_ROOT), *x)
DEBUG = True
AD... | cc0-1.0 | d821b30062456a22f16bf0b0b28b8113 | 31.952555 | 79 | 0.671392 | 3.597211 | false | false | false | false |
eregs/regulations-site | regulations/urls.py | 2 | 8520 | from django.conf.urls import url
from regulations.url_caches import daily_cache, lt_cache
from regulations.views.about import about
from regulations.views.chrome_breakaway import ChromeSXSView
from regulations.views.chrome import (
ChromeView, ChromeLandingView,
ChromeSearchView,
ChromeSubterpView)
from re... | cc0-1.0 | ad6c661d95161fa91db2ecd5cad8e46c | 45.813187 | 79 | 0.65892 | 3.368921 | false | false | false | false |
eregs/regulations-site | notice_comment/views.py | 2 | 7914 | import os
import json
import time
import logging
import celery
from django.conf import settings
from django.core.cache import caches
from django.shortcuts import redirect
from django.http import Http404, JsonResponse
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_... | cc0-1.0 | 29b2cc2c8c25d90a7fda80fca5fce0b6 | 34.648649 | 79 | 0.629644 | 4.064715 | false | false | false | false |
odlgroup/odl | odl/tomo/analytic/filtered_back_projection.py | 2 | 21537 | # coding: utf-8
# Copyright 2014-2019 The ODL contributors
#
# This file is part of ODL.
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at https://mozilla.org/MPL/2.0/.
from __future__ import print... | mpl-2.0 | 3151f4359e19cd99fe30493705c087be | 35.939966 | 79 | 0.616688 | 3.629255 | false | false | false | false |
odlgroup/odl | odl/contrib/datasets/ct/fips.py | 2 | 4207 | # Copyright 2014-2017 The ODL contributors
#
# This file is part of ODL.
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at https://mozilla.org/MPL/2.0/.
#
# The data is licensed under a
# Creative C... | mpl-2.0 | d18469e0579512b2d84bf28972d8f0b4 | 26.496732 | 79 | 0.63228 | 3.420325 | false | false | false | false |
odlgroup/odl | odl/test/operator/oputils_test.py | 1 | 6918 | # Copyright 2014-2017 The ODL contributors
#
# This file is part of ODL.
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at https://mozilla.org/MPL/2.0/.
from __future__ import division
import numpy... | mpl-2.0 | 0892c907be5f4b0e34b4bb7b50863eef | 31.176744 | 79 | 0.613472 | 3.337192 | false | true | false | false |
odlgroup/odl | examples/tomo/backends/astra_performance_cuda_cone_3d_cg.py | 2 | 3351 | """Performance example of running native ASTRA vs using ODL for reconstruction.
In this example, a 256x256x256 image is reconstructed using the Conjugate
Gradient Least Squares method on the GPU.
In general, pure ASTRA is faster than ODL since it does not need to perform
any copies and all arithmetic is performed on ... | mpl-2.0 | e0810c2dc95000208325afb0b71c67b3 | 29.743119 | 79 | 0.695016 | 3.043597 | false | false | false | false |
odlgroup/odl | examples/space/simple_rn.py | 2 | 4104 | """An example of a very simple space, the space rn.
Including some benchmarks with an optimized version.
"""
import numpy as np
import odl
from odl.space.base_tensors import TensorSpace, Tensor
from odl.util.testutils import timer
class SimpleRn(TensorSpace):
"""The real space R^n, non-optimized implmentation."... | mpl-2.0 | cd6d1fb2ab59aa33ab26b22c5d6bac99 | 28.52518 | 78 | 0.584064 | 3.152074 | false | false | false | false |
odlgroup/odl | odl/solvers/nonsmooth/difference_convex.py | 2 | 8749 | # Copyright 2014-2019 The ODL contributors
#
# This file is part of ODL.
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at https://mozilla.org/MPL/2.0/.
"""Solvers for the optimization of the diffe... | mpl-2.0 | 40872556c64f59295a8a06bec06aba08 | 31.645522 | 91 | 0.59824 | 3.536378 | false | false | false | false |
odlgroup/odl | odl/trafos/backends/pyfftw_bindings.py | 2 | 11456 | # Copyright 2014-2020 The ODL contributors
#
# This file is part of ODL.
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at https://mozilla.org/MPL/2.0/.
"""Bindings to the ``pyFFTW`` back-end for F... | mpl-2.0 | 285da23224144ed015bb2f0feef82b3d | 36.684211 | 79 | 0.604661 | 3.841717 | false | false | false | false |
odlgroup/odl | examples/solvers/pdhg_denoising_ROF_algorithm_comparison.py | 2 | 6272 | """Total variation denoising using PDHG.
Three different algorithms (or variants of PDHG) are compared to solve the
ROF (Rudin-Osher-Fatemi) problem / L2-TV
(ROF) min_{x >= 0} 1/2 ||x - d||_2^2 + lam || |grad(x)| ||_1
Where ``grad`` the spatial gradient and ``d`` is given noisy data.
Algorithms 1 and 2 are tw... | mpl-2.0 | c65c1e53d7f9fb19698795120eb82348 | 27.903226 | 79 | 0.690848 | 2.818876 | false | false | false | false |
odlgroup/odl | examples/solvers/kaczmarz_tomography.py | 2 | 2389 | """Tomography using the `kaczmarz` solver.
Solves the inverse problem
A(x) = g
Where ``A`` is a fan (cone) beam forward projector, ``x`` the result and
``g`` is given data.
In order to solve this using `kaczmarz`'s method, the operator is split into
several sub-operators (each representing a subset of the angl... | mpl-2.0 | b97d4110e37f7dfb0b12d74b1eec4c96 | 28.134146 | 77 | 0.704479 | 3.374294 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/eroprofile.py | 60 | 3218 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse_urlencode
from ..utils import (
ExtractorError,
unescapeHTML
)
class EroProfileIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?eroprofile\.com/m/videos/view/(?P<id>[^/]+)'
... | unlicense | 4507f96378d0cb601810b6812b2b56c0 | 32.873684 | 126 | 0.538222 | 3.555801 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/tv5unis.py | 5 | 4090 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_age_limit,
smuggle_url,
try_get,
)
class TV5UnisBaseIE(InfoExtractor):
_GEO_COUNTRIES = ['CA']
def _real_extract(self, url):
groups = re.match... | unlicense | b7f74821857740dc88367348e351ad45 | 32.677686 | 278 | 0.544049 | 3.031994 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/esri.py | 64 | 2628 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
int_or_none,
parse_filesize,
unified_strdate,
)
class EsriVideoIE(InfoExtractor):
_VALID_URL = r'https?://video\.esri\.com/watch/(?P<id>[0-9]... | unlicense | 6c148ae200411ed468612e70aa79b981 | 34.513514 | 105 | 0.523973 | 3.797688 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/dtube.py | 20 | 2798 | # coding: utf-8
from __future__ import unicode_literals
import json
import re
from socket import timeout
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_iso8601,
)
class DTubeIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?d\.tube/(?:#!/)?v/(?P<uploader_id>[0-9a-z.-]+)/(?... | unlicense | 2f5017e4846e6976e5aeafb8a0734a57 | 32.710843 | 105 | 0.498213 | 3.582586 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/zapiks.py | 12 | 3832 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
parse_duration,
parse_iso8601,
xpath_with_ns,
xpath_text,
int_or_none,
)
class ZapiksIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?zapiks\.(?:fr|com)/(?:(?:[a-z]{2... | unlicense | 61da1a2a5078f4415d9ed4aa7f5929f6 | 34.119266 | 157 | 0.522466 | 3.464253 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/udemy.py | 17 | 19413 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_HTTPError,
compat_kwargs,
compat_str,
compat_urllib_request,
compat_urlparse,
)
from ..utils import (
determine_ext,
extract_attributes,
ExtractorError,
float_or_none,
... | unlicense | af2a196321d2b1e334d708c53563a697 | 39.359667 | 149 | 0.506362 | 3.959413 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/theplatform.py | 5 | 17541 | # coding: utf-8
from __future__ import unicode_literals
import re
import time
import hmac
import binascii
import hashlib
from .once import OnceIE
from .adobepass import AdobePassIE
from ..compat import (
compat_parse_qs,
compat_urllib_parse_urlparse,
)
from ..utils import (
determine_ext,
ExtractorEr... | unlicense | ee058a1dd651ffa7f7ec88d292f28b19 | 41.364734 | 188 | 0.549803 | 3.48896 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/giantbomb.py | 11 | 3056 | from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
qualities,
unescapeHTML,
)
class GiantBombIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?giantbomb\.com/(?:videos|shows)/(?P<display_id>[^/]+)/(... | unlicense | 24516d336165d27f9695db422db1a67f | 32.955556 | 108 | 0.525851 | 3.553488 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/svt.py | 1 | 14831 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
determine_ext,
dict_get,
int_or_none,
unified_timestamp,
str_or_none,
strip_or_none,
try_get,
)
class SVTBaseIE(InfoExtractor):
_G... | unlicense | 4d1dbe351871c83d7707270b9f255cdd | 34.629808 | 133 | 0.50587 | 3.466324 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/bandcamp.py | 3 | 14363 | # coding: utf-8
from __future__ import unicode_literals
import random
import re
import time
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ExtractorError,
float_or_none,
int_or_none,
KNOWN_EXTENSIONS,
parse_filesize,
str_or_none,
try_get,
update... | unlicense | da9df8042f0999e2ba835d980d797351 | 35.892031 | 99 | 0.473416 | 3.857796 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/pladform.py | 28 | 4244 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
determine_ext,
ExtractorError,
int_or_none,
xpath_text,
qualities,
)
class PladformIE(InfoExtractor):
_VALID_URL = r'''(?x)
... | unlicense | bfa65d86c89eb5ef21a2b1364f1d1480 | 32.456 | 113 | 0.482544 | 3.583548 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/appleconnect.py | 51 | 1756 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
str_to_int,
ExtractorError
)
class AppleConnectIE(InfoExtractor):
_VALID_URL = r'https?://itunes\.apple\.com/\w{0,2}/?post/idsa\.(?P<id>[\w-]+)'
_TEST = {
'url': 'https://itunes.app... | unlicense | 8a9f547470c03e553bdf58e366f8c651 | 34.12 | 104 | 0.551253 | 3.319471 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/rte.py | 20 | 6289 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
float_or_none,
parse_iso8601,
str_or_none,
try_get,
unescapeHTML,
url_or_none,
ExtractorError,
)
class RteBaseIE(InfoExtractor):... | unlicense | 75063e1c147552bff16898a8546ccd6a | 36.622754 | 135 | 0.495464 | 3.533746 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/voot.py | 28 | 3560 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
try_get,
unified_timestamp,
)
class VootIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?voot\.com/(?:[^/]+/)+(?P<id>\d+)'
_GEO_COUNTRIES = ['IN']
... | unlicense | 4c00c8f59c483eef73893c0dd284e8c9 | 34.6 | 120 | 0.524438 | 3.556444 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/steam.py | 26 | 5646 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
extract_attributes,
ExtractorError,
get_element_by_class,
js_to_json,
)
class SteamIE(InfoExtractor):
_VALID_URL = r"""(?x)
https?://store\.steampowered\.com/
(agecheck/)... | unlicense | 16c16377c3b7bd951bb7e88ed8896a6b | 36.892617 | 148 | 0.462806 | 4.076534 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/tvanouvelles.py | 68 | 2401 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from .brightcove import BrightcoveNewIE
class TVANouvellesIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?tvanouvelles\.ca/videos/(?P<id>\d+)'
_TEST = {
'url': 'http://www.tvanouvelles.ca/videos/... | unlicense | 621b671affc23f0579da524537dd8998 | 35.8 | 110 | 0.598662 | 3.078507 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/nbc.py | 5 | 20411 | from __future__ import unicode_literals
import base64
import json
import re
from .common import InfoExtractor
from .theplatform import ThePlatformIE
from .adobepass import AdobePassIE
from ..compat import compat_urllib_parse_unquote
from ..utils import (
int_or_none,
parse_duration,
smuggle_url,
try_g... | unlicense | c74e924fba4b4bdd5e88fa6cc1ab445f | 37.878095 | 194 | 0.525354 | 3.333497 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/hbo.py | 15 | 6128 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
xpath_text,
xpath_element,
int_or_none,
parse_duration,
urljoin,
)
class HBOBaseIE(InfoExtractor):
_FORMATS_INFO = {
'pro7': {
'width': 1280,
... | unlicense | 16be25efe65c289644bd339726004cfb | 34.017143 | 101 | 0.431625 | 3.966343 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/footyroom.py | 70 | 1875 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from .streamable import StreamableIE
class FootyRoomIE(InfoExtractor):
_VALID_URL = r'https?://footyroom\.com/matches/(?P<id>\d+)'
_TESTS = [{
'url': 'http://footyroom.com/matches/79922154/hull-city-vs-chelsea/r... | unlicense | 6c8a97c49619fed0444fd3bf96b38997 | 32.482143 | 83 | 0.546133 | 3.690945 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/nexx.py | 13 | 17106 | # coding: utf-8
from __future__ import unicode_literals
import hashlib
import random
import re
import time
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ExtractorError,
int_or_none,
parse_duration,
try_get,
urlencode_postdata,
)
class NexxIE(InfoExtracto... | unlicense | fc969b1a7a27688d84af42c1c3233dc9 | 36.741722 | 118 | 0.480962 | 3.616117 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/sportdeutschland.py | 8 | 2964 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
parse_iso8601,
sanitized_Request,
)
class SportDeutschlandIE(InfoExtractor):
_VALID_URL = r'https?://sportdeutschland\.tv/(?P<sport>[^/?#]+)/(?P<id>[^?#/]+)(?:$|[?#])'
_TESTS = [... | unlicense | 144c821e450604d565f2c733fe0e92a0 | 35.146341 | 127 | 0.524629 | 3.495283 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/usatoday.py | 20 | 2703 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
get_element_by_attribute,
parse_duration,
try_get,
update_url_query,
)
from ..compat import compat_str
class USATodayIE(InfoExtractor):
_VALID_URL = r'https?://(?:ww... | unlicense | f624792cb18eae9bd7c4b173b08f550b | 41.904762 | 154 | 0.596374 | 3.28034 | false | false | false | false |
rbrito/pkg-youtube-dl | youtube_dl/extractor/nosvideo.py | 64 | 2480 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
sanitized_Request,
urlencode_postdata,
xpath_text,
xpath_with_ns,
)
_x = lambda p: xpath_with_ns(p, {'xspf': 'http://xspf.org/ns/0/'})
class NosVideoIE(InfoE... | unlicense | 6d9857e9910e980169fa4390226678fa | 32.066667 | 75 | 0.523387 | 3.497884 | false | false | false | false |
pyeve/cerberus | cerberus/tests/test_rule_…of.py | 3 | 11263 | from pytest import mark
from cerberus import errors
from cerberus.tests import assert_fail, assert_not_has_error, assert_success
@mark.parametrize(
("test_function", "document"),
[
(assert_success, {'field': 5}),
(assert_fail, {'field': -1}),
(assert_fail, {'field': 11}),
],
)
def... | isc | 76faacddbe51576836ba75de8af335a4 | 29.605978 | 88 | 0.447838 | 3.947774 | false | true | false | false |
unitedstates/congress-legislators | scripts/untire.py | 13 | 1156 | #!/usr/bin/env python
# "Un-retire" a Member of Congress: Move a Member of Congress
# from the legislators-historical file to the legislators-current file
# and give the Member a new term.
#
# python unretire.py bioguideID
import sys
import rtyaml
import utils
from collections import OrderedDict
def run():
if len(... | cc0-1.0 | 1022d8829087e216c6070423521d5f66 | 21.25 | 70 | 0.653114 | 2.792271 | false | false | false | false |
unitedstates/congress-legislators | scripts/wikipedia_ids.py | 3 | 5436 | # Scans Wikipedia for pages using the CongBio and CongLinks
# templates, which have Bioguide IDs. Updates the 'wikipedia'
# ID field for matching Members of Congress, and for pages
# using the CongLinks template also updates a variety of
# other ID as found in the template.
import lxml.etree, re, urllib.request, urlli... | cc0-1.0 | 5c8469b48aac0dc20a99a51b91c97747 | 35.979592 | 130 | 0.675681 | 2.998345 | false | false | false | false |
unitedstates/congress-legislators | scripts/utils.py | 1 | 14567 | # Helpful functions for finding data about members and committees
CURRENT_CONGRESS = 115
states = {
'AK': 'Alaska',
'AL': 'Alabama',
'AR': 'Arkansas',
'AS': 'American Samoa',
'AZ': 'Arizona',
'CA': 'California',
'CO': 'Colorado',
'CT': 'Connecticut',
... | cc0-1.0 | 36e5be6c0686b18e595ae90abcf5abc7 | 30.059701 | 103 | 0.617286 | 3.39874 | false | false | false | false |
unitedstates/congress-legislators | scripts/committee_membership.py | 1 | 13819 | #!/usr/bin/env python
# Data Sources:
# House:
# http://clerk.house.gov/xml/lists/MemberData.xml
# Senate:
# https://www.senate.gov/general/committee_membership/committee_memberships_{thomas_id}.xml
# Data Files Updated:
# committee-membership-current.yaml:
# All entries are overwritten except for h... | cc0-1.0 | efe0c23bd7e137d585174efa34ed23ed | 40.247761 | 148 | 0.633232 | 3.36778 | false | false | false | false |
unitedstates/congress-legislators | scripts/export_csv.py | 13 | 2716 | # Converts the specified YAML file to an equivalent-ish CSV file
# (on standard output).
#
# python export_csv.py ../legislators-current.yaml
import sys, csv
from collections import OrderedDict
from utils import yaml_load
def run():
if len(sys.argv) < 2:
print("Usage: python export_csv.py ../legislators-current.... | cc0-1.0 | e9312f24f3a2799e3cf1145dd4b04633 | 29.52809 | 93 | 0.663108 | 3.172897 | false | false | false | false |
unitedstates/congress-legislators | scripts/contact_forms.py | 1 | 2128 | #!/usr/bin/env python
'''Gets contact webform URLs for the intersection of members with bioguide ids
and with correlating contact form steps in unitedstates/contact-congress:
args:
<bioguide_id bioguide_id ...>
A list of bioguide ids to import.
options:
--debug[=True]
Whether or not verbose output should be prin... | cc0-1.0 | cfea34a39238f264346ce1f9dae900d6 | 27.756757 | 109 | 0.672462 | 3.482815 | false | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.