text
stringlengths
4
1.02M
meta
dict
import proto # type: ignore from google.cloud.aiplatform_v1beta1.types import encryption_spec as gca_encryption_spec from google.protobuf import timestamp_pb2 # type: ignore __protobuf__ = proto.module( package="google.cloud.aiplatform.v1beta1", manifest={ "Featurestore", }, ) class Featurest...
{ "content_hash": "306039c779f6bd76844278e5033d3c07", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 103, "avg_line_length": 35.895705521472394, "alnum_prop": 0.5957955904973509, "repo_name": "googleapis/python-aiplatform", "id": "aa7b45e938d4dd7c88259f08a50e3b37dcad72cc", ...
# -*- coding: utf-8 -*- """ Task 703 """ def average_vectors(first_idx, second_idx, clusters): """ rozw """ return [(a+b)/2 for a, b in \ zip(clusters[first_idx].vec, clusters[second_idx].vec)]
{ "content_hash": "fa2b7008f29e8e89f22be201971de392", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 59, "avg_line_length": 29.571428571428573, "alnum_prop": 0.5845410628019324, "repo_name": "katzoo/amu", "id": "9d1b55bd32cbcf3750ae4422ec821299a980218c", "size": "209", "b...
import datetime print('now :', datetime.datetime.now()) print('today :', datetime.datetime.today()) print('utcnow:', datetime.datetime.utcnow()) d = datetime.datetime.now() FIELDS = ['year', 'month', 'day', 'hour', 'minute', 'second', 'microsecond'] for f in FIELDS: print('%15s : %s' % (f, getattr(d, f))) t = ...
{ "content_hash": "5fb28c44d4d32e054a106e5b3f0b1d5a", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 76, "avg_line_length": 26.647058823529413, "alnum_prop": 0.6291390728476821, "repo_name": "eroicaleo/ThePythonStandardLibraryByExample", "id": "8122cedb3f1bb2014b8e76d2afd65f...
from django.forms import ModelForm from django.utils import translation from hvad.admin import TranslatableModelAdminMixin from hvad.forms import translatable_inlineformset_factory, translationformset_factory from hvad.test_utils.testcase import HvadTestCase from hvad.test_utils.project.app.models import Normal, Relate...
{ "content_hash": "6ad11f087ee36b1cd76186d1033267da", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 115, "avg_line_length": 46.57692307692308, "alnum_prop": 0.6439306358381502, "repo_name": "philippeowagner/django-hvad", "id": "956fec7b4edfdf0b4556f31040186947a5cfc486", ...
from utils import parse_args, create_experiment_dirs, calculate_flops, show_parameters from model import ShuffleNet from train import Train from data_loader import DataLoader from summarizer import Summarizer import tensorflow as tf def main(): # Parse the JSON arguments config_args = parse_args() # Crea...
{ "content_hash": "4a47f7ff05ef41f7a4d6a6c08132e61e", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 111, "avg_line_length": 33.11594202898551, "alnum_prop": 0.6603938730853391, "repo_name": "MG2033/ShuffleNet", "id": "84453b3f4053a5f35b87db3a8a599a8976fe187f", "size": "22...
import google.api_core.grpc_helpers from google.cloud.tasks_v2beta3.proto import cloudtasks_pb2_grpc class CloudTasksGrpcTransport(object): """gRPC transport class providing stubs for google.cloud.tasks.v2beta3 CloudTasks API. The transport provides access to the raw gRPC stubs, which can be used to...
{ "content_hash": "b7453ca089e5c836410fc048affac199", "timestamp": "", "source": "github", "line_count": 407, "max_line_length": 83, "avg_line_length": 36.255528255528255, "alnum_prop": 0.6248305773922472, "repo_name": "jonparrott/gcloud-python", "id": "6efcb26ec89d32e567bc32552fd28861ebeb4ea1", "si...
from sentinels import NOTHING __all__ = [ "TypesRegistry", "get_registry" ] class TypesRegistry: def __init__(self): self._mapping = {} self._back = {} def register(self, type_, alias): assert isinstance(type_, type) assert isinstance(alias, type) self._mappi...
{ "content_hash": "460290a7c9a9d459ad62fbd3d243a9df", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 52, "avg_line_length": 21.42105263157895, "alnum_prop": 0.5773955773955773, "repo_name": "Evgenus/versioned-data", "id": "afdb042ff9590f84ee79cb282d8cd0d7a84d359d", "size":...
from urllib2 import urlopen, build_opener, install_opener from urllib2 import Request, HTTPSHandler from urllib2 import URLError, HTTPError from urllib import urlencode import random import datetime import time import uuid import hashlib import socket def generate_uuid(basedata = None): """ Provides a _random_ ...
{ "content_hash": "f90cd5a6344b17f174b9875e859a68b1", "timestamp": "", "source": "github", "line_count": 445, "max_line_length": 139, "avg_line_length": 40.9191011235955, "alnum_prop": 0.6478664396726893, "repo_name": "1987yama3/power-analytics.appspot.com", "id": "9306d642938922e9fbf9462505948b47751a...
from django.urls import path from blog import views urlpatterns = [ path('categories/', views.get_categories, name='get_categories'), path('posts/', views.get_posts, name='get_posts'), path('post/<int:post_id>', views.get_post, name='get_post'), ]
{ "content_hash": "69dc29602da3c4c5801f3020ce4b5b42", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 69, "avg_line_length": 29.11111111111111, "alnum_prop": 0.6755725190839694, "repo_name": "Roba-VRSTU/VRSTU", "id": "4f64110130c74542913bfe99bc10831dcbe2ef3d", "size": "262",...
from __future__ import absolute_import, print_function, unicode_literals from rest_framework.routers import DefaultRouter from djangocms_rest_api.views import PageViewSet, PlaceHolderViewSet, PluginViewSet router = DefaultRouter() router.register(r'pages', PageViewSet, 'page') router.register(r'placeholders', PlaceH...
{ "content_hash": "5413f550fca9da3a26f9698af84c44cb", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 83, "avg_line_length": 38.90909090909091, "alnum_prop": 0.8084112149532711, "repo_name": "divio/djangocms-rest-api", "id": "0dbac5a99ba857cadb23977c772610258d8a683e", "size...
import mimetypes import os import socket from collections import defaultdict from swift import gettext_ as _ from random import shuffle from time import time import functools import sys from eventlet import Timeout import six from swift import __canonical_version__ as swift_version from swift.common import constrai...
{ "content_hash": "485d5883674f17996ad655a4721b590b", "timestamp": "", "source": "github", "line_count": 700, "max_line_length": 79, "avg_line_length": 44.36857142857143, "alnum_prop": 0.5832635713825746, "repo_name": "redbo/swift", "id": "ba0fc58beab3708dfccc5e90a4d276c553b3d715", "size": "31653", ...
import os import json from logging import getLogger from django.conf import settings from django.db import models from django.db.models.signals import post_delete from django.db.models.query import Q from django.utils.translation import ugettext_lazy as _ from django.utils.datastructures import MultiValueDict from dja...
{ "content_hash": "300fff55c58e16023d38df67bd7d69d7", "timestamp": "", "source": "github", "line_count": 288, "max_line_length": 119, "avg_line_length": 35.9375, "alnum_prop": 0.6382608695652174, "repo_name": "pitrho/djangopypi2", "id": "6eb068837264de94f9d8e63bcc80ef6a79ea6160", "size": "10350", ...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'certified'} DOCUMENTATION = """ module: na_ontap_net_subnet short_description: NetApp ONTAP Create, dele...
{ "content_hash": "51854a8972e39040b2377880d94b92e6", "timestamp": "", "source": "github", "line_count": 319, "max_line_length": 143, "avg_line_length": 36.608150470219435, "alnum_prop": 0.5941085802363418, "repo_name": "SergeyCherepanov/ansible", "id": "d38ceaa45c2d6d9f0601572913999d93312f1730", "s...
"""vol volume control in the shell for your mac Usage: vol (in|out|alert) <volume> vol mute vol unmute vol load <profile> vol info vol (-h | --help) vol --version Options: -h --help Show this screen. --version Show version. """ import ConfigParser import os import subpr...
{ "content_hash": "f2dbab0d9feaf1c483f10810f73de16f", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 101, "avg_line_length": 23.552380952380954, "alnum_prop": 0.5458956732713304, "repo_name": "bmaeser/vol", "id": "4189c1032a14966b832afa69a8795f5adce6462c", "size": "2520",...
""" Django settings for latch_demo project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...)...
{ "content_hash": "059256ce24b7c73f65b33ff5a9d6902d", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 71, "avg_line_length": 24.52, "alnum_prop": 0.7210440456769984, "repo_name": "rootedcon/django-latch", "id": "da435d5c563cee2c4aed6562a8033265c43ed119", "size": "2452", ...
"""The tests the cover command line platform.""" import logging import pytest from homeassistant import setup from homeassistant.components.cover import ATTR_POSITION, ATTR_TILT_POSITION, DOMAIN from homeassistant.const import ( ATTR_ENTITY_ID, SERVICE_CLOSE_COVER, SERVICE_CLOSE_COVER_TILT, SERVICE_OP...
{ "content_hash": "9d6b82dc59cf399341f44abb5cd79a51", "timestamp": "", "source": "github", "line_count": 1122, "max_line_length": 103, "avg_line_length": 34.79144385026738, "alnum_prop": 0.4603699149503023, "repo_name": "tchellomello/home-assistant", "id": "5deb540782c05d7569707fe5faeac8763d5cbb6c", ...
import unittest from quickbooks import utils class UtilsTests(unittest.TestCase): def test_build_where_clause(self): where_clause = utils.build_where_clause(field1=1, field2="Someone's Company") self.assertTrue("field1 = 1" in where_clause) ...
{ "content_hash": "4e10103c0d42884eeaf2c28a3250c6be", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 94, "avg_line_length": 44.204081632653065, "alnum_prop": 0.53601108033241, "repo_name": "ZachGoldberg/python-quickbooks", "id": "11afad58746e9779f5ea5ef6973065487bea6041", ...
from shutit_module import ShutItModule import base64 class openshift_secrets(ShutItModule): def build(self, shutit): shutit.send('cd /tmp/openshift_vm') shutit.login(command='vagrant ssh') shutit.login(command='sudo su -',password='vagrant',note='Become root (there is a problem logging in as admin with the va...
{ "content_hash": "7d5eed28cac5b60c57f7d2b7adf7327f", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 135, "avg_line_length": 24.71153846153846, "alnum_prop": 0.669260700389105, "repo_name": "ianmiell/shutit-openshift-vm", "id": "6372bcac12bfe77367883f6f448f8f17b1b33d06", "...
from __future__ import absolute_import, division, print_function import sys from functools import partial from . import converters, exceptions, filters, setters, validators from ._config import get_run_validators, set_run_validators from ._funcs import asdict, assoc, astuple, evolve, has, resolve_types from ._make i...
{ "content_hash": "135ac1a386a2b7c78539a322749882f1", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 70, "avg_line_length": 20.63157894736842, "alnum_prop": 0.6045918367346939, "repo_name": "TeamSPoon/logicmoo_workspace", "id": "bf329cad5c88580c3e1e89ed9196dd58bdf7fe3b", "...
import threading import os import sublime, sublime_plugin from .libs.upyun import UpYun, ED_AUTO import hashlib from .local_settings import * def upload_file(bucket_name, folder_path, filename, fp): """ bucket_name: 空间名称 folder_path: 子目录的绝对路径,比如/wenyouxi/,默认为/(即不使用子目录) filename: 需要存在子目录下的文件名,比如tmp.db ...
{ "content_hash": "94476fc1e72b2ed9a6a840880ad44459", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 115, "avg_line_length": 31.15277777777778, "alnum_prop": 0.6188140882746321, "repo_name": "ritksm/upyun-upload-sublime", "id": "d02251218254732c9699ea35916028d3c5830182", "...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import modelcluster.contrib.taggit import modelcluster.fields class Migration(migrations.Migration): dependencies = [ ('taggit', '0002_auto_20150616_2121'), ('home', '0021_faqpage_ta...
{ "content_hash": "593893df85681695b63ac576f078a66e", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 191, "avg_line_length": 35.170731707317074, "alnum_prop": 0.6033287101248266, "repo_name": "aapris/tilajakamo", "id": "297c4323ae315f444f214e219f751f8e8619832d", "size": "1...
from networking_cisco import backwards_compatibility as bc from networking_cisco.backwards_compatibility import constants as p_const from networking_cisco.backwards_compatibility import ml2_api as api from networking_cisco.plugins.ml2.drivers.cisco.nexus import ( constants as const) from networking_cisco.plugins.m...
{ "content_hash": "534bb2bbeea3cacfa33b10c804ea57cd", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 77, "avg_line_length": 46.252747252747255, "alnum_prop": 0.6284153005464481, "repo_name": "Tehsmash/networking-cisco", "id": "d15a1a8ed71c623a511306cf7c61d4e77d54da07", "si...
import numpy from chainer.functions.normalization._standardize import _standardize from chainer import testing from chainer import utils @testing.parameterize(*testing.product([ [ {'ch_out': 1}, {'ch_out': 5}, ], [ {'size': 10}, {'size': 20}, ], [ {'dtype':...
{ "content_hash": "b7540ed5356834c0190a8ba83522be33", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 78, "avg_line_length": 31.467391304347824, "alnum_prop": 0.5284974093264249, "repo_name": "okuta/chainer", "id": "55d14c6bd4c6d9a73d259b494b5f77ad0b467b05", "size": "2895",...
from ado.model import Model from ado.project import Project from ado.recipe import Recipe class Portfolio(Model): FIELDS = { "alias" : "text", "archived_at" : "timestamp", "created_at" : "timestamp", "description" : "text", "name" : "text" } def projects(self, conn=...
{ "content_hash": "2cc8337964388721123920939c0d41e7", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 102, "avg_line_length": 33.470588235294116, "alnum_prop": 0.5790861159929701, "repo_name": "ananelson/ado", "id": "7db5343335f7de707c8e48c1a9782002edba0a96", "size": "1138"...
import datetime import uuid import freezegun from keystone.common import controller from keystone.common import resource_options from keystone.common import sql from keystone.common import utils import keystone.conf from keystone import exception from keystone.identity.backends import base from keystone.identity.back...
{ "content_hash": "38021a553cce16028bdc879fcc54a0b3", "timestamp": "", "source": "github", "line_count": 903, "max_line_length": 79, "avg_line_length": 46.863787375415285, "alnum_prop": 0.5812656552767144, "repo_name": "ilay09/keystone", "id": "da0a9d593fedd67446a5daa7edd59fbe902f8d3a", "size": "428...
import collections import copy import os import ddt import mock from cinder import context from cinder import exception from cinder.image import image_utils from cinder import test from cinder.tests.unit import fake_snapshot from cinder.tests.unit import fake_volume from cinder import utils from cinder.volume.drivers...
{ "content_hash": "c263f9d534129a75ca4ff85cd9d55e29", "timestamp": "", "source": "github", "line_count": 454, "max_line_length": 78, "avg_line_length": 42.94273127753304, "alnum_prop": 0.5647825194911776, "repo_name": "cloudbase/cinder", "id": "03c403640d063cc42a5a747a89599af3f5026c02", "size": "201...
''' Copyright (C) 2016 Turi All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. ''' from ..data_structures.sarray_builder import SArrayBuilder import unittest import array import datetime as dt from ..util.timezone import GMT class ...
{ "content_hash": "6798955527836b92e88a7b7fe357fb0e", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 108, "avg_line_length": 36.59, "alnum_prop": 0.552063405301995, "repo_name": "TobyRoseman/SFrame", "id": "0a3309cbe3dbd69a58bf7a4cd954353a1060b12e", "size": "3659", "bin...
""" Copyright (c) 2017 by Benjamin Manns This file is part of Statistical Parameter Estimation Tool (SPOTPY). :author: Benjamin Manns This code shows you, how to use the hydroligcal signatures. They can also be implemented in the def objective function. """ from pprint import pprint import spotpy.signatures as sig f...
{ "content_hash": "596c5800ea85ad3b7ed20a1fd402f4c9", "timestamp": "", "source": "github", "line_count": 402, "max_line_length": 119, "avg_line_length": 28.621890547263682, "alnum_prop": 0.5885624891361029, "repo_name": "thouska/spotpy", "id": "9ff1614edf6615462c1b8e04af8b3a41dfb2c931", "size": "115...
from __future__ import unicode_literals from django import VERSION as DJANGO_VERSION from django.middleware.csrf import CsrfViewMiddleware from django.middleware.csrf import _sanitize_token as sanitize_csrf_token if DJANGO_VERSION < (1, 10): from django.middleware.csrf import _get_new_csrf_key as generate_csrf_tok...
{ "content_hash": "189506ec144d0208d6e22fdfd147ac9e", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 81, "avg_line_length": 36.2, "alnum_prop": 0.6660527931246163, "repo_name": "samuelmaudo/yepes", "id": "f321cbbcda0d091766c7a6adcd0ca94ef6a32b4e", "size": "1653", "binary...
class User: def __init__(self, name, email): self.name = name self.email = email
{ "content_hash": "1607ea87d54bd0fdf5a2a1e7281191e1", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 36, "avg_line_length": 25.25, "alnum_prop": 0.5445544554455446, "repo_name": "tiangolo/uwsgi-nginx-flask-docker", "id": "5389428ce4f08eb33f2e85c38a9bad0bd6fc37f5", "size": "...
import unittest import utils from testbin import TestBin class TestBinOsprocci(TestBin, unittest.TestCase): def setUp(self): self.bin = 'osprocci' def tearDown(self): pass
{ "content_hash": "a0556519501bc951ca812fb3c847496e", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 50, "avg_line_length": 18.09090909090909, "alnum_prop": 0.6934673366834171, "repo_name": "ow2-mirrors/compatibleone", "id": "e02d0a8d859cfd8a101839a389ee693fa70047a3", "siz...
from django.conf import settings from django.contrib import messages from django.contrib.auth.decorators import permission_required from django.shortcuts import get_object_or_404, redirect from django.template.response import TemplateResponse from django.utils.translation import pgettext_lazy from ...account.models im...
{ "content_hash": "233832e774796447f0d9743c7eeb9bd1", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 77, "avg_line_length": 38.1123595505618, "alnum_prop": 0.6860259433962265, "repo_name": "UITools/saleor", "id": "b6b156088893b3207c372a1ae008dd3bea905320", "size": "3392", ...
from __future__ import print_function from __future__ import absolute_import # # This file is part of khmer, https://github.com/dib-lab/khmer/, and is # Copyright (C) Michigan State University, 2009-2015. It is licensed under # the three-clause BSD license; see LICENSE. # Contact: khmer-project@idyll.org # # Tests for...
{ "content_hash": "fb50b5e97985e758c04a90e549fca2fb", "timestamp": "", "source": "github", "line_count": 385, "max_line_length": 79, "avg_line_length": 26.955844155844154, "alnum_prop": 0.6215070341106186, "repo_name": "Winterflower/khmer", "id": "d60d8bd580caca332eabed8d104123f81317c90d", "size": "...
"""Evaluation functionality for GLO NeRF Model.""" from typing import Any, Iterator from absl import logging import einops from flax import jax_utils import gin import jax import jax.numpy as jnp from jax3d.projects.generative.nerf import camera as jax_camera from jax3d.projects.generative.nerf import metrics from j...
{ "content_hash": "58c9fc1dd26b999815c00ee34070f86a", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 80, "avg_line_length": 36.19512195121951, "alnum_prop": 0.6824797843665769, "repo_name": "google-research/jax3d", "id": "9d54fb6169590bf397aaf6d42ca5dbc3af0a5691", "size":...
from implicittest import * def check(a, b): if a != b: raise RuntimeError(str(a) + " does not equal " + str(b)) def is_new_style_class(cls): return hasattr(cls, "__class__") #### Class #### # No implicit conversion check(1, A(1).get()) check(2, A(1.0).get()) check(3, A(B()).get()) check(4, A("hell...
{ "content_hash": "f3c5b69612944632fc5d6074578548e4", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 116, "avg_line_length": 19.58450704225352, "alnum_prop": 0.6339446242358864, "repo_name": "DEKHTIARJonathan/BilletterieUTC", "id": "4646d08c0059bff49dde0419c2254bc01ecc63b8"...
import sys import os import pyjswidgets import pyjswaddons sys.path += [os.path.dirname(pyjswidgets.__file__), os.path.dirname(pyjswaddons.__file__), ] from pyjs.runners import RunnerManager #TODO: very ugly to self-import and setattr(self) ... remove ASAP! import pyjd pyjdversion = '0.9' _manager = ...
{ "content_hash": "1f48f553aa9de71a123354f858a25aeb", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 66, "avg_line_length": 21.866666666666667, "alnum_prop": 0.711890243902439, "repo_name": "Hasimir/pyjs", "id": "4a51466d3649065831ac008538018c312a5c1f36", "size": "656", ...
""" Logistic Regression """ # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # Fabian Pedregosa <f@bianp.net> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Manoj Kumar <manojkumarsivaraj334@gmail.com> # Lars Buitinck # Simon Wu <s8wu@uwaterloo.ca> # ...
{ "content_hash": "abd02dab7653baf7c6a5229ca3639eb7", "timestamp": "", "source": "github", "line_count": 1757, "max_line_length": 79, "avg_line_length": 39.135458167330675, "alnum_prop": 0.6006893442503745, "repo_name": "jakobworldpeace/scikit-learn", "id": "196d7f697d0e8a1efde71b3860555e94a0600112", ...
import smtplib from constants import SMTPSecureConnection from models import User from models import SystemOption from models import EmailJob # Import the email modules we'll need from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.mime.base import MIMEBase from...
{ "content_hash": "7439c65c6c5a0b5a3f67920f0eb70db5", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 115, "avg_line_length": 35.305882352941175, "alnum_prop": 0.6034655114961679, "repo_name": "smjurcak/csm", "id": "117401cef360eb22388c9f51c27a42ccec779b42", "size": "4516",...
import logging import uuid from typing import List, Optional from flask_appbuilder import const as c from flask_appbuilder.models.sqla import Base from flask_appbuilder.models.sqla.interface import SQLAInterface from sqlalchemy import and_, func, literal from sqlalchemy.orm.exc import MultipleResultsFound from werkzeu...
{ "content_hash": "24d7a432ebac3dc18c5cc78e537fb4c3", "timestamp": "", "source": "github", "line_count": 571, "max_line_length": 110, "avg_line_length": 36.49036777583187, "alnum_prop": 0.5783739681320791, "repo_name": "danielvdende/incubator-airflow", "id": "8ee1d900f6ce09a876d5401bd1fbc78c5e14ec0c",...
from hyperstream.stream import StreamInstance, StreamMetaInstance from hyperstream.tool import MultiOutputTool class AssetSplitter(MultiOutputTool): def __init__(self, element=None): """ Special tool to extract data from the asset channel :param element: The element to extract """ ...
{ "content_hash": "30950b3e6c9600e2dfee51f6be57586c", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 115, "avg_line_length": 45.411764705882355, "alnum_prop": 0.6813471502590673, "repo_name": "IRC-SPHERE/HyperStream", "id": "e1a7778aabb43e5c314edd643f5f1b7215b39adb", "size...
import pytest from run_dtox import run class TestNoToxIni: def test_dtox_empty_params(self): r = run(expect_error=True) assert r.returncode != 0 assert r.stdout == "using CODE_DIR=/code\n" assert r.stderr == "ERROR: toxini file 'tox.ini' not found\n" assert r.files_after...
{ "content_hash": "38cd3e32e29460d947e1042bd9bf2b83", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 75, "avg_line_length": 29.72222222222222, "alnum_prop": 0.5429906542056074, "repo_name": "realcundo/docker-tox", "id": "26d5a5ed9fbfab4577f16e0951014e97447740c6", "size": "...
import json import math import os import numpy import rasterio from affine import Affine from rasterio import features from rasterio.warp import transform_geom def rasterize_geojson(geojson, template_path, out_path, crs=None, save_geojson=False): """ Creates transition spatial multipliers from a GeoJSON dict...
{ "content_hash": "e72e208b4a5280b73ad787f9a35fcb5a", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 105, "avg_line_length": 33.84146341463415, "alnum_prop": 0.6113513513513513, "repo_name": "consbio/landscapesim", "id": "fa3e87bde4eff3b211dd7579f41c33d54a4a1c61", "size":...
from nose.tools import * from antwort.lexer import AntwortLexer from antwort.parser import AntwortParser def assert_not_none(obj): assert_not_equal(obj, None) mute = True # call tests with -vs def log(fn): if mute: return fn def w(*args, **kwargs): s = args[0] print(s.next()) ...
{ "content_hash": "cf2851918257685193c6c0fda2b3e6ee", "timestamp": "", "source": "github", "line_count": 392, "max_line_length": 81, "avg_line_length": 32.224489795918366, "alnum_prop": 0.6401994933502216, "repo_name": "cessor/antwort", "id": "2784ad760cd5d749099dd5dc1ccad528e74309ed", "size": "1266...
import datetime from django.utils import six from django.utils.six.moves.urllib import parse from django.views.generic import ListView, DetailView from django.shortcuts import redirect, get_object_or_404 from django.contrib.syndication.views import Feed from django.core import urlresolvers from widgy.utils import bui...
{ "content_hash": "5414fe440b26f0413cd0b39c87522cad", "timestamp": "", "source": "github", "line_count": 294, "max_line_length": 113, "avg_line_length": 32.33673469387755, "alnum_prop": 0.6229094351530451, "repo_name": "fusionbox/django-widgy-blog", "id": "0d09911dbbf047792c36af8565bb6256551f058f", ...
from django.conf import settings from django.urls import reverse from django.db import models as django_db_models from django.shortcuts import get_object_or_404 from django.utils.translation import get_language from rest_framework import serializers as rest_serializers from rest_framework import serializers as rest_fi...
{ "content_hash": "3bc9eacc707d391b3e7dee5434a6b30c", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 96, "avg_line_length": 38.680851063829785, "alnum_prop": 0.672992299229923, "repo_name": "makinacorpus/Geotrek", "id": "dd76f5f9637d2f7feab97438180fbd538727ab22", "size": "...
import sys sys.path.insert(0,'..') DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) MANAGERS = ADMINS DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = 'dev' # Or path to database file...
{ "content_hash": "846194aa94f79af93f44271336d7ec2e", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 108, "avg_line_length": 34.74074074074074, "alnum_prop": 0.7043354655294953, "repo_name": "justquick/django-synagg", "id": "1bb3c94ebd337efab6027e9159c0a5d0f76aa9b7", "size...
import unittest from mock import Mock, patch from mangrove.errors.MangroveException import DataObjectNotFound from mangrove.form_model.form_submission import FormSubmission from mangrove.form_model.field import HierarchyField, GeoCodeField, ShortCodeField from mangrove.form_model.form_model import LOCATION_TYPE_FIELD_N...
{ "content_hash": "d5b55826f7aa9fcb809b21a1f5d1dc6c", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 162, "avg_line_length": 48.666666666666664, "alnum_prop": 0.7207586933614331, "repo_name": "ICT4H/dcs-mangrove", "id": "d9eb14d83d0e1b746e23adb86f0c44751c223e19", "size": ...
from pbr import version version_info = version.VersionInfo('mistral') version_string = version_info.version_string
{ "content_hash": "3497ae5720b5faeee2be9395101ff128", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 45, "avg_line_length": 29, "alnum_prop": 0.8017241379310345, "repo_name": "dmitryilyin/mistral", "id": "f3abddf6d1f51b17f6d508e5adcf618dfbb4e3f7", "size": "750", "binary":...
""" MIT License Copyright (c) 2016 Jesse Hogan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, d...
{ "content_hash": "bf125702b96b5b1c7db07db3395f90c1", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 78, "avg_line_length": 35.63492063492063, "alnum_prop": 0.6770601336302895, "repo_name": "jhogan/epiphany-py", "id": "5984ca994d9556edd5ca6dd232ad11eedc3c8510", "size": "22...
import re from datetime import datetime from typing import Any, Dict, List from django.http import HttpRequest, HttpResponse from django.utils.translation import ugettext as _ from zerver.decorator import api_key_only_webhook_view from zerver.lib.actions import check_send_stream_message from zerver.lib.exceptions imp...
{ "content_hash": "31b11961cdc76046dd8e2d6a8a4da931", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 83, "avg_line_length": 40.620253164556964, "alnum_prop": 0.6625116858834528, "repo_name": "mahim97/zulip", "id": "a1b89221528e8e224134303b7c4bc1a3683cff73", "size": "3247",...
import os import shutil from b3.project_filesystems import ProjectFilesystemBase class DefaultProjectFilesystem(ProjectFilesystemBase): """This class incapsulates file system utils relative to the project root.""" def __init__(self, config): ProjectFilesystemBase.__init__(self, config) def read_file(self...
{ "content_hash": "38d947cbf74516c1c2aa61bebd6fc8b9", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 79, "avg_line_length": 26.072727272727274, "alnum_prop": 0.6659693165969317, "repo_name": "robionica/b3", "id": "de319b0e0ffe3924329c7831824534e3de6abd97", "size": "2057", ...
import sys sys.stderr.buffer.write(b"\xe2" * 2048) sys.stderr.buffer.write("foo bar baz".encode("utf8")) sys.stderr.flush() sys.exit(1)
{ "content_hash": "50e9bc6e7db79aec0ea23c17ff660f52", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 53, "avg_line_length": 19.714285714285715, "alnum_prop": 0.7101449275362319, "repo_name": "JoelMarcey/buck", "id": "2a53103e6e996b8a9c0534b78d13f1c02926fd5b", "size": "162",...
from instr.base import TemperatureController class Sci9700(TemperatureController): """ Scientific Instruments Model 9700""" def __init__(self, rsrc=None, timeout_sec=5, reset=True): idn = 'Scientific Instruments,9700' self._channel = 'A' super().__init__(rsrc, idn, timeout_sec, reset)...
{ "content_hash": "33c6e0127dd9e04073121db6c0577f9f", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 79, "avg_line_length": 25.09090909090909, "alnum_prop": 0.5320048309178744, "repo_name": "wataash/Instr", "id": "4b63e9df5820e7888a7c787896fb86107b387d5b", "size": "1658", ...
from hwt.hdl.constants import Time from hwt.hdl.types.bits import Bits from hwt.interfaces.intf_map import IntfMap from hwt.interfaces.std import BramPort_withoutClk, VldSynced, RegCntrl, \ VectSignal, Signal from hwt.interfaces.utils import addClkRstn, propagateClkRstn from hwt.simulator.simTestCase import SimTest...
{ "content_hash": "d112b5d22b17aae4117f0c3c8629eaee", "timestamp": "", "source": "github", "line_count": 357, "max_line_length": 87, "avg_line_length": 29.285714285714285, "alnum_prop": 0.597608799617408, "repo_name": "Nic30/hwtLib", "id": "fd239fdb02c942ced41565fca27c132cc02d5ee6", "size": "10503",...
__author__ = 'tspycher' import mongoengine class Aerodrome(mongoengine.Document): code = mongoengine.StringField(max_length=4, required=True, primary_key=True, unique=True) name = mongoengine.StringField(required=True) msl = mongoengine.IntField(default=0) def __str__(self): return "%s - %s" %...
{ "content_hash": "d151d7caee0698af7cf25a6ecee000f7", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 94, "avg_line_length": 31.363636363636363, "alnum_prop": 0.6898550724637681, "repo_name": "tspycher/pyaeromanager", "id": "8d6206ab6b63c1d7f9b8814ae035be78dc5b98d0", "size"...
"""Control flow statements: loops, conditionals, etc. Note: most of these operators accept pairs of get_state/set_state functions, to capture mutations that the corresponding code blocks might make. These mutations only need to be captured when staging the control flow, and they just work when reverting to Python beha...
{ "content_hash": "7b200ffc41982868203a0f5c0b3dc19b", "timestamp": "", "source": "github", "line_count": 1017, "max_line_length": 113, "avg_line_length": 35.45132743362832, "alnum_prop": 0.6781771786764298, "repo_name": "jhseu/tensorflow", "id": "c75356eaa3f3b6443e282103a135239fcc5d0787", "size": "3...
import os import sys from distutils.dir_util import mkpath from nn.layer import DOUBLEMAX from util.common import JTensor from util.common import JavaValue from util.common import callBigDlFunc from util.common import callJavaFunc from util.common import get_spark_context if sys.version >= '3': long = int uni...
{ "content_hash": "f53cd1a3458b44773a77e06fd304f964", "timestamp": "", "source": "github", "line_count": 539, "max_line_length": 104, "avg_line_length": 36.896103896103895, "alnum_prop": 0.6310152360838739, "repo_name": "psyyz10/BigDL", "id": "9e015c62ce15e0744241a5f08a0a6367d6a35222", "size": "2047...
import sys sys.path.append('../pinance') from pytz import timezone from datetime import datetime, timedelta from __init__ import Pinance symbol = "AMD" stock = Pinance(symbol) # Stock stock.get_quotes() print(stock.quotes_data) # News stock.get_news() print(stock.news_data) # Option stock.get_options('2017-05-05...
{ "content_hash": "c050efeb1a672412269e717460bb744c", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 40, "avg_line_length": 16.272727272727273, "alnum_prop": 0.7262569832402235, "repo_name": "neberej/pinance", "id": "ceb0740b04be5f0f9d60f8273dd95483362c0da2", "size": "360"...
from flask import request, session, abort, current_app, redirect, url_for from werkzeug import generate_password_hash import database from datetime import datetime import pprint from time import strptime ### About ### def update_about(): about = { "sitename": request.form["sitename"], "description...
{ "content_hash": "e652fff9dfe744b68619f96797e2b518", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 75, "avg_line_length": 24.29032258064516, "alnum_prop": 0.6092297476759628, "repo_name": "thebetabox/orthrus", "id": "d6020fa88777abeece63f018eb14b5d5e2d1841d", "size": "3...
from django.core.exceptions import PermissionDenied from django.shortcuts import get_object_or_404 from wagtail.admin.forms.pages import PageViewRestrictionForm from wagtail.admin.modal_workflow import render_modal_workflow from wagtail.core.models import Page, PageViewRestriction def set_privacy(request, page_id): ...
{ "content_hash": "533e5b0836e4ea88458d964c2456cb38", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 86, "avg_line_length": 40.15277777777778, "alnum_prop": 0.6046350743687305, "repo_name": "takeflight/wagtail", "id": "2efc9b44dbe1ae337aec57c2d2e734a9d28c9bc3", "size": "28...
import logging if __name__ == '__main__': logging.basicConfig() _log = logging.getLogger(__name__) import unittest import pyxb.binding.datatypes as xsd class Test_anyURI (unittest.TestCase): def testRange (self): self.fail("Datatype anyURI test not implemented") if __name__ == '__main__': unittest...
{ "content_hash": "42095047d05424bcd06a037453b9958e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 57, "avg_line_length": 25.23076923076923, "alnum_prop": 0.6646341463414634, "repo_name": "pabigot/pyxb", "id": "9af8f81449d624462c85acfd3277e044365deac6", "size": "352", ...
"""Tests for training routines.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import tempfile import numpy as np from tensorflow.contrib.keras.python import keras from tensorflow.python.platform import test try: import h5py # pylint:dis...
{ "content_hash": "16d91e0bad4a37d747afe9b97aa75d16", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 76, "avg_line_length": 31.106145251396647, "alnum_prop": 0.6287715517241379, "repo_name": "zycdragonball/tensorflow", "id": "99fd6e1cbe1bbcb6494a06bf26d06edd03f4507b", "si...
from django_jinja import library from ..jinja import SendinBlueExtension library.extension(SendinBlueExtension)
{ "content_hash": "41c8b7220d27be0e4b678a5d33c9ba7b", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 40, "avg_line_length": 28.5, "alnum_prop": 0.8508771929824561, "repo_name": "apihackers/wagtail-sendinblue", "id": "20e8be3b28cfd53f1bb979278f237f5d3016731d", "size": "178",...
import uuid from contracts import Contract, Context, fields, timezone from contracts.exceptions import ValidationError from contracts.utils import missing from datetime import datetime, date from unittest import TestCase class BaseTestCase(TestCase): def _dump_equal(self, field, input_value, expected_value): ...
{ "content_hash": "50feea08b5f4e1b781b576d4d08cf07a", "timestamp": "", "source": "github", "line_count": 599, "max_line_length": 133, "avg_line_length": 37.93823038397329, "alnum_prop": 0.6137293729372937, "repo_name": "viniciuschiele/contracts", "id": "bcabce3cfa9b6b77335623206a1d32bb32ebf4d1", "si...
import mock from ironicclient.common import cliutils from ironicclient.tests.unit import utils import ironicclient.v1.driver as v1_driver import ironicclient.v1.driver_shell as d_shell class DriverShellTest(utils.BaseTestCase): def setUp(self): super(DriverShellTest, self).setUp() client_mock = m...
{ "content_hash": "390d00803e63d3e790360041a092cf6a", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 77, "avg_line_length": 36.361111111111114, "alnum_prop": 0.6140183346065698, "repo_name": "NaohiroTamura/python-ironicclient", "id": "5f9a0f5f69edb4c056fdbd11a777edeab608f64...
__version__ = "4.0.0-dev" from pymemcache.client.base import Client # noqa from pymemcache.client.base import PooledClient # noqa from pymemcache.client.hash import HashClient # noqa from pymemcache.client.base import KeepaliveOpts # noqa from pymemcache.exceptions import MemcacheError # noqa from pymemcache.exc...
{ "content_hash": "3b3fc3e14a0e27b188532bbf4dc0dfa4", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 70, "avg_line_length": 49.785714285714285, "alnum_prop": 0.830703012912482, "repo_name": "sontek/pymemcache", "id": "436fe2620357ed35d1c636aa7029389500358386", "size": "697...
"""Principal Component Analysis Base Classes""" # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Denis A. Engemann <denis-alexander.engemann@inria.fr> # Kyle Kastner <kastnerkyle@gmail.com> ...
{ "content_hash": "c6e1661b37d169d502f23137046cdd6c", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 79, "avg_line_length": 34.82993197278912, "alnum_prop": 0.5986328125, "repo_name": "ryfeus/lambda-packs", "id": "b944d23d3388d2cc9525f0cb99b7a88636b2a25d", "size": "5120",...
from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpR...
{ "content_hash": "f831a94024f5866aa04a0b64ce2e48af", "timestamp": "", "source": "github", "line_count": 433, "max_line_length": 231, "avg_line_length": 49.210161662817555, "alnum_prop": 0.6444058569551342, "repo_name": "Azure/azure-sdk-for-python", "id": "5f47caaaf3684c99aecc79297099adb09e8ab281", ...
from django.core.management.base import BaseCommand from boto.s3.storage import S3Storage class Command(BaseCommand): def handle(self, *args, **kwargs): s3 = S3Storage(bucket='another-bucket', key='another-key', secret='another-secret', location='EU') # ... print('...
{ "content_hash": "830fb5c0e285935dfa7022b489d22f43", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 66, "avg_line_length": 30.636363636363637, "alnum_prop": 0.6231454005934718, "repo_name": "tweekmonster/moult", "id": "6546df92045ad858834d0c400e4500b39d7db077", "size": "3...
""" This is a unit test class used to validate how qdrouterd behaves with different command line arguments combinations, in order to ensure it won't break, causing bad experiences to the users. """ import os import signal from subprocess import PIPE, STDOUT from system_test import TestCase, Qdrouterd, main_module, Pro...
{ "content_hash": "1232e3fbcad369392fbf1346dd2821e6", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 152, "avg_line_length": 36.41549295774648, "alnum_prop": 0.5846064590988204, "repo_name": "ted-ross/qpid-dispatch", "id": "5165046c26f7a0b121411022566164f83b950639", "size...
from flask import Flask from flask.ext.restful import Api, Resource, request, abort import redis import nlevel app = Flask(__name__) api = Api(app) r = redis.Redis() def flat_dict(d): return {k: v[0] for k, v in dict(d).items()} class NodeListResource(Resource): def get(self, key=None): if key: ...
{ "content_hash": "88c55fb53368acb82d7966875a0f7768", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 71, "avg_line_length": 22, "alnum_prop": 0.6121212121212121, "repo_name": "benwilber/nlevel", "id": "61ec3651d2a2bea3f2b7c1d21a48adf0ada9c0fa", "size": "991", "binary": f...
import six from distutils.core import Extension, setup from distutils.sysconfig import get_config_vars ehata_module = Extension('ehata_its', sources = ['its/ExtendedHata.cpp', 'its/FindHorizons.cpp', 'its/FindQuantile.cpp'...
{ "content_hash": "3570596ff2fa9e304b6d40d3afa6c809", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 88, "avg_line_length": 47.3, "alnum_prop": 0.5116279069767442, "repo_name": "Wireless-Innovation-Forum/Spectrum-Access-System", "id": "0cba090063793388cec7792ede22b5e735e3487...
default_app_config = 'inline_images.startup.InlineImageConfig'
{ "content_hash": "e01c52e93c5a81490dfb6475eeda6b06", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 62, "avg_line_length": 63, "alnum_prop": 0.8253968253968254, "repo_name": "PrincessTeruko/TsunArt", "id": "696d1805be07db0b46fa1b95742edc8f26a831eb", "size": "63", "binary...
"""OpenStack logging handler. This module adds to logging functionality by adding the option to specify a context object when calling the various log methods. If the context object is not specified, default formatting is used. Additionally, an instance uuid may be passed as part of the log message, which is intended ...
{ "content_hash": "4a11e9905c742b419505480a92553b62", "timestamp": "", "source": "github", "line_count": 701, "max_line_length": 78, "avg_line_length": 36.63623395149786, "alnum_prop": 0.589401136983101, "repo_name": "moshele/old-networking-mlnx", "id": "d2d7d67d3991b72529f40f0da02fb12e717bbeb4", "s...
from tempest.api.image import base from tempest.common.utils import data_utils from tempest.lib import exceptions as lib_exc from tempest import test class MetadataNamespacesTest(base.BaseV2ImageTest): """Test the Metadata definition Namespaces basic functionality""" @test.idempotent_id('319b765e-7f3d-4b3d-8...
{ "content_hash": "c634def02cf85720dcbe58e5688515cb", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 76, "avg_line_length": 52.345454545454544, "alnum_prop": 0.5560958666203543, "repo_name": "bigswitch/tempest", "id": "de8299e41e25c85c0db477fb5ce1abfde0bfe4a0", "size": "35...
#!/usr/bin/env python # # Copyright 2005 Google Inc. All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of...
{ "content_hash": "1047211dfd814b27e56887d4cf1ef4f2", "timestamp": "", "source": "github", "line_count": 592, "max_line_length": 80, "avg_line_length": 32.47804054054054, "alnum_prop": 0.6568887501950382, "repo_name": "cp16net/virgo-base", "id": "4e9556b773886a11aa12daaaa7cef29489a12285", "size": "1...
class Dataset(list): info = {} def __init__(self, data=[]): super(Dataset, self).__init__(data) class LazyDataset(Dataset): def __init__(self, lazy_functions): super(LazyDataset, self).__init__() self.lazy_functions = lazy_functions def __iter__(self): return self.laz...
{ "content_hash": "e6f497618803a467aa3d2c2e32a4b28d", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 48, "avg_line_length": 24.714285714285715, "alnum_prop": 0.5722543352601156, "repo_name": "SMART-Lab/mldata", "id": "914a3c137001c4f08f3fb8b8cf6bd784fbfbda33", "size": "372...
""" The acssum module contains a function `acssum` that calls the ACSSUM executable. Use this function to facilitate batch runs of ACSSUM. Examples -------- >>> from acstools import acssum >>> acssum.acssum('*flt.fits', 'combined_image.fits') For help usage use ``exe_args=['--help']`` """ # STDLIB import os import ...
{ "content_hash": "d765847fa7d900400618a719b9b8920c", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 80, "avg_line_length": 27.08695652173913, "alnum_prop": 0.615569823434992, "repo_name": "jhunkeler/acstools", "id": "569f65de075ad9d190c2859214723cc8d955017a", "size": "249...
from datetime import datetime from django.conf import settings from django.contrib.auth.models import User from django.db import models from kitsune.sumo.models import ModelBase, LocaleField from kitsune.sumo.urlresolvers import reverse from kitsune.sumo.utils import auto_delete_files class Media(ModelBase): ""...
{ "content_hash": "45696438842b643e3fa88eda3991138d", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 79, "avg_line_length": 41.5974025974026, "alnum_prop": 0.6749921948173587, "repo_name": "dbbhattacharya/kitsune", "id": "8bab10d15c457f1c8e4de527bf68502d626e8a02", "size": ...
import numpy as np import scipy as sp import logging class KernelStandardizer(object): ''' A KernelStandardizer is a class such as :class:`.DiagKtoN` and :class:`.Identity` to be used by the :meth:`.KernelData.standardize` to standardize Kernel data. It always works in-place *and* returns the :class:`.Kern...
{ "content_hash": "15af9aad59d75d124652501aef113700", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 163, "avg_line_length": 37.96875, "alnum_prop": 0.6757201646090535, "repo_name": "MicrosoftGenomics/PySnpTools", "id": "faf65a08e4ceb2ce3d6da2d96f92b5e83d503725", "size": "...
"""Test conformance to the specs.""" from .compat import unittest, is_python2 import semantic_version # shortcut Version = semantic_version.Version class FormatTests(unittest.TestCase): """Tests proper version validation.""" def test_major_minor_patch(self): ### SPEC: # A normal version nu...
{ "content_hash": "e5fe086b5295394f18cbc84bcb041e98", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 131, "avg_line_length": 36.86754966887417, "alnum_prop": 0.5884677564217712, "repo_name": "pombredanne/python-semanticversion", "id": "43c9d6a5dcb255be85fda8724f4adbbc1d991f...
"""Download and unzip the target file to the destination.""" from __future__ import print_function import os import sys import tempfile import zipfile import requests def main(): if len(sys.argv) != 3: print("Usage: python download_and_unzip.py [zipfile-url] [destination]") sys.exit(1) down...
{ "content_hash": "717ff650d6cf120efd3babfcd906f74c", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 80, "avg_line_length": 27.97142857142857, "alnum_prop": 0.6036772216547498, "repo_name": "jtattermusch/grpc", "id": "440572691fda77cb6a3f31b8a308610ff945a1d2", "size": "155...
from __future__ import annotations import json from datetime import datetime import boto3 from airflow import DAG from airflow.decorators import task from airflow.models.baseoperator import chain from airflow.providers.amazon.aws.operators.s3 import ( S3CreateBucketOperator, S3CreateObjectOperator, S3Del...
{ "content_hash": "bca95a123b317d6fc3bf3edad735435f", "timestamp": "", "source": "github", "line_count": 284, "max_line_length": 129, "avg_line_length": 33.16197183098591, "alnum_prop": 0.6345296241240178, "repo_name": "apache/airflow", "id": "1e2d43b83d9a767e38e27e4b90638cce84ffbfad", "size": "1020...
""" Chebfun module ============== Vendorized version from: https://github.com/pychebfun/pychebfun/blob/master/pychebfun The rational for not including this library as a strict dependency is that it has not been released. .. moduleauthor :: Chris Swierczewski <cswiercz@gmail.com> .. moduleauthor :: Olivier Verdier <ol...
{ "content_hash": "1ac15c1660585efb66d4f2ded0136493", "timestamp": "", "source": "github", "line_count": 780, "max_line_length": 755, "avg_line_length": 34.46153846153846, "alnum_prop": 0.5493675595238096, "repo_name": "CalebBell/fluids", "id": "ec47a00fa2a1905fc76b71ed3195d84484d5d850", "size": "26...
import sqlite3 as lite import configparser config = configparser.ConfigParser() config.read('deaddrop.ini') database = config['Options']['Database'] con = lite.connect(database) cur = con.cursor() with con: cur.executescript(''' DROP TABLE IF EXISTS files; CREATE TABLE files(id INTEGER PRIMARY KEY, offset INT,...
{ "content_hash": "fb5323bbc0d72b21954a537682556666", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 67, "avg_line_length": 22.833333333333332, "alnum_prop": 0.7250608272506083, "repo_name": "freesideatlanta/deaddrop", "id": "accff3e54d3c88f8998c2f23a02435f8b6d75b3e", "siz...
from os import path from collections import namedtuple import click import graphviz from functional import seq ENGINES = ['dot', 'neato', 'twopi', 'circo', 'fdp', 'sfdp', 'patchword', 'osage'] Edge = namedtuple('Edge', 'left right label') def split_edge(edge): edge_label = None if ':' in edge: edge, ...
{ "content_hash": "7b561d5e6b7a204dae6dcd2d5f5075e0", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 88, "avg_line_length": 37.91525423728814, "alnum_prop": 0.6338846669646848, "repo_name": "EntilZha/pygraph", "id": "7709eda5367ddfaa36385f41751cf91eaf80c7c5", "size": "2237...
import proto # type: ignore __protobuf__ = proto.module( package="google.ads.googleads.v11.enums", marshal="google.ads.googleads.v11", manifest={"OptimizationGoalTypeEnum",}, ) class OptimizationGoalTypeEnum(proto.Message): r"""Container for enum describing the type of optimization goal. """ ...
{ "content_hash": "11b99c0e22952abb648c42270843c09c", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 68, "avg_line_length": 24.541666666666668, "alnum_prop": 0.6519524617996605, "repo_name": "googleads/google-ads-python", "id": "07e95baf813cd0295995bf678cb22026ca3637cc", "...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from targets_builder import TARGETSBuilder import os import fnmatch import sys from util import ColorString # tests to export as libraries for inclusion in other project...
{ "content_hash": "f114840028b1a563a18b4b303ad695ee", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 97, "avg_line_length": 30.56140350877193, "alnum_prop": 0.5746268656716418, "repo_name": "fceller/arangodb", "id": "a5d71b65d4e7ee2a35a959f41e8f98be81ad093c", "size": "529...
"""Support for a ScreenLogic heating device.""" import logging from screenlogicpy.const import DATA as SL_DATA, EQUIPMENT, HEAT_MODE from homeassistant.components.climate import ClimateEntity from homeassistant.components.climate.const import ( ATTR_PRESET_MODE, CURRENT_HVAC_HEAT, CURRENT_HVAC_IDLE, C...
{ "content_hash": "6292b2a528d41b263696da7d996d14c5", "timestamp": "", "source": "github", "line_count": 220, "max_line_length": 100, "avg_line_length": 33.93636363636364, "alnum_prop": 0.6082239485668364, "repo_name": "kennedyshead/home-assistant", "id": "b83d2fe03cabafeb5c2c5bc3963f0bee10e6239a", ...
""" ================================ Equivalent Potential Temperature ================================ Use functions from `metpy.calc` as well as pint's unit support to perform calculations. The code below uses example data from our test suite to calculate the equivalent potential temperature over the provided soundi...
{ "content_hash": "17d91fb03d060f9dadb88c2416ce6d36", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 91, "avg_line_length": 37.870370370370374, "alnum_prop": 0.6122249388753056, "repo_name": "Unidata/MetPy", "id": "403cb2e8cfd098257c48db542a770d6989bccb54", "size": "2183",...
from office365.sharepoint.client_context import ClientContext from office365.sharepoint.tenant.administration.sharing_capabilities import SharingCapabilities from tests import test_user_credentials target_site_url = "https://mediadev8.sharepoint.com/sites/team" admin_client = ClientContext(target_site_url).with_crede...
{ "content_hash": "347f4bfc8a9fc82faa02a24ddf076c50", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 118, "avg_line_length": 63.916666666666664, "alnum_prop": 0.8070404172099087, "repo_name": "vgrem/Office365-REST-Python-Client", "id": "eac5251be762fd051ef77f8cb45136440bea48...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='USER', fields=[ ('id', models.AutoField(auto_create...
{ "content_hash": "92bb408e87d903ae2138012d331d4c25", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 114, "avg_line_length": 29.04, "alnum_prop": 0.5564738292011019, "repo_name": "meliora000/eb_django_app", "id": "aa7db91b325fa5a39de0fb4724d24a59e219621c", "size": "796", ...
from setuptools import find_packages, setup setup( name='ngx-task', version='0.2', description='Testimonial for candidates to show up their code-foo', author='Dmitry Shulyak', author_email='dmitri.shulyak@gmail.com', url='https://github.com/shudmi/ngx-task', classifiers=[ 'License :...
{ "content_hash": "f21c2993296f222ceff0c4372ede8b43", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 71, "avg_line_length": 29.53846153846154, "alnum_prop": 0.61328125, "repo_name": "shudmi/ngx-task", "id": "146c1666119fadc456f5d10b33d1c9d62344c5a7", "size": "768", "bina...
""" Routines for filling missing data. """ from __future__ import annotations from functools import ( partial, wraps, ) from typing import ( TYPE_CHECKING, Any, cast, ) import numpy as np from pandas._libs import ( algos, lib, ) from pandas._typing import ( ArrayLike, Axis, F,...
{ "content_hash": "7a30d535fd266932621a41b211475f04", "timestamp": "", "source": "github", "line_count": 972, "max_line_length": 88, "avg_line_length": 29.616255144032923, "alnum_prop": 0.6006530725674784, "repo_name": "rs2/pandas", "id": "9e85cbec0f29920c9422c397147429f2f7b2efd4", "size": "28787", ...
import pandas as pd from six.moves import cPickle as pickle colnames = ['heading', 'link', 'topic', 'source', 'content'] fileName = '/home/prakarsh_upmanyu23/filtered_art/20minutes-fr-Spider-data_26136-34848_politique.csv' #fileName = "/home/prakarsh_upmanyu23/filtered_art/concatenated_27269.csv" df1=pd.read_csv(fileN...
{ "content_hash": "baf939edb47d1b3aa0d2431e11a44d37", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 125, "avg_line_length": 38.357142857142854, "alnum_prop": 0.7392923649906891, "repo_name": "silicon-beach/news-in-short", "id": "60c593ac84f7914bfc93b6b94f3147ba32fd1ac5", ...
''' This tool is intended to monitor BillGates botnet control commands. This module can communicate with "Gates" servers. "Gates" module is usually called cupsdd or sfewfesfs. ''' from __future__ import print_function import socket import time import re import struct from pprint import pprint def myprint(*args, **kwa...
{ "content_hash": "62a085a8041532f46962e1944d20ab62", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 96, "avg_line_length": 27.695121951219512, "alnum_prop": 0.567591369440775, "repo_name": "ValdikSS/billgates-botnet-tracker", "id": "050a449d6b619ec80e8d733a16e939a4b43f506b"...
from test.support import run_unittest from test.test_math import parse_testfile, test_file import unittest import os, sys import cmath, math from cmath import phase, polar, rect, pi INF = float('inf') NAN = float('nan') complex_zeros = [complex(x, y) for x in [0.0, -0.0] for y in [0.0, -0.0]] complex_infinities = [co...
{ "content_hash": "82f9439d2d37a74c229983b3837544cf", "timestamp": "", "source": "github", "line_count": 486, "max_line_length": 80, "avg_line_length": 38.306584362139915, "alnum_prop": 0.5442874791856905, "repo_name": "MalloyPower/parsing-python", "id": "3c34fecd90492b58d764e65bb7c3db23f4ae3e76", "...
import logging import sys import time from eventlet import event from eventlet import greenthread from cinder.openstack.common._i18n import _LE, _LW LOG = logging.getLogger(__name__) # NOTE(zyluo): This lambda function was declared to avoid mocking collisions # with time.time() called in the standard l...
{ "content_hash": "9de268ba756bfadfea5a9539bbd8e6a8", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 79, "avg_line_length": 30.7, "alnum_prop": 0.5357053370082686, "repo_name": "yanheven/cinder", "id": "efe2e97deeba3d5c94440811ee40cf6c0e8f9cb2", "size": "4761", "binary"...
import argparse import datetime import os import re import sys from collections import defaultdict ################################################################################ # Argument Parser ################################################################################ DESCRIPTION = """Python script to help...
{ "content_hash": "e4a69c0cb4a87593344c6338f8e35f91", "timestamp": "", "source": "github", "line_count": 432, "max_line_length": 168, "avg_line_length": 35.3587962962963, "alnum_prop": 0.5359083469721767, "repo_name": "mmitche/coreclr", "id": "4db689a98260e09807ae5b21383316dbf43d2faf", "size": "1574...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/mission/quest_item/shared_sayama_edosun_q2_needed.iff" result.attribute_template_id = -1 result.stfName("loot_nboo_n","sayama_edosun_q2_needed") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### ...
{ "content_hash": "ebd48a09f6379c197ef8b3f62ab5f458", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 90, "avg_line_length": 25.846153846153847, "alnum_prop": 0.7053571428571429, "repo_name": "obi-two/Rebelion", "id": "ee53df6e68baf6643b2dee433777fe973190f9dd", "size": "481...