text stringlengths 4 1.02M | meta dict |
|---|---|
import scrapy
import re
from locations.items import GeojsonPointItem
class MokaHouseSpider(scrapy.Spider):
name = 'moka_house'
allowed_domains = ['mokahouse.com']
start_urls = (
'http://mokahouse.com/locations/',
)
def parse(self, response):
links = response.xpath('//div[@c... | {
"content_hash": "39f7ee047bf1576d99def6c76f880b24",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 97,
"avg_line_length": 35.394366197183096,
"alnum_prop": 0.5113410266613609,
"repo_name": "iandees/all-the-places",
"id": "ea909e056f01ab8cd768ad61c1724f98de7416ae",
"size"... |
from pyramid.renderers import render_to_response
from groupdocs.ApiClient import ApiClient
from groupdocs.AsyncApi import AsyncApi
from groupdocs.GroupDocsRequestSigner import GroupDocsRequestSigner
import time
# Checking value on null
def IsNotNull(value):
return value is not None and len(value) > 0
# Sample 1... | {
"content_hash": "b161c4971334f9fdb74cfd81b3031650",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 150,
"avg_line_length": 35.9344262295082,
"alnum_prop": 0.6459854014598541,
"repo_name": "liosha2007/temporary-groupdocs-python-sdk",
"id": "7f16a8e63de7395e9045b928e8c7eae1a... |
from azure.identity import DefaultAzureCredential
from azure.mgmt.apimanagement import ApiManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-apimanagement
# USAGE
python api_management_head_identity_provider.py
Before run the sample, please set the values of the cli... | {
"content_hash": "74f9d52f7a27115e1118447260c006f3",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 156,
"avg_line_length": 33.85294117647059,
"alnum_prop": 0.73501303214596,
"repo_name": "Azure/azure-sdk-for-python",
"id": "d0b20c6dee29f9e9e98b6a0607160541ed6ad7e9",
"siz... |
from django.core.management.base import BaseCommand, CommandError
import os
import csv
import argparse
import re
from .utils import (
ExternalSystemHelper,
ModelFinder,
SupportedFileChecker,
CsvActionFactory)
from nsync.policies import (
BasicSyncPolicy,
OrderedSyncPolicy,
TransactionSyncPol... | {
"content_hash": "734b7e608d3e2905377851d3cebaa7a0",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 78,
"avg_line_length": 33.42727272727273,
"alnum_prop": 0.5863475659505031,
"repo_name": "andrewdodd/django-nsync",
"id": "f20968fb38302ca94ffa14c38ff54c259b2d5d3d",
"size... |
import numpy as np
from coinrun import setup_utils, make
def random_agent(num_envs=1, max_steps=100000):
setup_utils.setup_and_load(use_cmd_line_args=False)
env = make('standard', num_envs=num_envs)
for step in range(max_steps):
acts = np.array([env.action_space.sample() for _ in range(env.num_env... | {
"content_hash": "46382b309c9af6b4100bbb3e06973e55",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 81,
"avg_line_length": 30.125,
"alnum_prop": 0.6286307053941909,
"repo_name": "openai/coinrun",
"id": "5fb93e0fb3662f5203da32b89a371bf2b522a5bd",
"size": "482",
"binary":... |
from dynaconf.vendor.box.box import Box
class SBox(Box):
"""
ShorthandBox (SBox) allows for
property access of `dict` `json` and `yaml`
"""
_protected_keys = dir({}) + ['to_dict', 'to_json', 'to_yaml', 'json', 'yaml', 'from_yaml', 'from_json',
'dict', 'toml', 'from... | {
"content_hash": "54d28ac86e28503424d84fed5d160285",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 107,
"avg_line_length": 23.62857142857143,
"alnum_prop": 0.5392986698911729,
"repo_name": "rochacbruno/dynaconf",
"id": "746f7619a164a8386938cfe28875fe2a9567e077",
"size": ... |
import types
from collections import defaultdict
"""Query filters"""
def _DIRECTION(keys, direction):
if isinstance(keys, types.StringTypes):
return (keys, direction),
elif isinstance(keys, (types.ListType, types.TupleType)):
return tuple([(k, direction) for k in keys])
def ASCENDING(keys):... | {
"content_hash": "98c290281132cffe2cd353861d813dc5",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 89,
"avg_line_length": 27.914285714285715,
"alnum_prop": 0.5820539065165472,
"repo_name": "claytondaley/mongo-async-python-driver",
"id": "bf094413fcae37f8ff4a74f6ca8802d1a9... |
import os
import sys
import argparse
import pandas as pd
# Submit jobs to the cluster
from gscripts.qtools import Submitter
WALLTIME = '2:00:00'
'''
Author: olga
Date created: 7/12/13 9:38 AM
The purpose of this program is to write submitter scripts to perform MISO
analysis on a large amount of files. This script... | {
"content_hash": "73f66bf9694b3320efa92faeb972968e",
"timestamp": "",
"source": "github",
"line_count": 293,
"max_line_length": 112,
"avg_line_length": 39.436860068259385,
"alnum_prop": 0.5007356122890524,
"repo_name": "YeoLab/gscripts",
"id": "cbd851ede3db78b03e39856d43e3abb8ec8e89d0",
"size": "11... |
import numbers, array, itertools, operator, math
from collections import defaultdict
from math import fsum
from .misc import minmax2
from .string import join, format_char
default_number_format = '.3g'
class DistributionTable(object):
def count(self):
return NotImplemented
def __truediv__(self, divisor):
... | {
"content_hash": "5b459668b56e59850beeb70132e6af0b",
"timestamp": "",
"source": "github",
"line_count": 300,
"max_line_length": 106,
"avg_line_length": 25.283333333333335,
"alnum_prop": 0.6729070533948582,
"repo_name": "davidfoerster/schema-matching",
"id": "ab7f056a09a05088a8e397211e8ad75929b9a890",... |
from weibocommon import weibocommon
from factory.supports import htmlstripper
import rootcfg
import re
import time
from factory.supports.parser import parser
from factory.supports.logger import logger
from rootcfg import FOLLOW_URL_PREFIX
from rootcfg import FOLLOW_URL_POSTFIX
from rootcfg import HIS_FOLLOW_PREFIX
fro... | {
"content_hash": "11f71f43e8a7c9fc3bd28cfe4d6344ce",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 109,
"avg_line_length": 29.49404761904762,
"alnum_prop": 0.6359233097880929,
"repo_name": "jwang-share/theysay",
"id": "416d48b50a4b165ea707c0bcd6978b483a06932b",
"size": ... |
import numpy as np
import matplotlib.pyplot as plt
import json
import os.path
class APSTrainingScore:
def __init__(self):
self.filename = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'training_score.json')
with open(self.filename) as json_data:
self.score_dict = json.load(... | {
"content_hash": "fbafb4184ffbe91cd396e8bf2232fe38",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 104,
"avg_line_length": 36.857142857142854,
"alnum_prop": 0.6464254952627045,
"repo_name": "kmunve/APS",
"id": "a6351638300dda20e738a0bf2a992aefd3ee7389",
"size": "2322",
... |
import json
from typing import Any
from cryptography.fernet import InvalidToken as InvalidFernetToken
from sqlalchemy import Boolean, Column, Integer, String, Text
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import synonym
from airflow.models.base import ID_LEN, Base
from airflow.models.c... | {
"content_hash": "709ab2675033c7e5039d84a69b93009c",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 102,
"avg_line_length": 32.6015625,
"alnum_prop": 0.5871075964533908,
"repo_name": "Fokko/incubator-airflow",
"id": "085113ed472a7dda4de9752a3c5c1a2aae4b17b3",
"size": "49... |
from __future__ import unicode_literals, print_function
from .factory import get_api_sync_engine, get_consumer_sync_engine
from .models import APIReference, ConsumerReference, PluginConfigurationReference
def publish_api(client, obj):
obj = get_api_sync_engine().publish(client, obj)
if not obj.enabled:
... | {
"content_hash": "6ee3bd67598a64a8febc4aa045efecf3",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 94,
"avg_line_length": 33.135802469135804,
"alnum_prop": 0.7291356184798807,
"repo_name": "vikingco/django-kong-admin",
"id": "ba65493335d9b5895289cba822209cf8ad972aec",
"s... |
"""
Tools for converting PyPI packages to conda recipes.
"""
from __future__ import absolute_import, division, print_function
import requests
import keyword
import os
import re
import subprocess
import sys
from collections import defaultdict
from os import makedirs, listdir, getcwd, chdir
from os.path import join, i... | {
"content_hash": "7047f92cec04ea3b6deea41d3876a451",
"timestamp": "",
"source": "github",
"line_count": 620,
"max_line_length": 107,
"avg_line_length": 39.30483870967742,
"alnum_prop": 0.5250523205712175,
"repo_name": "tacaswell/conda-build",
"id": "073427205e38d20426d320f80c37c61413ef4e0a",
"size"... |
"""
Copyright 2015-2020 Knights Lab, Regents of the University of Minnesota.
This software is released under the GNU Affero General Public License (AGPL) v3.0 License.
"""
import unittest
import tempfile
import os
import pkg_resources
from shogun.parsers.sam import yield_alignments_from_sam_inf
class TestParsers(u... | {
"content_hash": "a2fa79964b81a3df08f6daafb7c1009b",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 121,
"avg_line_length": 30.37037037037037,
"alnum_prop": 0.7012195121951219,
"repo_name": "knights-lab/NINJA-SHOGUN",
"id": "7b6f59a77702e7300a434d980796ecfcda67b889",
"siz... |
import sys
from hippy.objects.base import W_Object
from hippy.objects.support import _new_binop
from hippy.consts import BINOP_LIST, BINOP_COMPARISON_LIST
from rpython.rlib.rarithmetic import intmask, ovfcheck
from rpython.rlib.rfloat import isnan, isinf, double_to_string, DTSF_CUT_EXP_0
MAX_PRECISION = 500
class W... | {
"content_hash": "3be88ac98e14e4829e5db51c515449f2",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 78,
"avg_line_length": 30.44295302013423,
"alnum_prop": 0.5582010582010583,
"repo_name": "xhava/hippyvm",
"id": "6825523cf209f7f28ef3954230a73a3f8a252f35",
"size": "4536",... |
import logging
log = logging.getLogger(__name__)
import pandas as pd
from atom.api import (Typed, set_default, observe, Enum, Event, Property,
Bool, Dict, Unicode, Atom, List, Value)
from enaml.core.declarative import d_, d_func
from enaml.widgets.api import RawWidget
from enaml.qt.QtCore impor... | {
"content_hash": "e4984e995209f864b564e56b9d887a49",
"timestamp": "",
"source": "github",
"line_count": 661,
"max_line_length": 79,
"avg_line_length": 32.127080181543114,
"alnum_prop": 0.5861273309474477,
"repo_name": "bburan/psiexperiment",
"id": "479cf772e8280708dd6cf514130dc5430af9719e",
"size":... |
"""
dj-stripe Exceptions.
"""
class MultipleSubscriptionException(Exception):
"""Raised when a Customer has multiple Subscriptions and only one is expected."""
pass
class StripeObjectManipulationException(Exception):
"""Raised when an attempt to manipulate a non-standalone stripe object is made not through its ... | {
"content_hash": "1edcd4ee07241456265bc9539af963cd",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 113,
"avg_line_length": 23,
"alnum_prop": 0.7739130434782608,
"repo_name": "kavdev/dj-stripe",
"id": "602e727811032854f4150e781cf98086871531ae",
"size": "345",
"binary": ... |
from __future__ import unicode_literals
import os.path
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from django.test.utils import override_settings
from app_manifest.manifest import (get_app_manifest_from_file,
get_app_manifest_from_strin... | {
"content_hash": "04bdbe4fd53b7293ddc7befe19ccaa21",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 88,
"avg_line_length": 35.71296296296296,
"alnum_prop": 0.6556909515167229,
"repo_name": "JoltLabs/app-manifest",
"id": "78cfe342fbfa89fa02f4198688e04ea3fef010ad",
"size":... |
import os
import jinja2
import sys
import argparse
import pkg_resources
import concurrent.futures
import operator
import re
import shutil
import collections
import stat
import lamnfyc.settings
import lamnfyc.utils
from lamnfyc.logger import (log, start_file_log)
__version__ = pkg_resources.get_distribution('lamnfyc')... | {
"content_hash": "17f165081d91087c1d4ffa400aee0306",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 115,
"avg_line_length": 41.54271356783919,
"alnum_prop": 0.6466674730857627,
"repo_name": "kingbuzzman/lamnfyc",
"id": "99671201f657cdce21d4e78ef4864aea7b887198",
"size": ... |
import copy
import hashlib
import logging
import re
from urllib.parse import parse_qs
from urllib.parse import urlparse
from svtplay_dl.error import ServiceError
from svtplay_dl.fetcher.dash import dashparse
from svtplay_dl.fetcher.hds import hdsparse
from svtplay_dl.fetcher.hls import hlsparse
from svtplay_dl.service... | {
"content_hash": "61b9df08725523c2cfb6d6279054aa6f",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 145,
"avg_line_length": 40.333333333333336,
"alnum_prop": 0.5084175084175084,
"repo_name": "olof/debian-svtplay-dl",
"id": "be4418d052b914e856a667ed7fd8f987d69821b9",
"siz... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "avocado.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is rea... | {
"content_hash": "0969e51b25789fde7092f8dda1102153",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 77,
"avg_line_length": 37.285714285714285,
"alnum_prop": 0.6206896551724138,
"repo_name": "trdwll/avocado",
"id": "9fa0042f890ec79d61b097e8035a0209e04521df",
"size": "805",... |
import socket
import errno
import six
def server_socket(address, backlog=5):
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
server.bind(address)
server.listen(backlog)
server.setblocking(False)
return server
def clien... | {
"content_hash": "2cb11a2abbc33476f2c1a17635f124c8",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 64,
"avg_line_length": 24.75,
"alnum_prop": 0.6681096681096681,
"repo_name": "fifman/sockspy",
"id": "9c3a5d06fd91c9887e9a8e539e9249ae01090860",
"size": "741",
"binary": ... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('recipe_app', '0002_auto_20161013_0418'),
]
operations = [
migrations.RenameField(
model_name='reciperating',
old_name='recipe_name',... | {
"content_hash": "bfa5c21caf08dce16671cb11144e7c4f",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 50,
"avg_line_length": 20.5,
"alnum_prop": 0.5826558265582655,
"repo_name": "mpollachek/Recipe_website_project",
"id": "c7954b24478f83fc4424ce9f33ee6786393afd4b",
"size": "... |
answer1 = widget_inputs["check1"]
answer2 = widget_inputs["check2"]
answer3 = widget_inputs["check3"]
answer4 = widget_inputs["check4"]
is_correct = False
comments = []
def commentizer(new):
if new not in comments:
comments.append(new)
if answer1 == True:
is_correct = True
else:
is_correct = is_c... | {
"content_hash": "d18e91e71fdbc75e1ea59bc1ff841794",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 143,
"avg_line_length": 32.09756097560975,
"alnum_prop": 0.7127659574468085,
"repo_name": "udacity/responsive-images",
"id": "d6a3847fe8faa3f9488df942999caa5dbe6bf994",
"si... |
import copy
import uuid
import io
import itertools
import os
import re
import textwrap
import warnings
import builtins
# THIRD-
from packaging.version import Version
import numpy as np
# LOCAL
from astropy import log
from astropy.io import fits
from . import docstrings
from . import _wcs
from astropy import units as... | {
"content_hash": "7043804f861a927a0ae4590aeb856263",
"timestamp": "",
"source": "github",
"line_count": 3510,
"max_line_length": 153,
"avg_line_length": 37.946438746438744,
"alnum_prop": 0.5385008108595111,
"repo_name": "saimn/astropy",
"id": "c6fa9ce5d136d0056edc0c403af53e609248eaf8",
"size": "134... |
from __future__ import absolute_import
import logging
from django.conf import settings
from openstack_dashboard.api import base
from openstack_dashboard.api import neutron
from gbpclient.v2_0 import client as gbp_client
LOG = logging.getLogger(__name__)
def gbpclient(request):
insecure = getattr(settings, 'O... | {
"content_hash": "5b35d318716554c60810ce218a8ae78f",
"timestamp": "",
"source": "github",
"line_count": 461,
"max_line_length": 79,
"avg_line_length": 30.77006507592191,
"alnum_prop": 0.6979203383856186,
"repo_name": "promptworks/group-based-policy-ui",
"id": "ceee0fa09467fa9641df265cc142b8e96c7bd7d5... |
from django.forms import widgets as django_widgets
from django.template.loader import render_to_string
from leaflet.forms.widgets import LeafletWidget
from .helpers import wkt_to_geom
from .settings import API_SRID
class MapWidget(LeafletWidget):
geometry_field_class = 'MapEntity.GeometryField'
def render(s... | {
"content_hash": "0c34e97067318a7892b43dafc53a5c14",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 73,
"avg_line_length": 33.8,
"alnum_prop": 0.6561472715318869,
"repo_name": "makinacorpus/django-mapentity",
"id": "19bf3d090fae8eacb5104d1a34ee518e88d969f3",
"size": "1521... |
from __future__ import print_function
import curses
import sys
import signal
import processInput
import usageStrings
import output
import logger
from charCodeMapping import CODE_TO_CHAR
from colorPrinter import ColorPrinter
def signal_handler(signal, frame):
# from http://stackoverflow.com/a/1112350/948126
#... | {
"content_hash": "2ff0aabf97f93d92a936cebf2e0a4014",
"timestamp": "",
"source": "github",
"line_count": 540,
"max_line_length": 101,
"avg_line_length": 33.57962962962963,
"alnum_prop": 0.6001764738322396,
"repo_name": "pallavagarwal07/PathPicker",
"id": "53f473989952008d2ff8e1f34294d0764db9e64d",
"... |
from typing import Any, Callable, Dict, Optional, TypeVar
from msrest import Serializer
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpR... | {
"content_hash": "e0f941fc069490ba99c7fc74c32a851e",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 215,
"avg_line_length": 41.75373134328358,
"alnum_prop": 0.6936550491510277,
"repo_name": "Azure/azure-sdk-for-python",
"id": "6e42b2296ccfba8474f27f19c78aa5c96a7e7d3f",
"... |
from django.conf import settings
from mail.models import MailTemplate
# slug for the email template
PAYMENT_LATER = 'payment_later'
PAYMENT_THANKYOU = 'payment_thankyou'
def init_app_pay():
"""For the description, check 'mail_template_context' in 'pay.models'."""
MailTemplate.objects.init_mail_template(
... | {
"content_hash": "a8859ed4e9c4fe5253bfd84d268e2b35",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 77,
"avg_line_length": 33.275,
"alnum_prop": 0.6040570999248686,
"repo_name": "pkimber/pay",
"id": "30af5f1b0434f23a5f9e1563f8cc279f84894d0a",
"size": "1357",
"binary": f... |
from django_assets import Bundle, register
js = Bundle(
'js/vendor/jquery.scrollto.js',
'js/home.js',
output='gen/home.%(version)s.js')
css = Bundle(
'css/home.css',
output='gen/home.%(version)s.css')
register('js_home', js)
register('css_home', css) | {
"content_hash": "8d82fd7b35d6696cb4bedfa0e666e6b2",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 42,
"avg_line_length": 19.846153846153847,
"alnum_prop": 0.6821705426356589,
"repo_name": "100Shapes/100shapes.github.com",
"id": "7a26f7e1f87cf9966f4504a12fb5de9e2cc56f88",
... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Circuito',
fields=[
('id', models.AutoField(verbose_name='ID', serializ... | {
"content_hash": "a1b4162b16551f4689deb13c6b19fa94",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 114,
"avg_line_length": 38.25,
"alnum_prop": 0.5276520864756159,
"repo_name": "lendoly/djangoF1",
"id": "94fa913d76e871b7e4d4fa82cef6579a4ea857c3",
"size": "4002",
"bina... |
from indico.util.fossilize import IFossil
class IGroupFossil(IFossil):
def getId(self):
""" Group id """
def getName(self):
""" Group name """
def getEmail(self):
""" Group email """
def getProvider(self):
pass
getProvider.produce = lambda x: getattr(x, 'provide... | {
"content_hash": "c79dcfc8537919878c3b8fda9b1eed24",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 92,
"avg_line_length": 22.953846153846154,
"alnum_prop": 0.6032171581769437,
"repo_name": "mic4ael/indico",
"id": "6473d488829fa5f33014d4e976012ba37154822b",
"size": "1706"... |
"""
Tests for L{twisted.internet.posixbase} and supporting code.
"""
from twisted.python.compat import set
from twisted.trial.unittest import TestCase
from twisted.internet.defer import Deferred
from twisted.internet.posixbase import PosixReactorBase, _Waker
from twisted.internet.protocol import ServerFactory
skipSo... | {
"content_hash": "2aa24e7b3f047880fffb27b85b1cae08",
"timestamp": "",
"source": "github",
"line_count": 384,
"max_line_length": 80,
"avg_line_length": 32.197916666666664,
"alnum_prop": 0.6431575541895826,
"repo_name": "Varriount/Colliberation",
"id": "1d6c72cd25f84519192bc4152440a96d6fd35fb0",
"siz... |
from .aes import AES
from .rsa import RSA, RSAServerKey
from .auth_key import AuthKey
from .factorization import Factorization
| {
"content_hash": "8cf73c084dd7c0244e66764d248f22ea",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 40,
"avg_line_length": 31.75,
"alnum_prop": 0.8188976377952756,
"repo_name": "kyasabu/Telethon",
"id": "81416cd9d1b7e1109450d37418f9274b3cf4adc7",
"size": "127",
"binary":... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License ... | {
"content_hash": "f36c141eba8c1cd55c1f33a6de314752",
"timestamp": "",
"source": "github",
"line_count": 491,
"max_line_length": 97,
"avg_line_length": 34.33808553971487,
"alnum_prop": 0.6030842230130486,
"repo_name": "SpatialVision/differential_privacy",
"id": "36b6c30687679c26ca53dc8382e09bc01fb801a... |
from google.cloud import talent_v4beta1
async def sample_get_company():
# Create a client
client = talent_v4beta1.CompanyServiceAsyncClient()
# Initialize request argument(s)
request = talent_v4beta1.GetCompanyRequest(
name="name_value",
)
# Make the request
response = await clie... | {
"content_hash": "7f5eed45709529c4a3481dfa141c76db",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 62,
"avg_line_length": 24.36842105263158,
"alnum_prop": 0.712742980561555,
"repo_name": "googleapis/python-talent",
"id": "f3c4a42a3ec7c070fb031a71d930aed21ca0545f",
"size"... |
"""
Kernel Density Estimator
"""
from __future__ import print_function
import argparse
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
class KDE(object):
"""
use Epanechnikov kernel
"""
def fit(self, data):
"""
:param data: data to fit, numpy 2-D array
""... | {
"content_hash": "25dd7dd855e2ecba986456206d70e931",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 72,
"avg_line_length": 23.140350877192983,
"alnum_prop": 0.6110689916603488,
"repo_name": "mamikonyana/mamikonyana.github.io",
"id": "725e645fe4c3d0add468b568b4e077985b1d871c... |
import os
import sys
import json
import logging
import numpy as np
logging.basicConfig(level=logging.INFO)
from robo.solver.hyperband_datasets_size import HyperBand_DataSubsets
from hpolib.benchmarks.ml.surrogate_svm import SurrogateSVM
run_id = int(sys.argv[1])
seed = int(sys.argv[2])
rng = np.random.RandomState(... | {
"content_hash": "f19e7cc63647e4e94f72ddad37f8c573",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 126,
"avg_line_length": 25.38,
"alnum_prop": 0.6989755713159969,
"repo_name": "numairmansur/RoBO",
"id": "ca036d2b911912fd1b27e2e4cdc9e170f4359877",
"size": "1269",
"bina... |
from distutils.core import setup
import sys
reload(sys).setdefaultencoding("UTF-8")
version = '0.2.2'
setup(
name ='django-fabdeploy-extensions',
version = version,
author = 'Future Colors',
author_email = 'info@futurecolors.ru',
packages = ['fabdeploy_extensions', 'fabdeploy_extensions.extension... | {
"content_hash": "69303ba69aa71ba051bc2aeccfec0f92",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 96,
"avg_line_length": 35.86666666666667,
"alnum_prop": 0.6477695167286245,
"repo_name": "futurecolors/django-fabdeploy-extensions",
"id": "8833e3c44b484678b82261570be1037872... |
import views
from django.conf.urls import url
from djangosaml2 import views
urlpatterns = [
url(r'^login/$', views.login, name='saml2_login'),
url(r'^acs/$', views.assertion_consumer_service, name='saml2_acs'),
url(r'^logout/$', views.logout, name='saml2_logout'),
url(r'^ls/$', views.logout_service, ... | {
"content_hash": "3355c71e1387347f690528d69ece3be9",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 72,
"avg_line_length": 34.07142857142857,
"alnum_prop": 0.6624737945492662,
"repo_name": "GradConnection/djangosaml2",
"id": "95f48004b26ccf4a833201082c18c00559a9b860",
"si... |
import os
def upload_path(instance, filename):
_, ext = os.path.splitext(filename)
return "avatars/{pk}{ext}".format(pk=instance.pk, ext=ext)
| {
"content_hash": "9d7b81d9754226dd787115a4659bc59d",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 62,
"avg_line_length": 25.333333333333332,
"alnum_prop": 0.6842105263157895,
"repo_name": "Uran198/med",
"id": "a8dc917dddd4c8b54d79ffb0eb9141fef5d74c2f",
"size": "152",
"... |
"""Converts COCO data to TFRecord file format.
This data is used for the out-of-domain supervised pretraining (Sec. 4.3.1).
It is also used to train the MLE baseline.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import json
import... | {
"content_hash": "ef7c032a453aa6a693ec6a6d817a5da0",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 80,
"avg_line_length": 32.7037037037037,
"alnum_prop": 0.6778029445073612,
"repo_name": "google-research/language",
"id": "8360c8f8e08db7fa1baaf8f000d460dcb809827b",
"size... |
'''
Exposes all public package contents.
@author: Eitan Isaacson
@organization: Mozilla Foundation
@copyright: Copyright (c) 2006, 2007 Mozilla Foundation
@license: BSD
All rights reserved. This program and the accompanying materials are made
available under the terms of the BSD which accompanies this distribution, ... | {
"content_hash": "9295abe28e982569d6ef831ae25b1f6b",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 78,
"avg_line_length": 31.294117647058822,
"alnum_prop": 0.8045112781954887,
"repo_name": "javihernandez/accerciser-mirror",
"id": "51ae04c38edaf17c3b7eb70d04ed9d98de6dc3af",... |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | {
"content_hash": "89b2937fd76cd900b109d0ce1f16f130",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 106,
"avg_line_length": 39.23863636363637,
"alnum_prop": 0.735881841876629,
"repo_name": "arenadata/ambari",
"id": "ada0500bbb97e5b7bee352be8e710bb6bf84fc48",
"size": "3475... |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:9332")
else:
access = Ser... | {
"content_hash": "ee4708d84322ee18b90dd69626956ac1",
"timestamp": "",
"source": "github",
"line_count": 324,
"max_line_length": 79,
"avg_line_length": 24.203703703703702,
"alnum_prop": 0.6619484825299669,
"repo_name": "kraxis/hideyocoin",
"id": "583f6b3603cf065820ab0c3bf20846a07929d385",
"size": "7... |
from __future__ import absolute_import
from cproton import pn_incref, pn_decref, \
pn_py2void, pn_void2py, \
pn_record_get, pn_record_def, pn_record_set, \
PN_PYREF
from ._exceptions import ProtonException
class EmptyAttrs:
def __contains__(self, name):
return False
def __getitem__(sel... | {
"content_hash": "408f7b1acbd32d394574fbc23de56852",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 112,
"avg_line_length": 34.141666666666666,
"alnum_prop": 0.5626067854527703,
"repo_name": "ssorj/qpid-proton",
"id": "4703b348f7f4d7e13f6ff06f9112938d5b301046",
"size": "... |
"""
Given a list containing N integers, calculate the XOR_SUM of all the non-empty subsets of the list and print the value
of sum % (109 + 7).
XOR operation on a list (or a subset of the list) is defined as the XOR of all the elements present in it.
E.g. XOR of list containing elements {A,B,C} = ((A^B)^C), where ^ rep... | {
"content_hash": "055bfcf3ce32f71d5e9fa223d92d9f2d",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 118,
"avg_line_length": 33.291666666666664,
"alnum_prop": 0.6132665832290363,
"repo_name": "algorhythms/HackerRankAlgorithms",
"id": "a87addfcc5ffc688d126feecbe7d18856553642b... |
import unittest
import mock
from algoliasearch.exceptions import RequestException, MissingObjectIdException
from algoliasearch.http.request_options import RequestOptions
from algoliasearch.responses import Response
from algoliasearch.search_index import SearchIndex
from algoliasearch.configs import SearchConfig
from ... | {
"content_hash": "e27aee795efcda227f576dff75933e83",
"timestamp": "",
"source": "github",
"line_count": 422,
"max_line_length": 88,
"avg_line_length": 34.87914691943128,
"alnum_prop": 0.563625246280318,
"repo_name": "algolia/algoliasearch-client-python",
"id": "e8cf3b3dffef65ff4f09849d668b1b73367a15c... |
"""PEP 0492/Python 3.5+ tests for binary files."""
import io
from os.path import dirname, join
from aiofiles.threadpool import open as aioopen
import pytest
@pytest.mark.asyncio
@pytest.mark.parametrize("mode", ["rb", "rb+", "ab+"])
@pytest.mark.parametrize("buffering", [-1, 0])
async def test_simple_iteration(mode, ... | {
"content_hash": "e50f9e52467b0532ffed4d103a48c379",
"timestamp": "",
"source": "github",
"line_count": 336,
"max_line_length": 79,
"avg_line_length": 30.446428571428573,
"alnum_prop": 0.6218963831867058,
"repo_name": "Tinche/aiofiles",
"id": "faf72a09360160aee28460c46145d99f71a44f5d",
"size": "102... |
import numpy as np
from utils import gen_tpm_inputs, gen_ppm_inputs
class PermutationParityTrainer(object):
"""Permutation Parity Trainer
Used to train two Permutation Parity Machines (PPM) to sync weights, as well as involving a third snooper model.
"""
def __init__(self):
pass
def tra... | {
"content_hash": "5b267a649674b42558124e4b4e5a4d59",
"timestamp": "",
"source": "github",
"line_count": 336,
"max_line_length": 116,
"avg_line_length": 42.166666666666664,
"alnum_prop": 0.5662761151891587,
"repo_name": "johnsbuck/neural_cryptography",
"id": "44c47e9b0b4fe2faff328d27fbb98c5becf12230",... |
import mock
from openstack.tests.unit import base
from openstack.clustering.v1 import cluster
FAKE_ID = '092d0955-2645-461a-b8fa-6a44655cdb2c'
FAKE_NAME = 'test_cluster'
FAKE = {
'id': 'IDENTIFIER',
'config': {'key1': 'value1', 'key2': 'value2'},
'desired_capacity': 1,
'max_size': 3,
'min_size':... | {
"content_hash": "f0013b43518de1d0dead0d2e1202f9e4",
"timestamp": "",
"source": "github",
"line_count": 313,
"max_line_length": 77,
"avg_line_length": 33.57188498402556,
"alnum_prop": 0.5215074229158736,
"repo_name": "openstack/python-openstacksdk",
"id": "ac6eab76f9f6e82ef64fef8678be639760eac777",
... |
from __future__ import absolute_import, division, print_function, unicode_literals
# noinspection PyUnresolvedReferences
from h2o.utils.compatibility import * # NOQA
import h2o
from h2o.utils.ext_dependencies import get_matplotlib_pyplot
from h2o.utils.shared_utils import can_use_pandas
from .model_base import ModelB... | {
"content_hash": "de36cd03edc9642ddd40450f45db13c7",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 131,
"avg_line_length": 39.959016393442624,
"alnum_prop": 0.6285128205128205,
"repo_name": "michalkurka/h2o-3",
"id": "04b5a37f09742ae6993f6bb5fecf57e4f782efd2",
"size": "... |
"""Circulation JSON Resolver module."""
| {
"content_hash": "49f975ccd54ce4237d0b532f4f7b188a",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 39,
"avg_line_length": 40,
"alnum_prop": 0.725,
"repo_name": "inveniosoftware/invenio-circulation",
"id": "1f7d1eb5f9d1808151eff7e76facdc9ca17b6299",
"size": "250",
"binar... |
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import AnonymousUser
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from django.shortcuts import get... | {
"content_hash": "f0344bbb0ed5e6bf5216313727597c77",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 111,
"avg_line_length": 31.649193548387096,
"alnum_prop": 0.5951076570263728,
"repo_name": "animekita/selvbetjening",
"id": "b014f0aa6007ec77384c1c188cc276908f2aba5c",
"si... |
"""This script is to automate the process of install modules
Blender's internal version of Python
How to use it:
1. Open Blender with Admin permissions if Blender is
installed in the default location (at least with windows)
2. Open the scripting scene
3. Open the script in the "Text Editor" window
(Optionally cli... | {
"content_hash": "640951fe25a7d27e8aa427824d16e555",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 92,
"avg_line_length": 33.397260273972606,
"alnum_prop": 0.6936013125512716,
"repo_name": "openworm/Blender2NeuroML",
"id": "56e665b6b237c6fce8f150d9770c28f35e9946c0",
"siz... |
import vtk
def main():
colors = vtk.vtkNamedColors()
renderer = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(renderer)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
sphere = vtk.vtkSphereSource()
sphere.SetPhiResolution(12)
sphere.SetTh... | {
"content_hash": "87d41ccd946f582e38af88098ed5d126",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 58,
"avg_line_length": 23.05263157894737,
"alnum_prop": 0.6860730593607306,
"repo_name": "lorensen/VTKExamples",
"id": "ac6fd4d6b8108f7406702f3e128be91ed72be410",
"size": "... |
'''
Implements the targetcli target related UI.
This file is part of targetcli.
Copyright (c) 2011-2013 by Datera, Inc
Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at
http://www.apache.org/lic... | {
"content_hash": "2447241bece3806f429bd1913d2da063",
"timestamp": "",
"source": "github",
"line_count": 1478,
"max_line_length": 219,
"avg_line_length": 36.54194857916103,
"alnum_prop": 0.5705160251069267,
"repo_name": "cvubrugier/targetcli-fb",
"id": "6895b38e62b855fd72d653a43c9db455f3ba5ed1",
"si... |
"""Nginx Configuration"""
from distutils.version import LooseVersion
import logging
import re
import socket
import subprocess
import tempfile
import time
from typing import Dict
from typing import List
from typing import Optional
from typing import Set
from typing import Text
from typing import Tuple
import OpenSSL
im... | {
"content_hash": "ffab54011eb96465e66ec7a7d02f9cdd",
"timestamp": "",
"source": "github",
"line_count": 1272,
"max_line_length": 118,
"avg_line_length": 40.9622641509434,
"alnum_prop": 0.5971326577614002,
"repo_name": "stweil/letsencrypt",
"id": "ac24edb0af6a7fc5ad0501e820b7c6f8de96279d",
"size": "... |
from django.conf.urls import patterns, url
from ..views import StatusChangedNotificationView
urlpatterns = patterns('',
url(r'^$', StatusChangedNotificationView.as_view(), name='cowry-docdata-status-changed'),
)
| {
"content_hash": "00bb1f1cae276d5280a6a0f5b22a2154",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 93,
"avg_line_length": 36.166666666666664,
"alnum_prop": 0.7649769585253456,
"repo_name": "onepercentclub/onepercentclub-site",
"id": "b61f4c2bd17b12c9addfe97107002cabc2e84051... |
import sys
from PyQt5.QtWidgets import *
if __name__ == '__main__':
app = QApplication(sys.argv)
w = QWidget()
ui = Ui_Form()
| {
"content_hash": "daffee0796688b2f30754406a77ff6af",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 32,
"avg_line_length": 17.5,
"alnum_prop": 0.5785714285714286,
"repo_name": "Great-Li-Xin/PythonDev",
"id": "0b79faf425d8915d19dcd89a9c34227dd892663a",
"size": "140",
"bin... |
try:
# Python 2.7
from collections import OrderedDict
except:
# Python 2.6
from gluon.contrib.simplejson.ordered_dict import OrderedDict
from gluon import current
from gluon.storage import Storage
def config(settings):
"""
Template settings
All settings which are to configure a sp... | {
"content_hash": "e19a77f0d437c66ae12f2a4c5bddab07",
"timestamp": "",
"source": "github",
"line_count": 1202,
"max_line_length": 219,
"avg_line_length": 46.831114808652245,
"alnum_prop": 0.6318594446714395,
"repo_name": "michaelhowden/eden",
"id": "1247d2bd46aaab56a5a0ff3e2d08a930f55a3894",
"size":... |
"""
Geo Location component.
This component covers platforms that deal with external events that contain
a geo location related to the installed HA instance.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/geo_location/
"""
import logging
from datetime i... | {
"content_hash": "e26b4acee487eee6f82a9e42686a9056",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 76,
"avg_line_length": 30.681159420289855,
"alnum_prop": 0.6920170051960322,
"repo_name": "persandstrom/home-assistant",
"id": "66753aad22117cc468316f03aeb350c254153fba",
"... |
import os
print("Generate digits test dataset...")
test_digits_folder = os.path.normpath(os.path.join(os.path.join(os.getcwd(), os.path.dirname(__file__)), 'digits/test_digits'))
test_digits_file_path = os.path.join(os.path.join(os.getcwd(), os.path.dirname(__file__)), 'digits_multiclass_test.dat')
for (dirpath, dir... | {
"content_hash": "9a30ea394e0d6c5051ecbfaf9fa50da6",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 132,
"avg_line_length": 43.08163265306123,
"alnum_prop": 0.6428233064898152,
"repo_name": "fukuball/fuku-ml",
"id": "91993de978ff1003563f1445302d27774afff315",
"size": "212... |
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | {
"content_hash": "4de26647af3537e18b1f18f51483e6ba",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 194,
"avg_line_length": 39.674418604651166,
"alnum_prop": 0.6135209066041423,
"repo_name": "keedio/keedio-stacks",
"id": "aca1b05294034172f030865de9927f4617f2c6e2",
"size"... |
import os
from setuptools import setup, find_packages
from spider import VERSION
f = open(os.path.join(os.path.dirname(__file__), 'README.rst'))
readme = f.read()
f.close()
setup(
name='django-spider',
version=".".join(map(str, VERSION)),
description='a multi-threaded spider with a web interface',
lo... | {
"content_hash": "e0890d640d712686acde172b8fd32767",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 63,
"avg_line_length": 27.636363636363637,
"alnum_prop": 0.6195175438596491,
"repo_name": "georgedorn/django-spider",
"id": "e5b96533d9a1191ebea8cc80a7cae326b613f4d4",
"siz... |
import sys
import re
import gevent
import urlparse
from gevent.pywsgi import WSGIHandler
from socketio import transports
class SocketIOHandler(WSGIHandler):
RE_REQUEST_URL = re.compile(r"""
^/(?P<resource>.+?)
/1
/(?P<transport_id>[^/]+)
/(?P<sessid>[^/]+)/?$
""", re.X)... | {
"content_hash": "da9c4df1a6833ab58cc419140cfda04e",
"timestamp": "",
"source": "github",
"line_count": 225,
"max_line_length": 86,
"avg_line_length": 39.577777777777776,
"alnum_prop": 0.577316114542392,
"repo_name": "arnuschky/gevent-socketio",
"id": "74681b8118709f0f06332593e76664204d8b24dd",
"si... |
from flask import Flask, flash
from flask import request
from flask import render_template
from flask import jsonify
from flask.ext.bootstrap import Bootstrap
from wtforms import Form, StringField, validators, FieldList, FormField, SubmitField, HiddenField
from dataModel import *
import hashlib
import unicodedata
impor... | {
"content_hash": "6b5ed96c535af1f8bb2658969b396f3a",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 129,
"avg_line_length": 35.027027027027025,
"alnum_prop": 0.6568930041152263,
"repo_name": "MichaelBVaughn/NoFAQ",
"id": "44640cdd53e1d2606c28d6cf2370ded0a5f5020b",
"size"... |
import FWCore.ParameterSet.Config as cms
#---------------------------------------------------------------------------------------------------
# M A I N
#---------------------------------------------------------------------------------------------------
# create the process
pro... | {
"content_hash": "f5dedeab63e172652a6b7e3212fc8154",
"timestamp": "",
"source": "github",
"line_count": 232,
"max_line_length": 138,
"avg_line_length": 38.37931034482759,
"alnum_prop": 0.6919362084456424,
"repo_name": "cpausmit/Kraken",
"id": "bccac98f9956d090e4f2317e65c64c7abc91aff4",
"size": "890... |
import re
import collections
from time import time
###################################################################
# Define Functions
def words(text): return re.findall('[a-z]+', text.lower())
def train(features):
model = collections.defaultdict(lambda: 1)
for f in features:
model[f] += 1
r... | {
"content_hash": "18fa071cc4caba7e7602c2bff8184cec",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 89,
"avg_line_length": 40.8828125,
"alnum_prop": 0.5769157271163768,
"repo_name": "dandxy89/ExperiKeras",
"id": "0c52701aac227a2c548a43b39a57d9ed41700bf6",
"size": "5530",... |
from datetime import time
from django.conf import settings
def getTeamDaysOff(team):
days_off = team.days_off.split(',')
days_off = [int(day) for day in days_off]
return days_off
def checkIfDayOfWeekInDayOfWeekList(date, week_day_list):
if date.isoweekday() in week_day_list:
return True
de... | {
"content_hash": "4aadb634ad751774b39dff66ceb531d0",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 73,
"avg_line_length": 24.41176470588235,
"alnum_prop": 0.7012048192771084,
"repo_name": "desecho/tickets",
"id": "7f5733374aaaeccb78720e7db6964e14f121010b",
"size": "415",... |
class Request(object):
pass
| {
"content_hash": "7c81876ccba4f5c2b9baf681003f51c4",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 22,
"avg_line_length": 16,
"alnum_prop": 0.6875,
"repo_name": "github/codeql",
"id": "c7ac65eaf056d7bc3b6bcef4de454b9f951d93e9",
"size": "32",
"binary": false,
"copies":... |
from google.protobuf import field_mask_pb2 # type: ignore
import proto # type: ignore
from google.cloud.tasks_v2.types import queue as gct_queue
from google.cloud.tasks_v2.types import task as gct_task
__protobuf__ = proto.module(
package="google.cloud.tasks.v2",
manifest={
"ListQueuesRequest",
... | {
"content_hash": "cbc9b33f4dd20fe49cbe44802f42cc67",
"timestamp": "",
"source": "github",
"line_count": 542,
"max_line_length": 88,
"avg_line_length": 32.8929889298893,
"alnum_prop": 0.6147632936953108,
"repo_name": "googleapis/python-tasks",
"id": "f4cf7e0ae8eab22048b3e5e5cae797d88eaa72ae",
"size"... |
from lollipop.errors import ValidationError, ValidationErrorBuilder, \
ErrorMessagesMixin, merge_errors
from lollipop.utils import is_sequence, is_mapping, make_context_aware, \
constant, identity, OpenStruct, DictWithDefault
from lollipop.compat import string_types, int_types, iteritems, OrderedDict
import dat... | {
"content_hash": "2988ce62d6eea152ff935fb851dede31",
"timestamp": "",
"source": "github",
"line_count": 1814,
"max_line_length": 101,
"avg_line_length": 34.65821389195149,
"alnum_prop": 0.577636392556068,
"repo_name": "maximkulkin/lollipop",
"id": "b33c72aed7e209f8ace6f769f4c86bed904b22ed",
"size":... |
import json
import os
import platform
import shutil
import unittest
from unittest import mock
# pylint: disable=import-error
from opentelemetry.sdk import trace, resources
from opentelemetry.sdk.trace.export import SpanExportResult
from opentelemetry.sdk.util.instrumentation import InstrumentationScope
from openteleme... | {
"content_hash": "a189bccbbb1ffdcfe86bac8411fa20ec",
"timestamp": "",
"source": "github",
"line_count": 1288,
"max_line_length": 119,
"avg_line_length": 40.21816770186335,
"alnum_prop": 0.5935213605914944,
"repo_name": "Azure/azure-sdk-for-python",
"id": "70c1e4d1fff14dc00a6dda4ee828079d985e0f6c",
... |
from articulate import define
from vizone.client import init
from vizone.resource.asset import create_asset, asset_Item as Item
@define('a Viz One client for <hostname>')
class VizOneSession:
def __init__(self, hostname):
self.hostname = hostname
def __expose__(self):
return {
'hos... | {
"content_hash": "1269a7cc1fb8c323629b61f5c4f0a426",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 66,
"avg_line_length": 30.571428571428573,
"alnum_prop": 0.6651090342679128,
"repo_name": "eblade/articulate",
"id": "9e3ada544824c8418902fdfcf485d9d4cd14e057",
"size": "64... |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('survey', '0010_remove_question_layers'),
]
operations = ... | {
"content_hash": "0c20898eb1f65b8998282f1ff8eac143",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 114,
"avg_line_length": 33.93333333333333,
"alnum_prop": 0.5677799607072691,
"repo_name": "Ecotrust/floodplain-restoration",
"id": "f995befdfe9995f6b53eaff5c2ade12317bae3a6",... |
"""The standard runtime library."""
from runtime.env import (Datatype, Value, Function, Operator,
Signature, FunctionBinding, CastException, ANY, NULL,
RuntimeException)
NUMBER = Datatype("*number", None, ANY)
def cast_integer(value):
"""Casts a value to an INTEG... | {
"content_hash": "def5ecd311f372ee20bc2a64e6fd8572",
"timestamp": "",
"source": "github",
"line_count": 505,
"max_line_length": 88,
"avg_line_length": 29.99009900990099,
"alnum_prop": 0.573786728293166,
"repo_name": "lnsp/tea",
"id": "c94a721370b8cc167ac7ca1e2d13f12e926de7cc",
"size": "15145",
"b... |
"""
All prices going up 5p
1 sheet (double-sided) increases from 30p to 35p (plus VAT)
2 sheets (double-sided) increases from 35p to 40p (plus VAT)
3 sheets (double-sided) increases from 40p to 45p (plus VAT)
4 sheets (double-sided) increases from 45p to 50p (plus VAT)
5 sheets (double-sided) increases from 50p to 55p... | {
"content_hash": "5e771d0da5c4e2b167868383149c9964",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 116,
"avg_line_length": 32.338235294117645,
"alnum_prop": 0.6512050932241928,
"repo_name": "alphagov/notifications-api",
"id": "6d8752043f15bd9acf4f54e010bf13b0c6953229",
"... |
from __future__ import unicode_literals
from django.utils import timezone
# Create your models here.
| {
"content_hash": "3840281cefc8b90a426138e19c197840",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 39,
"avg_line_length": 25.5,
"alnum_prop": 0.7843137254901961,
"repo_name": "Saket-Komawar/Forex",
"id": "7245e4ee3c439ac1f2f7a0e94bf04d9b5353f1a1",
"size": "102",
"binary... |
""" QiMessaging Python bindings
Provided features are very close to C++, Python style.
"""
def load_lib_qipyessaging():
""" Load _qipyessaging.so and its dependencies.
This makes _qipyessaging usable from a relocatable
SDK without having to set LD_LIBRARY_PATH
"""
import ctypes
import os
... | {
"content_hash": "2dd25e618078a99241507d5f6290332a",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 111,
"avg_line_length": 30.79591836734694,
"alnum_prop": 0.5825049701789264,
"repo_name": "plus44/hcr-2016",
"id": "d5c331c12a05b1435f84a61de2a753593c3c48f6",
"size": "470... |
from numpy.testing import assert_allclose, assert_equal
from chaco.image_utils import trim_screen_rect, X_PARAMS, Y_PARAMS
SINGLE_PIXEL = (1, 1)
FOUR_PIXELS = (2, 2)
def midpoint(x, length):
return x + length / 2.0
def assert_midpoints_equal(bounds_list):
for i_pos, i_length in (X_PARAMS, Y_PARAMS):
... | {
"content_hash": "77bfa16866024ca4770c669f7348548c",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 76,
"avg_line_length": 34.98360655737705,
"alnum_prop": 0.6283973758200563,
"repo_name": "tommy-u/chaco",
"id": "62ae83418c06b63d90eedf8be6a2431c9abd8869",
"size": "2134",
... |
from securitycenter import SecurityCenter4
import time
# NOTE: all time is based on Unix time. 86400 is 1 day in seconds.
update_list = [{
'asset_id': 28,
'filters': {
'sensor': 'HomeNet_Snort',
'endtime': int(time.time()),
'starttime': (int(time.time()) - 86400),
},
},{
... | {
"content_hash": "5ccbdd99fa53f2d96956be2394eeb7bc",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 66,
"avg_line_length": 23.542857142857144,
"alnum_prop": 0.5716019417475728,
"repo_name": "SteveMcGrath/pySecurityCenter",
"id": "574a7534af2e27917bf2300f815ea1ad2e6369d7",
... |
from django.utils.module_loading import import_string
from payments.exceptions import InvalidSettingsEntryForPaymentMethodException, InvalidPaymentFormParentClass, \
PaymentViewDoesNotExistInTheViewsMapException
class AbstractPaymentInterface:
PAYMENT_STATUS_MAPPING = dict()
R... | {
"content_hash": "b249892ecf36fb1adeb93af1c91a40da",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 119,
"avg_line_length": 36.144,
"alnum_prop": 0.6405489154493138,
"repo_name": "tm-kn/django-universal-payments",
"id": "666a2957a8a728e1f598e8eb87ecd270c0ba8dfe",
"size":... |
import unittest
import mock
from ...management.jobs import Jobs
class TestJobs(unittest.TestCase):
def test_init_with_optionals(self):
t = Jobs(domain="domain", token="jwttoken", telemetry=False, timeout=(10, 2))
self.assertEqual(t.client.options.timeout, (10, 2))
telemetry_header = t.cl... | {
"content_hash": "3bedefa3c2936394959796971fae89d7",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 87,
"avg_line_length": 32.666666666666664,
"alnum_prop": 0.549234693877551,
"repo_name": "auth0/auth0-python",
"id": "5d7d6700338b5b1cb037a9ac99f1ab22587c4093",
"size": "3... |
import inspect
import webob
from nova.api.openstack import wsgi
from nova import exception
from nova import test
from nova.tests.api.openstack import fakes
class RequestTest(test.TestCase):
def test_content_type_missing(self):
request = wsgi.Request.blank('/tests/123', method='POST')
request.body... | {
"content_hash": "52d66eaea7699c800adbd2e8d432c019",
"timestamp": "",
"source": "github",
"line_count": 861,
"max_line_length": 79,
"avg_line_length": 34.558652729384434,
"alnum_prop": 0.561351033439758,
"repo_name": "NoBodyCam/TftpPxeBootBareMetal",
"id": "7427eb2afb31d0ebfcf1a158f585029b6fe2b9c6",
... |
"""
flask.logging
~~~~~~~~~~~~~
Implements the logging support for Flask.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import web
from logging import getLogger
from logging import getLoggerClass
from logging import DEBUG
from loggin... | {
"content_hash": "361312c72bfcda46bb2c4a9a07d0302c",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 79,
"avg_line_length": 27.785714285714285,
"alnum_prop": 0.6953727506426736,
"repo_name": "comick/barduino",
"id": "2dff9a6554430c9a6a707677e7244736aa327878",
"size": "1603... |
import pytest
from mock import Mock, patch
from meetingbot.meetings import GoToMeeting
from .fixtures import event, attendees, room, organizer
class TestGoToMeeting:
@pytest.fixture
def gotomeeting(self, event):
return GoToMeeting(event.description)
def test_can_pull_meeting_id_from_description... | {
"content_hash": "8594a33ce30135896d6051b2b50e4c23",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 69,
"avg_line_length": 30.161290322580644,
"alnum_prop": 0.6844919786096256,
"repo_name": "kevinlondon/meetingbot",
"id": "fce2f38df8a8430a868737d8ee773d728c945f00",
"size"... |
"""
URLConf for Django user profile management.
Recommended usage is to use a call to ``include()`` in your project's
root URLConf to include this URLConf for any URL beginning with
'/profiles/'.
"""
from django.conf.urls.defaults import *
from profiles import views
urlpatterns = patterns('',
... | {
"content_hash": "8deaa2b18e9b030669514e0fec54157d",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 69,
"avg_line_length": 32.82142857142857,
"alnum_prop": 0.4602829162132753,
"repo_name": "clones/django-profiles",
"id": "2dd28b8bd4055aaf46910d958e6c3d39549968f8",
"size":... |
import sys, os, json, re, fnmatch, subprocess
from os.path import isfile, join
def log(level, message):
print "[" + level + "] " + message
def collect_files(path, pattern):
files = [join(path, f) for f in os.listdir(path) if isfile(join(path, f)) ]
files = fnmatch.filter(files, "*." + pattern)
return ... | {
"content_hash": "734cc731f6f6e541fe6242767279afe0",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 82,
"avg_line_length": 35.968,
"alnum_prop": 0.5080071174377224,
"repo_name": "libbun/libbun2",
"id": "fdfbecbd00bd149d7bf4a944bedecffd886dbd2d",
"size": "4519",
"binary... |
from __future__ import unicode_literals
import frappe
def execute():
if not frappe.db.exists('Desk Page'): return
pages = frappe.get_all("Desk Page", filters={ "is_standard": False }, fields=["name", "extends", "for_user"])
default_icon = {}
for page in pages:
if page.extends and page.for_user:
if not defaul... | {
"content_hash": "cfa37eaf65adefb5035636175ba2f29d",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 110,
"avg_line_length": 35.733333333333334,
"alnum_prop": 0.6884328358208955,
"repo_name": "saurabh6790/frappe",
"id": "93bf5c766e03a95e0c9cf90c2f1c49e4952d4cee",
"size": "... |
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^bb/', include('bb.urls')),
url(r'^admin/', include(admin.site.urls))
]
| {
"content_hash": "84a4d2dad68340f84c19cbdab11de514",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 45,
"avg_line_length": 26,
"alnum_prop": 0.6648351648351648,
"repo_name": "yemmitt/bb_website",
"id": "27d29b48938f05ca128224bcf8ab331e7f8ffe4a",
"size": "182",
"binary": ... |
import sys
from typing import Any, TYPE_CHECKING
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy
from .._version import VERSION
if sys.version_info >= (3, 8):
from typing i... | {
"content_hash": "ddd2a703f91da43dc437bd18289edc2d",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 107,
"avg_line_length": 51.375,
"alnum_prop": 0.7177615571776156,
"repo_name": "Azure/azure-sdk-for-python",
"id": "f46270fe370c4b17c0d9d3167dfb4e9911fc2b04",
"size": "3756... |
"""Unit tests for scrabble.py"""
import unittest
import sys
import os
current_dir = os.getcwd()
src_dir = os.path.join(current_dir, 'scrabble')
tests_dir = os.path.join(current_dir, 'tests')
# add the source directory to the load path
sys.path.append(src_dir)
import scrabble
class TestScrabble(unittest.TestCase):... | {
"content_hash": "0c28759563c0f84516a8c595c6a16581",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 79,
"avg_line_length": 29.333333333333332,
"alnum_prop": 0.6065340909090909,
"repo_name": "benosment/scrabble",
"id": "e30bf8e00615f39e87c0b768a55d87be28a6e925",
"size": "1... |
import unittest
from Crypto.Util import strxor
import stringlib
def solve(crypt_msg):
max_score, decoder, secret = 0, None, None
unhex_msg = stringlib.decode_hex(crypt_msg)
for c in range(256):
dec_msg = strxor.strxor_c(unhex_msg, c)
score = stringlib.score(dec_msg)
if score > ma... | {
"content_hash": "5d9b23055b638d94a064833aa07f4a16",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 89,
"avg_line_length": 28.625,
"alnum_prop": 0.6724890829694323,
"repo_name": "Renelvon/matasano",
"id": "bc9d64028c4d191d30aeea1827efba5e20df8d31",
"size": "687",
"binar... |
"""
pyQms
-----
Python module for fast and accurate mass spectrometry data quantification
:license: MIT, see LICENSE.txt for more details
Authors:
* Leufken, J.
* Niehues, A.
* Sarin, L.P.
* Hippler, M.
* Leidel, S.A.
* Fufezan, C.
"""
import pyqm... | {
"content_hash": "926953660526f97c6fe894a7c2eb5180",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 82,
"avg_line_length": 25.838983050847457,
"alnum_prop": 0.5762545096753033,
"repo_name": "pyQms/pyqms",
"id": "bea3e660b99c8d20607e7eefb1040ee9317eeb8b",
"size": "3090",
... |
from dataclasses import dataclass
from fairseq.dataclass import FairseqDataclass
from fairseq.scoring import BaseScorer, register_scorer
@dataclass
class ChrFScorerConfig(FairseqDataclass):
pass
@register_scorer("chrf", dataclass=ChrFScorerConfig)
class ChrFScorer(BaseScorer):
def __init__(self, args):
... | {
"content_hash": "cf2388571c580d029852bfc11ecb94c5",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 73,
"avg_line_length": 25.833333333333332,
"alnum_prop": 0.6851612903225807,
"repo_name": "pytorch/fairseq",
"id": "5df5a1c011243fe2e836c38a5f8459aeb824f0e7",
"size": "954"... |
import argparse
import rank_serializer as RS
import bit_serializer as bs
import min_space_v2 as min_space
import decode_to_list as szhang_deserialize
# import min_space
ds = RS.DiffByteRankSerializer()
def main(args):
count = 0
print('RAW, Msgpack, DiffBytes, DiffBits, DiffBitsNoZip, Min')
with open(arg... | {
"content_hash": "a3765a11ddb41450e63184a693c3880b",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 124,
"avg_line_length": 36.56,
"alnum_prop": 0.4934354485776805,
"repo_name": "szhang-aa/hbase_save_store",
"id": "293f6f1d30039be2ed39fc74941aace181de5cd7",
"size": "1885"... |
from django.shortcuts import render
from django.http import HttpResponse
import json,datetime
from apps.message.models import News
from apps.game.models import Game,PlayerGameProfile,TeamGameProfile
from apps.team.models import Team,TeamProfile,Player,PlayerProfile
from django.contrib.auth import REDIRECT_FIELD_NAME, l... | {
"content_hash": "53fcdaaf1f4832d93bfb83503124ec8a",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 125,
"avg_line_length": 48.08620689655172,
"alnum_prop": 0.6715668698458229,
"repo_name": "zWingz/webbasketball",
"id": "eeeededb969c33da40af5b4c0a712322683d2ba0",
"size": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.