text
stringlengths
4
1.02M
meta
dict
"""empty message Revision ID: 932c6631a9d2 Revises: 17dc0b76c2c6 Create Date: 2016-10-14 13:13:58.447691 """ # revision identifiers, used by Alembic. revision = "932c6631a9d2" down_revision = "17dc0b76c2c6" from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - ...
{ "content_hash": "1245087e59e56fecff9185e71bc3d0c3", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 84, "avg_line_length": 23.423076923076923, "alnum_prop": 0.6880131362889984, "repo_name": "DBeath/flask-feedrsub", "id": "a13829ff7c976f8f12f83725aa3b7f8888703648", "size":...
import os import json import string import readline import itertools import collections TEST_DIR = os.path.dirname(__file__) ROOT_DIR = os.path.dirname(TEST_DIR) SRC_DIR = os.path.join(ROOT_DIR, "src") addr_to_name = {} name_to_addr = {} element_lists = collections.defaultdict(list) breakpoints = set() def completer...
{ "content_hash": "78d6060f8117ec5d497d0c430e481792", "timestamp": "", "source": "github", "line_count": 181, "max_line_length": 83, "avg_line_length": 25.795580110497237, "alnum_prop": 0.5322338830584707, "repo_name": "acleasby/lnav", "id": "9267444de320bddbf568a0248747f3fd9a25bf2e", "size": "6198"...
from django.conf.urls import url from multilingual_survey import views urlpatterns = [ url(r'^(?P<slug>[\w-]+)/$', views.survey_form, name='form'), url(r'^success/(?P<uuid>\w+)/$', views.survey_success, name='success'), ]
{ "content_hash": "5498e28532d2e389de6ff5b81e56e1e7", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 75, "avg_line_length": 29, "alnum_prop": 0.646551724137931, "repo_name": "diadzine/django-simple-multilingual-survey", "id": "5962b50553b092cc3cd51061b0e946554eb393df", "siz...
"""Implements a feed-forward neural net.""" import gzip import logging import sys import time import csv from google.protobuf import text_format from memory_profiler import * from datahandler import * from convolutions import * from edge import * from layer import * from util import * from logistic_layer import * from...
{ "content_hash": "687dc640297106bfb4fe5063a1d765e9", "timestamp": "", "source": "github", "line_count": 874, "max_line_length": 148, "avg_line_length": 42.504576659038904, "alnum_prop": 0.5497052410562868, "repo_name": "kobiso/ControlledDropout", "id": "f46aa01da950fc01d97c02fafa494e1fe419c4a1", "s...
from .list import List from .array import Array from .tree import Tree from .graph import Graph from .cartesian import Cartesian
{ "content_hash": "b6d3f205f700e58dfafb0586a202b997", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 32, "avg_line_length": 25.6, "alnum_prop": 0.8125, "repo_name": "alviproject/alvi", "id": "20c022c352756f0a00441e159192c1cc049ee02f", "size": "128", "binary": false, "co...
import re import pytest from pytest_embedded import Dut @pytest.mark.esp32 @pytest.mark.esp32c3 def test_partition_mmap_example(dut: Dut) -> None: # ESP_ERROR_CHECK or assert will cause abort on error and "Example end" won't be received message_list = (rb'Written sample data to partition: ESP-IDF Partition M...
{ "content_hash": "69321af671977e46fbe7e8891b8ec62d", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 114, "avg_line_length": 38.8421052631579, "alnum_prop": 0.6476964769647696, "repo_name": "espressif/esp-idf", "id": "e77d29fe5bc72cf12e33a289277d58ae9ef3e349", "size": "854...
from mox import IsA # noqa from django.core.urlresolvers import reverse # noqa from django.core.urlresolvers import reverse_lazy # noqa from django import http from horizon.workflows import views from openstack_dashboard import api from openstack_dashboard.api import lbaas from openstack_dashboard.test import hel...
{ "content_hash": "1d25d76a62546d82eebe0372e46fedcb", "timestamp": "", "source": "github", "line_count": 839, "max_line_length": 79, "avg_line_length": 38.80333730631705, "alnum_prop": 0.5684973583978375, "repo_name": "Havate/havate-openstack", "id": "37b456310d27a1a626d2335b65ec5f17733184ed", "size...
"""Caching of formatted files with feature-based invalidation.""" import os import pickle import tempfile from pathlib import Path from typing import Dict, Iterable, Set, Tuple from platformdirs import user_cache_dir from _black_version import version as __version__ from black.mode import Mode # types Timestamp = f...
{ "content_hash": "d120d42cff256518a52a870162a1fd14", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 88, "avg_line_length": 30.371134020618555, "alnum_prop": 0.6578411405295316, "repo_name": "psf/black", "id": "9455ff4477250b78e279040124dcc7215e2e351b", "size": "2946", "...
''' mali_extract.py - ====================================================== :Author: Andreas Heger :Release: $Id$ :Date: |today| :Tags: Python Purpose ------- .. todo:: describe purpose of the script. Usage ----- Example:: python mali_extract.py --help Type:: python mali_extract.py --help for co...
{ "content_hash": "810633131d183d823af4ca5bd5fb700f", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 108, "avg_line_length": 23.37323943661972, "alnum_prop": 0.5438385055739681, "repo_name": "CGATOxford/Optic", "id": "e755f0a4ca0eae7876e297797ad5d34c3f668131", "size": "33...
import itertools import re from optparse import OptionParser from bigdl.dataset import news20 from bigdl.nn.layer import * from bigdl.nn.criterion import * from bigdl.optim.optimizer import * from bigdl.util.common import * from bigdl.util.common import Sample def text_to_words(review_text): letters_only = re.su...
{ "content_hash": "1dde017ef77d000213c5483740e34f72", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 91, "avg_line_length": 34.96341463414634, "alnum_prop": 0.591384722706662, "repo_name": "jenniew/BigDL", "id": "922ac4a2aefdd390e3f4d948264d6541fbc74529", "size": "6322", ...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Version.supports_python3' db.add_column('package_version', 'supports_python3', self.gf('django...
{ "content_hash": "b1951f73024725ed85a6bc2a0b398584", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 206, "avg_line_length": 77.712, "alnum_prop": 0.5541486514309244, "repo_name": "miketheman/opencomparison", "id": "373d6c5f7f42fcb5a4fa909cbb8984c9d6cd2519", "size": "9738...
""" Sample Python/Pygame Programs Simpson College Computer Science http://programarcadegames.com/ http://simpson.edu/computer-science/ Explanation video: http://youtu.be/4YqIKncMJNs Explanation video: http://youtu.be/ONAK8VZIcI4 Explanation video: http://youtu.be/_6c4o41BIms """ import pygame ...
{ "content_hash": "e7d2e96c93c99abc8cf5102c4887beb0", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 64, "avg_line_length": 21.295081967213115, "alnum_prop": 0.648960739030023, "repo_name": "treefroog/SQ42-Clone", "id": "06f77f7514849ecca5743edbc2579ddb4e94a679", "size": "...
import logging import logging.config import os.path from configparser import ConfigParser import os def load_config() -> ConfigParser: app_config = ConfigParser() app_config.read_dict({ 'bot': {'token': os.getenv('CF_BOT_TOKEN')}, 'db': {'url': os.getenv('CF_DB_URL')}, 'updates': {'mo...
{ "content_hash": "9f68b2aec08ce8b9a7182fdd944d2f68", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 88, "avg_line_length": 24.108695652173914, "alnum_prop": 0.6889089269612263, "repo_name": "telegram-bots/telegram-channels-feed", "id": "f5ed41a5e0a9029cc2cd363a5ff2fac45b5e1...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('web', '0002_auto_20160818_0509'), ] operations = [ migrations.AddField( model_name='song', name='play_count', fi...
{ "content_hash": "cc072e073d46603b04c884e91caad938", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 72, "avg_line_length": 22, "alnum_prop": 0.5934343434343434, "repo_name": "appendjeff/pianobar-client", "id": "416f8463dab8b6531496d293d42abd5b2bcc8e6e", "size": "467", "...
from django import template from ..views import BrokenException register = template.Library() @register.simple_tag def go_boom(arg): raise BrokenException(arg)
{ "content_hash": "95a203a0d99ad192c9818a12bf9f473b", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 35, "avg_line_length": 17.8, "alnum_prop": 0.7247191011235955, "repo_name": "yephper/django", "id": "407e74c5c2675d92a206e5ff9e55f04bf0a98d44", "size": "178", "binary": f...
import os import sys # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # sys.path.insert(0, os.path.abspath('.')) # -- General con...
{ "content_hash": "8b22e5f7f8c90c02f87e9f45ba30cb74", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 80, "avg_line_length": 31.263358778625953, "alnum_prop": 0.6918569161274569, "repo_name": "MartinThoma/lumixmaptool", "id": "e0a61e40cfc2c46ad08e049d657c96fc0eb87793", "si...
from utils.base_estimator import BaseEstimator import numpy as np import matplotlib.pyplot as plt import seaborn as sns np.random.seed(2046) def euclidean_distance(x, y): return np.sqrt(np.sum((x - y) ** 2)) class KMeans(BaseEstimator): """Partition a dataset into K clusters. Finds clusters by repeatedl...
{ "content_hash": "93f7ea1860d064f9f93f193c8f25577c", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 119, "avg_line_length": 37, "alnum_prop": 0.625945945945946, "repo_name": "transedward/ml-playground", "id": "95e45df8b6fc11a0ec82a6e5dde3e2e6055201bb", "size": "3700", ...
"""Sensor from an SQL Query.""" import datetime import decimal import logging import sqlalchemy from sqlalchemy.orm import scoped_session, sessionmaker import voluptuous as vol from homeassistant.components.recorder import CONF_DB_URL, DEFAULT_DB_FILE, DEFAULT_URL from homeassistant.components.sensor import PLATFORM_...
{ "content_hash": "7342816d40d39b22d9ec087b7cfada31", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 88, "avg_line_length": 31.375, "alnum_prop": 0.600996015936255, "repo_name": "adrienbrault/home-assistant", "id": "a537b160d0b367e7ed5216f7a9894ec20df90468", "size": "5020...
import codecs, json, networkx as nx, operator, os, unittest import databasic.logic.connectthedots as ctd import databasic.logic.filehandler as filehandler from csvkit import table from functools import reduce class ConnectTheDotsTest(unittest.TestCase): """ Unit testing suite for ConnectTheDots """ de...
{ "content_hash": "d2a35774f1ed6e9de2bbf9311826d335", "timestamp": "", "source": "github", "line_count": 246, "max_line_length": 116, "avg_line_length": 43.142276422764226, "alnum_prop": 0.588429284839348, "repo_name": "c4fcm/DataBasic", "id": "b2c15a0a5618283f39e414b9b7d7e6af6a275363", "size": "106...
""" sir.py: Example of a Susceptible-Infectious-Recovered epidemiological cellular automaton model implemented on a hexagonal grid using stochastic pair-transition rules. GT Sep 2014 """ from __future__ import print_function _DEBUG = False import time from landlab import HexModelGrid from numpy import where, logi...
{ "content_hash": "f34165993e6535136c329b79335496ee", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 101, "avg_line_length": 33.27439024390244, "alnum_prop": 0.577240241891149, "repo_name": "landlab/pub_tucker_etal_gmd", "id": "2dc316e906b220f806117f1c8f3aa61155ce7ef1", "...
: from .template import page : from . import table_class, table_style, caption_args : from .helpers.helpers import aa_link : import datetime : def whatsnewtemplate title, ctx, days, newlist : using page title, ctx, lang="en" <div class='container'> <div class='row table-responsive'> <div c...
{ "content_hash": "5de64116e8901cebec7175d16f41a254", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 159, "avg_line_length": 43.42424242424242, "alnum_prop": 0.5694347522679692, "repo_name": "bmillham/djrq2", "id": "9207382008250926fbcec34b9f46ad4e17ef3600", "size": "1452"...
from __future__ import print_function, division, absolute_import # Non-std. lib imports from PySide.QtGui import QErrorMessage error = QErrorMessage() def toolTipText(text): '''Creates text for a tool tip''' return '<html>'+text+'</html>'
{ "content_hash": "9f4a15792f5d15cdf0b9e02dd33acda1", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 64, "avg_line_length": 25, "alnum_prop": 0.708, "repo_name": "jensengrouppsu/rapid", "id": "30c8d279f3efd4b8025f490f95d2a27cb9aa7f28", "size": "250", "binary": false, "...
import struct from ryu.base import app_manager from ryu.controller.handler import MAIN_DISPATCHER from ryu.controller.handler import set_ev_cls from ryu.ofproto import ofproto_v1_0 from ryu.lib import dpid as dpid_lib from ryu.lib import stplib from ryu.lib.mac import haddr_to_str from ryu.lib.packet import packet fro...
{ "content_hash": "4ff35c88d8b5a848a0165477fcbe2ba4", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 90, "avg_line_length": 35.796875, "alnum_prop": 0.6047577477084243, "repo_name": "ArthurFreitas/Projeto_redes", "id": "1ba41529957149fac30a8bfd52db709f874efece", "size": "...
import requests, json def getSong(artist, title): ''' This function creates a search of the artist and title. By using Spotify's API we can search through Spotify's library and return the result. If there is no match en error-message will appear. ''' searchQuery = artist + " " + title searchQuery = search...
{ "content_hash": "481bd6e36249a704bbff2b53d583c491", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 204, "avg_line_length": 38.170212765957444, "alnum_prop": 0.6549609810479375, "repo_name": "mariaholmberg283/WebbtjansterGruppDiggarn", "id": "f2e3a7150db4f9ae3d0ed3e2ba15603...
"""Tests for autoreload extension. """ #----------------------------------------------------------------------------- # Copyright (c) 2012 IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #---------...
{ "content_hash": "40b86be6eca6a0fb6d10775e840f00e6", "timestamp": "", "source": "github", "line_count": 327, "max_line_length": 92, "avg_line_length": 28.69724770642202, "alnum_prop": 0.5346334185848253, "repo_name": "mattvonrocketstein/smash", "id": "3bd7afb0769bd09aca8d4b6fe8a6638384caf434", "siz...
from oslo_log import log as logging from django.core.exceptions import ValidationError from django.utils import safestring from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms from horizon import workflows from openstack_dashboard.api import neutron from sah...
{ "content_hash": "795b6ea03e0def891aa8f6a4354dce51", "timestamp": "", "source": "github", "line_count": 448, "max_line_length": 79, "avg_line_length": 35.20982142857143, "alnum_prop": 0.5703689615823507, "repo_name": "openstack/sahara-dashboard", "id": "0208911862a0166f18320c587f5836f43ed04011", "s...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: vmware_evc_mode short_description: Enable/Disable EVC mode on...
{ "content_hash": "466a91ff6f6ec0afbb2ea31d17df7be2", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 140, "avg_line_length": 35.43805309734513, "alnum_prop": 0.5962042701960295, "repo_name": "thaim/ansible", "id": "935d356e3ad4d304e3ac236523d733ea21935104", "size": "8204"...
import sys import traceback from flask import Flask, request import requests app = Flask(__name__) def safeget(d, keys, default=None): for key in keys: try: d = d[key] except KeyError: return default except TypeError: return default return d @app.route("/", methods=['GET']) def index(*args, **kwargs...
{ "content_hash": "5969a43d44c7e9cfab990b925467d3f9", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 120, "avg_line_length": 29.87837837837838, "alnum_prop": 0.6395296246042514, "repo_name": "markwal/TrivialForecastIoFlask", "id": "7dbf9a9f5cdc633635abbf4a1dba73d9715471d1", ...
import csv from scripts.base import QcatApiMixin class QcatDataCsv(QcatApiMixin): """ Store QCAT API data as CSV. """ def check_local_questionnaires(self, local_questionnaires): if local_questionnaires: # Sanity check self._check_attribute_length(local_questionnaires[...
{ "content_hash": "5c7fa0116dd288d6156a9864fd48e2f2", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 80, "avg_line_length": 39.93150684931507, "alnum_prop": 0.5588336192109777, "repo_name": "CDE-UNIBE/qcat-api-scripts", "id": "deb214fe1ef7b41d27bef7bf48d39464f3ff7b90", "si...
from __future__ import annotations import os import shutil from typing import Sequence from airflow.compat.functools import cached_property from airflow.exceptions import AirflowException, AirflowSkipException from airflow.hooks.subprocess import SubprocessHook from airflow.models.baseoperator import BaseOperator fro...
{ "content_hash": "81ca70ef4e41f56b39a2326f8a2c00c4", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 110, "avg_line_length": 39.3027027027027, "alnum_prop": 0.630999862467336, "repo_name": "apache/airflow", "id": "d50733bafa33ff10ce114763a3f08f03a717ecf3", "size": "8058",...
from GracePlot import * import math p = GracePlot() # A grace session opens l1=Line(type=lines.none) x1=map(lambda x:x/10.,range(0,100)) y1=map(math.sin,x1) y2=map(math.cos,x1) d2=Data(x=x1,y=y1, symbol=Symbol(symbol=symbols.circle,fillcolor=colors.red), line=l1) d3=Data(x=x1,y=y2, symbol=S...
{ "content_hash": "34118d3c46c58a265427e6a3b00d902e", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 85, "avg_line_length": 28.857142857142858, "alnum_prop": 0.6992574257425742, "repo_name": "rhambach/EELcalc", "id": "0ee5cea8cea489faf6b3b1f837c0261249bffa06", "size": "808...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('bus', '0008_auto_20170314_1412'), ] operations = [ migrations.AlterField( model_name='busdestinationarea', name='area_name',...
{ "content_hash": "6b4f9c954e3ee35c9bb7651baaa2d3c9", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 284, "avg_line_length": 44.26086956521739, "alnum_prop": 0.5677799607072691, "repo_name": "warlock57/bus_reservation", "id": "17fee95496fd3081f551e1f9448b110f404ac294", "si...
''' Paste a small image into a big one. ----------------------------------------------------------- (c) 2013 Allegra Via and Kristian Rother Licensed under the conditions of the Python License This code appears in section 18.4.1 of the book "Managing Biological Data with Python". ------------------------...
{ "content_hash": "47cc12fdcf52d467d208e34e7cc42359", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 59, "avg_line_length": 27.105263157894736, "alnum_prop": 0.5359223300970873, "repo_name": "raymonwu/Managing_Your_Biological_Data_with_Python_3", "id": "9dc847ce2ea0e8f7cc390...
"""Models for API objects""" from datetime import datetime import re import ticketpy def _assign_links(obj, json_obj, base_url=None): """Assigns ``links`` attribute to an object from JSON""" # Normal link strucutre is {link_name: {'href': url}}, # but some responses also have lists of other models. # ...
{ "content_hash": "db0d08e26259ef75ade37f54af431983", "timestamp": "", "source": "github", "line_count": 544, "max_line_length": 79, "avg_line_length": 31.38051470588235, "alnum_prop": 0.5160799015874875, "repo_name": "arcward/ticketpy", "id": "eb35a0ee513efaebf41d330b07090993230257e5", "size": "170...
"""Script to extract the fst between two populations. Usage: python3 fst_to_genomic_score.py 1 2 < popoolation2.fst > pop1_2.fst Output is chr, pos, fst """ import sys from numpy import sqrt def triangular_number(number): '''Finds if a number is triangular, and if so, computer the base of that triangle. It i...
{ "content_hash": "347233d7f1cced5f47ef5ebdd684e73e", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 80, "avg_line_length": 28.44047619047619, "alnum_prop": 0.5985768103809125, "repo_name": "jlanga/smsk_popoolation", "id": "253d39da8b0be7312e647c412aef5511377f958b", "size"...
from django.conf.urls import url from django.conf.urls import include from django.contrib import admin from django.contrib.sitemaps.views import sitemap from django.urls import path from blog.sitemap import HomePageSiteMap from blog.sitemap import PostSiteMap from blog.sitemap import StaticSiteMap app_name = "core" ...
{ "content_hash": "11ae7a1478405e2e0a8c96b69f0a880a", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 56, "avg_line_length": 21.870967741935484, "alnum_prop": 0.6932153392330384, "repo_name": "andreztz/DjangoBlog", "id": "20742670dc905f01825a9e0f6040bcc2fb83785a", "size": "...
import numpy as np import logging from maskgen.cv2api import cv2api_delegate import maskgen from maskgen import video_tools def createOutput(in_file, out_file): cap = cv2api_delegate.videoCapture(in_file) out_file = out_file fourcc = 0 fps = cap.get(cv2api_delegate.prop_fps) height = int(np.rint(ca...
{ "content_hash": "62fc6118988bd4dedac60793be9da650", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 117, "avg_line_length": 34.298701298701296, "alnum_prop": 0.5804619462324877, "repo_name": "rwgdrummer/maskgen", "id": "b1bab4fc93382177e7eac132e445b21cf821247b", "size": "...
import rospy import os import sys from sensor_msgs.msg import Image, CameraInfo import numpy import cv2 from cv_bridge import CvBridge import pickle # gonna need a pickle class ImageHandler(): """ Holds Image msgs """ def __init__(self, image_topic): self.have_image = False self.bridge = CvBri...
{ "content_hash": "dde49adf1fb3acf9055839de68b2de1b", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 131, "avg_line_length": 31.547619047619047, "alnum_prop": 0.5916981132075472, "repo_name": "OSUrobotics/privacy-interfaces", "id": "fbbcd213a666ccc5aae2a1c11cb7c3362fc716dd",...
import datetime import os import re import hashlib, json from flask import Flask, jsonify, send_from_directory from flask.ext.compress import Compress from geoalchemy2.shape import from_shape from shapely.geometry import box, MultiPolygon from prop_xfer.models import db, Transfer app = Flask("prop_xfer", static_url_pa...
{ "content_hash": "43d26fa36d5527155c310066653c9b22", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 133, "avg_line_length": 38.006211180124225, "alnum_prop": 0.5587514299722177, "repo_name": "rcoup/sot14-property-backend", "id": "a15fe92485f7da045cb429d99640e2e5d440b390", ...
import importlib.metadata import json import platform import sys import click import pytest from click.testing import CliRunner import dask import dask.cli def test_version(): runner = CliRunner() result = runner.invoke(dask.cli.cli, ["--version"]) assert result.exit_code == 0 assert result.output =...
{ "content_hash": "6291ca5276473298ffeb102fff348c33", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 84, "avg_line_length": 22.88785046728972, "alnum_prop": 0.6512862392813393, "repo_name": "dask/dask", "id": "2adab2b77dac72a96897f33ef277289498945be5", "size": "2449", "...
import random import os import re import numpy as np from sklearn.feature_extraction.text import CountVectorizer from sklearn import linear_model from sklearn import tree from sklearn import svm # PUT POLARITY DATASET PATH HERE POLARITY_PATH = '/Users/marcotcr/phd/datasets/multi_domain_polarity/' def LoadDataset(datase...
{ "content_hash": "37da3e6929524e087ed7092aa95378c0", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 93, "avg_line_length": 43.763636363636365, "alnum_prop": 0.6622351474864977, "repo_name": "marcotcr/lime-experiments", "id": "8a61455c998a322ec885384a1e9fa6fd914aa377", "si...
'''Immutable types ''' __all__ = ['frozendict'] class frozendict(dict): '''Immutable dictionary. ''' def __setitem__(self, *args, **kwargs): raise TypeError("frozendict object does not support item assignment") setdefault = __delitem__ = clear = pop = popitem = __setitem__ def update(self, *args):...
{ "content_hash": "a5ac1e4965a75442e8c60f9758beb32b", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 82, "avg_line_length": 21.676470588235293, "alnum_prop": 0.5956580732700135, "repo_name": "rsms/smisk", "id": "137e48a78ea7322eab32a16835f1f9d622a096d8", "size": "755", "...
import re import json class WordsCounter(object): """ This class counts used words in phrases and put all info to the usage statistics. """ @classmethod def load_from_json(cls, file_name): """Method loads words usage statistics from a json file. :param file_name: name of a file for l...
{ "content_hash": "44cd5344efc5a863b904ab976f24b2c3", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 97, "avg_line_length": 38.37078651685393, "alnum_prop": 0.6128843338213763, "repo_name": "sergeymironov0001/twitch-chat-bot", "id": "1e0e6df570e567efd4debe52076472a4bc890bf7"...
logger.info("Loading 0 objects to table contacts_role...") # fields: id, type, person, company loader.flush_deferred_objects()
{ "content_hash": "0a9261c650407f988ff3496ace9cd414", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 58, "avg_line_length": 32, "alnum_prop": 0.7421875, "repo_name": "lino-framework/book", "id": "30e9c3a16d40cbd8b99f0d3d1da3428254b43780", "size": "152", "binary": false, ...
from utils import crawl_folder from utils import TCustomCounter import chardet LIB_SECTION_FIELD = "lib_section" DEFAULT_ENCODING = "windows-1251" class TIndexingObjectField(object): def __init__(self, field_id, field_value, field_file_path): self.field_id = field_id self.field_file_p...
{ "content_hash": "2d82f2ab7d300a531edb5a699bccb1bd", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 113, "avg_line_length": 44.076190476190476, "alnum_prop": 0.5108038029386344, "repo_name": "mavlyutovrus/light_search", "id": "4bab60871bc0995a1905224f97fd04f37f97c54b", "...
from __future__ import absolute_import from __future__ import print_function from functools import wraps from django.core.cache import cache as djcache from django.core.cache import caches from django.conf import settings from django.db.models import Q from django.core.cache.backends.base import BaseCache from typin...
{ "content_hash": "ab821ecf996333e53dfec77916133008", "timestamp": "", "source": "github", "line_count": 439, "max_line_length": 133, "avg_line_length": 38.84282460136674, "alnum_prop": 0.6407459535538353, "repo_name": "SmartPeople/zulip", "id": "0e0dc54c495683ca83d634c4a20e954451d84403", "size": "1...
class Solution: def invertTree(self, root: TreeNode) -> TreeNode: if root is None: return None # temp_node = root.left # root.left = self.invertTree(root.right) # root.right = self.invertTree(temp_node) # return root # You can choose whether to do it muta...
{ "content_hash": "b39a1505c8bd47d3ba2a06b5d17d1311", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 70, "avg_line_length": 39.357142857142854, "alnum_prop": 0.6225045372050817, "repo_name": "zubie7a/Algorithms", "id": "6386e8b75a250bacf4060ca1538e72afe4a58871", "size": "9...
"""llvm Tool-specific initialization for LLVM """ # # Copyright (c) 2009 VMware, Inc. # # 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 ...
{ "content_hash": "d9354d11cffc9584b9e9010602ea56ab", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 96, "avg_line_length": 40.53157894736842, "alnum_prop": 0.5987534086482275, "repo_name": "gzorin/RSXGL", "id": "57fe922d0ae65e3ed65b57ad7c52b8a39978b911", "size": "7701", ...
from os.path import splitext import common import logging import sys logger = logging.getLogger(__name__) logger.addHandler(logging.NullHandler()) logger.propagate = False logger.setLevel(logging.INFO) # inputs are files of gzip format def main(inputs, prefix=None): input_filenames = inputs # uses last ex...
{ "content_hash": "07a0ed62fa14d0cd3271d3d839930f1d", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 109, "avg_line_length": 24.609756097560975, "alnum_prop": 0.6154608523290387, "repo_name": "ENCODE-DCC/pipeline-container", "id": "9d2a1df571f06cd563e24b42c074551805559f16", ...
''' Created on Oct 2, 2013 @author: olehlong ''' from client.GLChat import GLChatView from nc.TreeParityMachine import TreeParityMachine, create_vector, TPMManager import logging def main(): logging.basicConfig(level=logging.DEBUG, format='%(levelname)-8s %(message)s') clist = GLChatView() clist.s...
{ "content_hash": "7d0b045d5beb10f1b2e35a8bb8dac307", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 83, "avg_line_length": 19.7, "alnum_prop": 0.6725888324873096, "repo_name": "olehlong/xmpp-neural-cryptography", "id": "a2591a16e35943293bee4ee3920277b6f9999b51", "size": "...
import logging from airavata_sdk.clients.tenant_profile_client import TenantProfileClient from airavata_sdk.clients.keycloak_token_fetcher import Authenticator from airavata.api.error.ttypes import TException logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) authenticator = Authenticator(); token...
{ "content_hash": "4693638562f5d7c4feb5b6edbdf12db8", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 97, "avg_line_length": 27.45945945945946, "alnum_prop": 0.7332677165354331, "repo_name": "apache/airavata", "id": "a1b56128d696701e296f1b5ae9facc217203c589", "size": "1812"...
from linot.Plugins.TwitchNotifier.TwitchEngine import TwitchEngine from nose.tools import ok_ import requests TWITCH_REST = 'https://api.twitch.tv/kraken' class TestTwitchEngine: def setUp(self): self.twitch = TwitchEngine() def testGetChannels(self): followed_channels = self.twitch.getChann...
{ "content_hash": "78a4100c997cfaf00bfd03942d9d7327", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 106, "avg_line_length": 40.05555555555556, "alnum_prop": 0.6079519186315303, "repo_name": "hpeter/Linot", "id": "bc0bc58586028ef2671c0f4f2bdbaefe9c0c0fcd", "size": "2163", ...
import datetime import os import re import shlex import subprocess import unittest.mock as mock import pytest import marge.git from marge.git import GIT_SSH_COMMAND # pylint: disable=attribute-defined-outside-init @mock.patch('marge.git._run') class TestRepo: def setup_method(self, _method): self.repo ...
{ "content_hash": "3f83d7bb19aa20f108831d9ce9607247", "timestamp": "", "source": "github", "line_count": 310, "max_line_length": 110, "avg_line_length": 36.851612903225806, "alnum_prop": 0.6100315126050421, "repo_name": "smarkets/marge-bot", "id": "c41b71feffe4b385d0e32266d9100e2b13f7f39c", "size": ...
import os import errno import time import datetime import re import socket import imp from fabric.api import task, warn, put, puts, get, local, run, execute, \ settings, abort, hosts, env, runs_once, parallel, hide import config from internalutil import _list, mkdir_p, valid_dir from hostint import get_address_pai...
{ "content_hash": "dab440d70b2f6c932580a7190e0613cf", "timestamp": "", "source": "github", "line_count": 5202, "max_line_length": 148, "avg_line_length": 43.85928489042676, "alnum_prop": 0.5405161380809621, "repo_name": "knneth/teacup", "id": "6f70491af363e180c3800ce2839a6281a134d876", "size": "2297...
import logging import re import argparse import service_conf from http.cookies import SimpleCookie from urllib.parse import parse_qs import sys from saml2 import BINDING_HTTP_REDIRECT from saml2 import BINDING_SOAP from saml2 import time_util from saml2 import ecp from saml2 import BINDING_HTTP_ARTIFACT from saml2 im...
{ "content_hash": "ac1b3605bff6b50ba64ff559b7c9a728", "timestamp": "", "source": "github", "line_count": 738, "max_line_length": 82, "avg_line_length": 35.48780487804878, "alnum_prop": 0.5369606720122184, "repo_name": "rohe/pysaml2-3", "id": "ea83982a387c775685d0fcd353d627d959a39360", "size": "26213...
import math import struct import pyboof import numpy as np import py4j.java_gateway as jg from pyboof.common import * from pyboof.calib import * class ConfigEssentialMatrix(JavaConfig): def __init__(self, java_object=None): if java_object is None: JavaConfig.__init__(self, "boofcv.factory.geo....
{ "content_hash": "8c3dcf26ca6d104982f2c04c818cfd04", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 100, "avg_line_length": 34.5, "alnum_prop": 0.6590958252217175, "repo_name": "lessthanoptimal/PyBoof", "id": "bb146f96f63e048ba48cbc05179db292a8ae8ff8", "size": "4623", ...
"""Various PEST(++) control file peripheral operations""" from __future__ import print_function, division import os import warnings import multiprocessing as mp import re import numpy as np import pandas as pd pd.options.display.max_colwidth = 100 import pyemu from ..pyemu_warnings import PyemuWarning # formatters #...
{ "content_hash": "071b5ab25b37dacc6de62e8db2e0e73e", "timestamp": "", "source": "github", "line_count": 1817, "max_line_length": 110, "avg_line_length": 35.23720418271877, "alnum_prop": 0.5041077062443382, "repo_name": "jtwhite79/pyemu", "id": "7dbd71789c49abafb3cb99b85121079fb71be30f", "size": "64...
@profile def biglist(): list_ = [] for i in range(0, 1000000): list_.append(i) return list_ biglist()
{ "content_hash": "4f7ddd39e452ac58c8bf4c9230add60e", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 28, "avg_line_length": 15.142857142857142, "alnum_prop": 0.6415094339622641, "repo_name": "jphall663/bellarmine_py_intro", "id": "dcf6b457ac8fae5e205c2ae6499f58f20727dc56", ...
''' Encapsulate implicit state that is useful for Bokeh plotting APIs. .. note:: While ``State`` objects can also be manipulated explicitly, they are automatically configured when the functions :func:`~bokeh.io.output_file`, etc. from :ref:`bokeh.io` are used, so this is not necessary under typical usa...
{ "content_hash": "14a4ea9686c686183d7293ddf6f0480f", "timestamp": "", "source": "github", "line_count": 236, "max_line_length": 96, "avg_line_length": 31.991525423728813, "alnum_prop": 0.5176158940397351, "repo_name": "dennisobrien/bokeh", "id": "962762e3fd6ae39fdc81397c7d7c23d16c601a98", "size": "...
"""Tests for the MacKeeper Cache database plugin.""" import unittest # pylint: disable=unused-import from plaso.formatters import mackeeper_cache as mackeeper_cache_formatter from plaso.lib import event from plaso.lib import timelib_test from plaso.parsers.sqlite_plugins import mackeeper_cache from plaso.parsers.sqli...
{ "content_hash": "3a2704c9bf6ecbec6db20adbd84f3f70", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 80, "avg_line_length": 37.23076923076923, "alnum_prop": 0.7283057851239669, "repo_name": "iwm911/plaso", "id": "80f2366ce25239398606c2520755de96a2496dbd", "size": "2634", ...
from kivy.support import install_twisted_reactor install_twisted_reactor() ### Simple twisted Client to Controll my Local Tinkerforge from twisted.internet import reactor, protocol class EchoClient(protocol.Protocol): def connectionMade(self): self.factory.app.on_connection(self.transport) def dataR...
{ "content_hash": "792deec3df650ee8acd1bdc4168e8ac8", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 68, "avg_line_length": 30.2, "alnum_prop": 0.6512141280353201, "repo_name": "DeathPoison/roomControll", "id": "301e1ebfff16f671f4fe8bcb7ebba1b917f33149", "size": "2356", ...
from __future__ import unicode_literals, absolute_import class Type(dict): def __init__(self, type_name): super(Type, self).__init__() self.type_name = type_name self["type"] = self._build_dict() def _build_dict(self): return { "value": self.type_name }
{ "content_hash": "ad86a6659d310de9e60da4bed975a7d2", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 56, "avg_line_length": 22.714285714285715, "alnum_prop": 0.5471698113207547, "repo_name": "Yipit/pyeqs", "id": "c9f5e863ce1f9475e339f7df41cebcdce563c929", "size": "342", ...
import numpy as np import regreg.api as rr from regreg.problems.simple import gengrad import nose.tools as nt from test_seminorms import ac from copy import copy def test_simple(): Z = np.random.standard_normal((10,10)) * 4 p = rr.l1_l2((10,10), lagrange=0.13) dual = p.conjugate L = 0.23 loss ...
{ "content_hash": "906872de33713dbbbf33ce1ff69f105a", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 80, "avg_line_length": 31.517857142857142, "alnum_prop": 0.6713881019830028, "repo_name": "klingebj/regreg", "id": "7b2341b8986263e5a850722155e5052f4174bd9c", "size": "1765...
from ..osid import registry as osid_registry COMMENT_RECORD_TYPES = { 'file-comment': { 'authority': 'ODL.MIT.EDU', 'namespace': 'comment-type', 'identifier': 'file-comment', 'display_name': 'File Comment', 'display_label': 'File Comment', 'description': 'Comment via...
{ "content_hash": "6c52dae79ad9953b830c16bf4712eb74", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 87, "avg_line_length": 36.55555555555556, "alnum_prop": 0.6291793313069909, "repo_name": "mitsei/dlkit", "id": "688735e7d475826a675e669696beccaf10d0dd64", "size": "658", ...
from __future__ import division, print_function, absolute_import import tflearn import speech_data import tensorflow as tf learning_rate = 0.0001 training_iters = 300000 # steps batch_size = 64 width = 20 # mfcc features height = 80 # (max) length of utterance classes = 10 # digits batch = word_batch = speech_da...
{ "content_hash": "97b18f4b2ffed42103b70ff5d6ea3b95", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 109, "avg_line_length": 29.525, "alnum_prop": 0.7273497036409822, "repo_name": "shanaka-desoysa/tensorflow", "id": "4694c61e6b563e60e7304fdbe96dc311c45a0151", "size": "1317...
from __future__ import unicode_literals import unittest from imbox.parser import * raw_email = b"""Delivered-To: [email protected] X-Originating-Email: [[email protected]] Message-ID: <[email protected]> Return-Path: [email protected] Date: Tue, 30 Jul 2013 15:56:29 +0300 From: Martin Rusev <[email protected]> MIME-Version: 1...
{ "content_hash": "be2a4e6cbc38d5167e2790c8b8c75c1d", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 111, "avg_line_length": 42.82857142857143, "alnum_prop": 0.6644429619746498, "repo_name": "ookami-kb/imbox", "id": "06b7b0d93266392f35f601f86cb3cdda92c079a2", "size": "3061...
def extractWorldofshandorCom(item): ''' Parser for 'worldofshandor.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('PRC', 'PRC', 'translated'), ('Loiterous', 'Lo...
{ "content_hash": "8405c2efb284e9184b1279e1318ee5c4", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 104, "avg_line_length": 26.095238095238095, "alnum_prop": 0.6295620437956204, "repo_name": "fake-name/ReadableWebProxy", "id": "3cb6cabbc42050fd7478ffec4749a8104d9b28bd", "...
class Node: def __init__(self, key): self.left = None self.right = None self.data = key
{ "content_hash": "23e73392262473c67848a882699e10f0", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 28, "avg_line_length": 14.875, "alnum_prop": 0.4957983193277311, "repo_name": "sonymoon/algorithm", "id": "6c9259d445e1c373ca13e514aaba9904f334bee7", "size": "119", "binar...
""" Given an integer n, return true if it is a power of three. Otherwise, return false. An integer n is a power of three, if there exists an integer x such that n == 3x.   Example 1: Input: n = 27 Output: true Example 2: Input: n = 0 Output: false Example 3: Input: n = 9 Output: true Example 4: Input: n = 45 Output: f...
{ "content_hash": "9b7b144ddc61c14f2113e9ae4f146bbc", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 83, "avg_line_length": 18.085714285714285, "alnum_prop": 0.6003159557661928, "repo_name": "franklingu/leetcode-solutions", "id": "e66e1b99268564314ee94133e2ca0ccc8e173f85", ...
import mock from praw import const import prawdditions.patch from .. import UnitTest class TestRedditPrawdditions(UnitTest): @mock.patch("praw.Reddit.post") def test_reddit_message(self, mock_post): prawdditions.patch.patch() data = { "to": "dummy_user", "subject": "du...
{ "content_hash": "72eed82918e00babc4a482f195cb766c", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 78, "avg_line_length": 31.842105263157894, "alnum_prop": 0.5371900826446281, "repo_name": "praw-dev/prawdditions", "id": "a7b90fcb2c9154771dc842762b8cf37d19a4d8aa", "size":...
import os from django.db.models import signals from django.conf import settings from snapboard import models as snapboard_app def test_setup(**kwargs): from random import choice from django.contrib.auth.models import User from snapboard.models import Thread, Post, Category from snapboard import sampl...
{ "content_hash": "1f667a587ed92cfb766c3b22e8ed3439", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 97, "avg_line_length": 32.21739130434783, "alnum_prop": 0.5852451641925326, "repo_name": "cuker/snapboard", "id": "5b055dfcf67aa24f73b4129df292d7ec0a712012", "size": "2223"...
from tempfile import NamedTemporaryFile from urllib.parse import urlparse from airflow.contrib.hooks.ssh_hook import SSHHook from airflow.models import BaseOperator from airflow.providers.amazon.aws.hooks.s3 import S3Hook from airflow.utils.decorators import apply_defaults class S3ToSFTPOperator(BaseOperator): "...
{ "content_hash": "fc04b2d6904542e31141eb80810b894d", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 79, "avg_line_length": 35.04477611940298, "alnum_prop": 0.6252129471890971, "repo_name": "Fokko/incubator-airflow", "id": "7b5c0a5a93a34b388ebf3de0485269aef5a5e13c", "size"...
complaint_count_request = { "$schema": "http://json-schema.org/draft-07/schema#", "description": "complaint count request schema", "type": "object", "title": "Complaint count request", "properties": { "start_date": {"type": ["string", "null"], "format": "date"}, "end_date": {"type": ...
{ "content_hash": "5026a010a840cdbca2ec183e909bbecd", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 69, "avg_line_length": 36.8, "alnum_prop": 0.5570652173913043, "repo_name": "alphagov/notifications-api", "id": "882789513718e1cec025249549228754b8d395d8", "size": "368", ...
from __future__ import absolute_import # import models into sdk package from .models.account_api_serializer import AccountApiSerializer from .models.public_api_data_create_response import PublicApiDataCreateResponse from .models.depot_detail_serializer import DepotDetailSerializer from .models.write_account_api_serial...
{ "content_hash": "1a04ff2ee075fc0e9b0eb91140b6e292", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 99, "avg_line_length": 41.11363636363637, "alnum_prop": 0.8253178551686015, "repo_name": "ambitioninc/ambition-python", "id": "9c90cf39e61c7e84c1b665235814a92d18b64ca7", "s...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('shelf', '0001_initial'), ] operations = [ migrations.CreateModel( name='BookCategory', fiel...
{ "content_hash": "a64101a2cf5ef9dcda35cbfaf491b386", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 116, "avg_line_length": 34.68571428571428, "alnum_prop": 0.5370675453047776, "repo_name": "KredekPth/Kurs_django", "id": "9dbe3d9b9ac26ac01fc311a04a0d6079bd565172", "size":...
from telemetry.page.actions.all_page_actions import * from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class ToughSchedulingCasesPage(page_module.Page): def __init__(self, url, page_set): super(ToughSchedulingCasesPage, self).__init__(url=url, page_set=page_...
{ "content_hash": "5abb30b827f2c3eb673cdfb1402d9654", "timestamp": "", "source": "github", "line_count": 465, "max_line_length": 98, "avg_line_length": 30.830107526881722, "alnum_prop": 0.6605747767857143, "repo_name": "chromium2014/src", "id": "89b3e92fab039c5d4623eae93b104e2ab063e78f", "size": "14...
""" A set of functions to match sources in two input catalogs Top-level functions ------------------- find_match - finds matches between two catalogs, based on WCS coordinates color_mag - given catalogs matched by find_match, computes colors for matched objects find_zp - essentiall...
{ "content_hash": "08bae467f146864526d7141e1ee83c42", "timestamp": "", "source": "github", "line_count": 555, "max_line_length": 81, "avg_line_length": 36.47387387387387, "alnum_prop": 0.5764955787185694, "repo_name": "cdfassnacht/CodeCDF", "id": "c2a501771de3acc0ce1ac89c8dc34026122696af", "size": "...
from __future__ import division, print_function import sys from annoy import AnnoyIndex import h5py import progressbar as pb import argparse parser = argparse.ArgumentParser() parser.add_argument('filename') parser.add_argument('dataset') parser.add_argument('out_file') parser.add_argument('--trees', type=int, defaul...
{ "content_hash": "2810879e473954760f5e491e71e64570", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 64, "avg_line_length": 29.451612903225808, "alnum_prop": 0.683461117196057, "repo_name": "benbo/XDATAYemen", "id": "128e282ad31b58a1371217342d06eca683cfb4a6", "size": "913"...
import bpy from bpy.props import BoolProperty from mathutils import Vector, Matrix class PRMAN_OT_Renderman_mesh_reference_pose(bpy.types.Operator): bl_idname = 'mesh.freeze_reference_pose' bl_label = "Freeze Reference Pose" bl_description = "Use the mesh's points and normals for the current frame as the r...
{ "content_hash": "b41096a4ba68f14778f7c7e3ce7235ee", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 184, "avg_line_length": 31.544117647058822, "alnum_prop": 0.5673659673659673, "repo_name": "adminradio/RenderManForBlender", "id": "3863862d924716c139092e21757525d2b2ee5df2",...
import numpy as np from pyraytracer import mieGenerator as mie from pyraytracer import scatteringTools as sc from scipy.stats import lognorm if __name__ == '__main__': # Wavelengths (nm) and particle sizes (um) w = np.linspace(100, 1100, 501) p = np.linspace(3, 35, 50) # Log norm parameters from D10...
{ "content_hash": "b6b17d4241f2af2bfd0a183f8dc57872", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 70, "avg_line_length": 34.1, "alnum_prop": 0.5300586510263929, "repo_name": "ollitapa/VTT-Raytracer", "id": "e4562bef8260e70955cb00bc57a67eef920e11b6", "size": "1973", "b...
import logging from xml.etree import ElementTree as etree from xml.parsers import expat import six from neutronclient.common import constants from neutronclient.common import exceptions as exception from neutronclient.openstack.common.gettextutils import _ from neutronclient.openstack.common import jsonutils LOG = l...
{ "content_hash": "8823ac3db64d61a6d93c43f6b78b4f9b", "timestamp": "", "source": "github", "line_count": 391, "max_line_length": 76, "avg_line_length": 36.82608695652174, "alnum_prop": 0.5523300229182582, "repo_name": "rackerlabs/python-neutronclient", "id": "e2cd7641b75ae7daa9fae9803d16331f4e80d1dd",...
from f5.multi_device.cluster import TrustDomain from f5.multi_device.exceptions import DeviceAlreadyInTrustDomain from f5.multi_device.exceptions import DeviceNotTrusted import mock import pytest class MockDeviceInfo(object): def __init__(self, name): self.name = name self.selfDevice = 'true' ...
{ "content_hash": "caf53885e1e43f358f6376345040b49c", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 79, "avg_line_length": 34.44347826086957, "alnum_prop": 0.6824034334763949, "repo_name": "F5Networks/f5-common-python", "id": "1698baefafafb3e460b65497d5fb4ac7b583d26b", "...
from norc.core.models.task import * from norc.core.models.job import * from norc.core.models.schedules import * from norc.core.models.scheduler import * from norc.core.models.queue import * from norc.core.models.queuegroup import * from norc.core.models.executor import * from norc.core.models.extras import * from norc...
{ "content_hash": "5360a39770baf1b427cdc1625add9d1a", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 41, "avg_line_length": 33.7, "alnum_prop": 0.7952522255192879, "repo_name": "darrellsilver/norc", "id": "32ca2b09deb8080ac081059013343a31386185d6", "size": "338", "binary...
from setuptools import setup, find_packages import os # provide correct path for version __version__ = None here = os.path.dirname(os.path.dirname(__file__)) exec(open(os.path.join(here, 'weibull/version.py')).read()) with open('readme.md', 'r') as f: readme = f.read() requirements = [ 'pandas >= 0.20.0', ...
{ "content_hash": "6fc6564f471a138653eb1d30ffac8025", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 89, "avg_line_length": 26.9375, "alnum_prop": 0.6318638824439289, "repo_name": "slightlynybbled/weibull", "id": "6df7f798b49e3132cfe73b860fc255648e6f27b7", "size": "1293", ...
from typing import Dict import json import os from kfp.v2 import dsl def update_output_artifact(executor_input: str, target_artifact_name: str, uri: str, metadata: dict = {}): """Updates the output artifact with the new uri and metadat...
{ "content_hash": "757d199e3ede2dad5daf26928bcef3ab", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 97, "avg_line_length": 44.1551724137931, "alnum_prop": 0.6458414681764936, "repo_name": "kubeflow/pipelines", "id": "bffc15a7fd8032dd75286b0ba750726ff92a8134", "size": "316...
import sys, os, argparse from paraview.simple import * from paraview import data_exploration as wx #import matplotlib.pyplot as plt ############################################################################### # Helper function to generate the tent functions needed for scalar opacity # function ##################...
{ "content_hash": "864d30d9f23c15300a12db7f9633f3e7", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 146, "avg_line_length": 42.88135593220339, "alnum_prop": 0.5259552042160738, "repo_name": "Kitware/cinema", "id": "f2a6c3421140296dddde8ada9c9ac8b33e00dae8", "size": "9252...
from setuptools import setup setup( name='jenkins_tools', version='0.0.69', packages=['jenkins_tools'], package_dir={'jenkins_tools': 'src/jenkins_tools'}, scripts=['scripts/run_chroot_jenkins_now', 'scripts/run_chroot_jenkins_periodic', 'scripts/run_chroot_jenkins_vcs', ...
{ "content_hash": "c5aa3b8a0eaafc82bbe064dc66268743", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 133, "avg_line_length": 43.1764705882353, "alnum_prop": 0.6301089918256131, "repo_name": "ros-infrastructure/jenkins_tools", "id": "5217efde7f35a57b26a4a452ee5ef21a3b98c03a",...
import sys import os import math import shutil from random import randint resultDir = os.environ.get('RESULTS') if resultDir == None : print ("WARNING! $RESULTS not set! Attempt to write results will fail!\n") # Expecting input from KMCLib import * from KMCLib.Backend import Backend import numpy #from RateCalc i...
{ "content_hash": "a27dcab69a562337a6ebee0560461261", "timestamp": "", "source": "github", "line_count": 256, "max_line_length": 121, "avg_line_length": 31.41015625, "alnum_prop": 0.6134809103345356, "repo_name": "joshuahellier/PhDStuff", "id": "1b3f2b56a16a4735173d301d521977b1b0563ae3", "size": "80...
from django.test import TestCase from login.management.commands import demo_data_login class TestCommand(TestCase): def test_command_demo_data_login(self): command = demo_data_login.Command() command.handle()
{ "content_hash": "6feb1b994ee12ae5ab23ed35ffa1d4d0", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 53, "avg_line_length": 23.3, "alnum_prop": 0.7253218884120172, "repo_name": "pkimber/login", "id": "ab8e5bd48f3db4f59a222086a0bcc3824cab42ba", "size": "259", "binary": fa...
from enum import Enum from azure.core import CaseInsensitiveEnumMeta class ComparisonOperationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """the operator that is used to compare the metric data and the threshold.""" EQUALS = "Equals" NOT_EQUALS = "NotEquals" GREATER_THAN = "GreaterThan" G...
{ "content_hash": "a91d6efaa20d115f1ccee2cdf098a1d7", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 105, "avg_line_length": 30.53125, "alnum_prop": 0.7018082565677243, "repo_name": "Azure/azure-sdk-for-python", "id": "57efeee7708931786d8218809f47118b5f8e600b", "size": "33...
from tests import settings try: import urllib.parse as urlrequest except ImportError: import urllib as urlrequest from .resources import Card, CardRegistration from .test_base import BaseTest import requests import responses class CardsTest(BaseTest): @responses.activate def test_cards_registration...
{ "content_hash": "6f89cfc19a6865f143bb2cfc869b3576", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 104, "avg_line_length": 35.11538461538461, "alnum_prop": 0.5930996714129244, "repo_name": "chocopoche/mangopay2-python-sdk", "id": "e2afb7cf028f7010e4c0fe64abebcd9cb4e1d2a6"...
import _plotly_utils.basevalidators class ZautoValidator(_plotly_utils.basevalidators.BooleanValidator): def __init__(self, plotly_name="zauto", parent_name="densitymapbox", **kwargs): super(ZautoValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
{ "content_hash": "d1f62a8a5488b07f8034ab08f452ff67", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 83, "avg_line_length": 38.083333333333336, "alnum_prop": 0.6148796498905909, "repo_name": "plotly/plotly.py", "id": "e095394f995fddb75170764f74caa4010ce6eff1", "size": "457...
import json import sys headers = ['id', 'supported by', 'compatible with', 'conflicts with', 'is trivial in'] int_keys = [u'supported_by', u'partial_path_of', u'conflicts_with', u'terminal'] internal_rows = [] terminal_rows = [] def url_for(study, tree, node): fmt = 'node {n} for https://tree.opentreeoflife.org/cur...
{ "content_hash": "ed3b8087dc988d41df723a0fc9a5d627", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 107, "avg_line_length": 39.7, "alnum_prop": 0.5596977329974812, "repo_name": "OpenTreeOfLife/propinquity", "id": "9bd3ffb99c3ff22033c532e577834af26b43128d", "size": "2007",...
from distutils.core import setup setup( name='django-rest-framework-mongoengine', version='2.0.2', description='MongoEngine support for Django Rest Framework.', packages=['rest_framework_mongoengine',], license='see https://github.com/umutbozkurt/django-rest-framework-mongoengine/blob/master/LICENS...
{ "content_hash": "e2d8b94b021489841f5335de942eedb0", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 114, "avg_line_length": 52.22222222222222, "alnum_prop": 0.6375886524822695, "repo_name": "BryanAke/django-rest-framework-mongoengine", "id": "494881c253085fc265f4d1ec5261550...
from __future__ import print_function, unicode_literals, absolute_import from builtins import dict, str import logging import itertools import rdflib.namespace from copy import deepcopy from indra.preassembler.hierarchy_manager import HierarchyManager, \ UnknownNamespaceException, hierarchies as default_hierarchies...
{ "content_hash": "a213aaf79321d7f0cc281520c0480666", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 80, "avg_line_length": 43.05594405594405, "alnum_prop": 0.5783660873802177, "repo_name": "pvtodorov/indra", "id": "25ad6da51c078337d8c4b577b3f5834ce7ea91b3", "size": "6157...
from openturns import * from math import * TESTPREAMBLE() RandomGenerator.SetSeed(0) try: dim = 2 transformation = NatafIndependentCopulaEvaluation(dim) print "transformation=", repr(transformation) point = NumericalPoint(dim, 0.75) print "transformation(", point, ")=", repr(transformation(point)...
{ "content_hash": "d0a7ec51a5b58997d9da0bd295cb0c53", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 95, "avg_line_length": 32.85, "alnum_prop": 0.7488584474885844, "repo_name": "sofianehaddad/ot-svn", "id": "fb29a2645a629cf9ce5972947549bd1a5605e87f", "size": "681", "bin...
import os import time import click import logging import subprocess import selenium.webdriver from urllib.request import pathname2url from watchdog.observers import Observer from watchdog.events import PatternMatchingEventHandler from . import run_command, absjoin MAKE_COMMAND = ['make', 'html'] class SphinxEvent...
{ "content_hash": "0f264efa58c871c275164f895b312fa1", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 74, "avg_line_length": 28.939655172413794, "alnum_prop": 0.6148346738159071, "repo_name": "mtik00/yamicache", "id": "48489a41441d7843c9b10779311b0e4f6fcbe0d7", "size": "34...
"""Like pprint, but with types except for dictionary keys.""" __all__ = ["pprint", "pformat"] __author__ = "Carl Bordum Hansen" __license__ = "MIT" import pprint as _pprint import contextlib def _new_safe_repr(object, context, maxlevels, level): """Return object type name except for dict keys. Like `...
{ "content_hash": "e391732f5bc3803c786ae9097c9e3939", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 87, "avg_line_length": 32.582608695652176, "alnum_prop": 0.562583400053376, "repo_name": "Zaab1t/datatyping", "id": "cdd92478cc84dc412db75badfca1d7ca0cfa26f1", "size": "37...
from neutron_lib import context as n_ctx from oslo_log import log as logging from neutron.api.rpc.callbacks.consumer import registry as registry_rpc from neutron.api.rpc.callbacks import events as events_rpc from neutron.api.rpc.handlers import resources_rpc from neutron.callbacks import events from neutron.callbacks ...
{ "content_hash": "b6324d3bd093492c30a93241cbc73fbb", "timestamp": "", "source": "github", "line_count": 240, "max_line_length": 78, "avg_line_length": 44.2125, "alnum_prop": 0.6088021864103289, "repo_name": "eayunstack/neutron", "id": "37bd0f50e4d9b47737e1daed46a81690652df72d", "size": "11209", "...
""" """ import os import vcr jiravcr = vcr.VCR( record_mode = 'once', match_on = ['uri', 'method'], ) class BridgeTests: def test_get_issue(self): with jiravcr.use_cassette(os.path.join(self.vcr_directory, "issue.yaml")): self.assertIsNotNone(self.bridge.get_issue("TP-9")) def te...
{ "content_hash": "07b2419c66de228861badf3bae3d4078", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 84, "avg_line_length": 37.78, "alnum_prop": 0.5897300158814187, "repo_name": "rexyeah/jira-cli", "id": "69281eacd965d61d0e90726808a57440a4e60c26", "size": "3778", "binar...