text
stringlengths
4
1.02M
meta
dict
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('blog', '0001_initial'), ] operations = [ migrations.AlterField( model_name='blogpostmodel', name='posted_at', fi...
{ "content_hash": "d79382fe3d5de46229ee0e03d017e038", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 41, "avg_line_length": 21.05263157894737, "alnum_prop": 0.58, "repo_name": "GMadorell/djagolb", "id": "df9f2f9a9495eb2c972b308e533f9dee3f99a9ba", "size": "424", "binary":...
import pytest from ibis.compat import mock import pandas as pd pytest.importorskip('hdfs') pytest.importorskip('sqlalchemy') pytest.importorskip('impala.dbapi') pytestmark = pytest.mark.impala def patch_execute(con): return mock.patch.object(con, '_execute', wraps=con._execute) def test_invalidate_metadata(c...
{ "content_hash": "3a9ded9f753638af271f0c115bddefa2", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 78, "avg_line_length": 33.62921348314607, "alnum_prop": 0.5860340795188774, "repo_name": "deepfield/ibis", "id": "2ac5efc3d7ba714632e0b10700f1871b4703bc90", "size": "2993",...
from pycket import config from pycket import values, values_string, values_parameter from pycket import vector from pycket.AST import AST from pycket.arity import Arity from pycket.cont import Cont, NilCont, label, continuation...
{ "content_hash": "b533cf0d23a3b84fa40295aecf52ebb9", "timestamp": "", "source": "github", "line_count": 2613, "max_line_length": 133, "avg_line_length": 32.4902411021814, "alnum_prop": 0.5708800075385467, "repo_name": "samth/pycket", "id": "d306e334865f7541de3c78d3699b7ab3c430f608", "size": "84947"...
import json from json import JSONDecodeError import sys import argparse import gzip import re parser = argparse.ArgumentParser(description='Match multiple patterns against a JSON field') parser.add_argument('--field', help='Field to grep', default='url') parser.add_argument('file', help='File to look in') parser.add_a...
{ "content_hash": "d5482698a939fd4e859d5e5ad29aa52a", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 92, "avg_line_length": 31.714285714285715, "alnum_prop": 0.5783783783783784, "repo_name": "isoboroff/crawl-eval", "id": "b2d04de55c294978f06d17e9f6d6d20b32bb5dcf", "size": ...
import logging import traceback import types import canary.context from canary.utils import DTable import dtuple class Concept (canary.context.Cacheable, DTable): # FIXME: Resolve conflict between Exp/Out/Spec as "concepts" and this # 'Concept'; namely that Concept.uid == Exp/Out/Spec.concept_id. # Can w...
{ "content_hash": "16778eef7970d556ffb87f222be78591", "timestamp": "", "source": "github", "line_count": 495, "max_line_length": 89, "avg_line_length": 34.60606060606061, "alnum_prop": 0.5042615294804437, "repo_name": "dchud/sentinel", "id": "6a70334737e4ff9282190bc3bb408bd647d8830c", "size": "17138...
from __future__ import with_statement import os import plistlib import subprocess import xml.dom.minidom k_iTunesApp = '/Applications/iTunes.app' k_iTunesDir = os.path.abspath('./iTunes') def GetVersion(): '''Get the current iTunes version''' infoPlist = os.path.join(k_iTunesApp, 'Contents', 'Info.plist') ...
{ "content_hash": "c60d60e61babc0374170a0dd84ce2300", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 99, "avg_line_length": 33.853658536585364, "alnum_prop": 0.6534582132564841, "repo_name": "kgn/EyeTunes", "id": "ef69117e0bb110a03fe43877ff7095630da1854c", "size": "1460", ...
"""A helper class for inferring Distribution shape.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import contextlib from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.framework import tenso...
{ "content_hash": "0b54de6125943f02e5f4e9e27e2897d0", "timestamp": "", "source": "github", "line_count": 483, "max_line_length": 80, "avg_line_length": 39.25879917184265, "alnum_prop": 0.6183946841050522, "repo_name": "nburn42/tensorflow", "id": "6a7f28713acefd2285b07a212e2e47a6db1ae5e1", "size": "1...
import sys, os # If your extensions are in another directory, add it here. If the directory # is relative to the documentation root, use os.path.abspath to make it # absolute, like shown here. #sys.path.append(os.path.abspath('some/directory')) # General configuration # --------------------- # Add any Sphinx extensi...
{ "content_hash": "03402dc96a6bd4c662892a0fe039725f", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 86, "avg_line_length": 31.232704402515722, "alnum_prop": 0.7078131292790979, "repo_name": "bennettscience/PySky", "id": "1337fc76f97be30631f89c6f3d1854adc7785075", "size":...
from bs4 import BeautifulSoup import requests from processor.processor import TagProcessor class PageAnalytic(object): headers={"User-Agent": "Mozilla/5.0 (X11; U; Linux i686) Gecko/20071127 Firefox/2.0.0.11", "Accept-Encoding": "gzip"} tagsClass = TagProcessor.__subclasses__() def __init__(...
{ "content_hash": "4613fb1fbc64d8702ecee96fd8889838", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 94, "avg_line_length": 35.275, "alnum_prop": 0.5910701630049611, "repo_name": "pitomba/libra", "id": "281dd6fa0a18b1939a0d05504e400fbae8b2cc9e", "size": "1411", "binary":...
import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database from google.pr...
{ "content_hash": "aa99c3cb13102b7cd394f1a7f20f233e", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 278, "avg_line_length": 33.207207207207205, "alnum_prop": 0.7593597395550733, "repo_name": "skyportsystems/vitess", "id": "50eaf0f89755b0b2faa29e33c2480a66f18452bd", "size...
"""VTA TOPI Utils.""" def is_packed_layout(layout): """Check if layout is packed layout""" if layout == "NCHW": return False if "n" in layout and "c" in layout: return True return False
{ "content_hash": "eb7811d000b28e761bb60d3f28672824", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 42, "avg_line_length": 24.333333333333332, "alnum_prop": 0.589041095890411, "repo_name": "Huyuwei/tvm", "id": "0fbdb2f86a197def1799b128585eb74ff340daee", "size": "1004", "...
"""Extension for flake8 to test for certain __future__ imports""" from __future__ import print_function import optparse import sys from collections import namedtuple from typing import Optional try: import argparse except ImportError as e: argparse = e from ast import NodeVisitor, Str, Module, parse __vers...
{ "content_hash": "979846a23fd796c16965a5a20eb90cdc", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 90, "avg_line_length": 37.22374429223744, "alnum_prop": 0.5652600588812562, "repo_name": "xZise/flake8-future-import", "id": "444b02c1203da731f37cef2898eea8d478c89213", "s...
import json from django.forms import Media, widgets from wagtail.utils.widgets import WidgetWithScript class CustomRichTextArea(WidgetWithScript, widgets.Textarea): def render_js_init(self, id_, name, value): return "customEditorInitScript({0});".format(json.dumps(id_)) @property def media(self...
{ "content_hash": "86ad72126d88100bee6d03c306b29372", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 69, "avg_line_length": 28.130434782608695, "alnum_prop": 0.7017001545595054, "repo_name": "rsalmaso/wagtail", "id": "141b836cf263ddc79d945eb8f25782814d2241de", "size": "647...
from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('flashcards', '0057_auto_20180721_0221'), ] operations = [ migrations.AlterUniqueTogether( name='deck', unique_together=set(), ), migrations.RunSQL( ...
{ "content_hash": "4a0f09308525b891c65da00ac9c0d791", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 170, "avg_line_length": 27.19047619047619, "alnum_prop": 0.5691768826619965, "repo_name": "aehlke/manabi", "id": "45e8abc1f43dbcde4d08e90c26d32cf90385ddfe", "size": "620", ...
"""SCons.Tool.Perforce.py Tool-specific initialization for Perforce Source Code Management system. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # __COPYRIGHT__ # # Permission is hereby granted, free of ch...
{ "content_hash": "3494cb950119b35178c4d424bb1ff006", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 118, "avg_line_length": 36.05825242718446, "alnum_prop": 0.68578352180937, "repo_name": "Distrotech/scons", "id": "15dd83f3a80fae7a087c52f5c699ffd7ff9b11b1", "size": "3714...
import numpy import matplotlib import matplotlib.pyplot as plt errors = numpy.loadtxt('series0_1_d_errors.txt') numberOfIntervals = numpy.loadtxt('series0_1_d_numbers.txt') plt.loglog(numberOfIntervals, errors, '-*', label='$|I_n(f)-I(f)|$') plt.title('Error plot for the midpoint rule') plt.xlabel('$n$') plt.ylabel('$...
{ "content_hash": "c9d60e147b177608ecfdbb14d4f112d9", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 90, "avg_line_length": 30.647058823529413, "alnum_prop": 0.6871401151631478, "repo_name": "westernmagic/NumPDE", "id": "93b897c78fe0a997e63f60ae448d203bd9f93f57", "size": "...
import logging from banal import ensure_list from flask_babel import gettext from werkzeug.exceptions import BadRequest from aleph.index.indexes import entities_read_index from aleph.index.collections import collections_index from aleph.index.xref import xref_index, XREF_SOURCE from aleph.index.notifications import no...
{ "content_hash": "5685f296b486e722d5aed0af151208d2", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 79, "avg_line_length": 34.718120805369125, "alnum_prop": 0.6456601585153683, "repo_name": "alephdata/aleph", "id": "c415213e59352d2ec3100213ec2585c04cbb3538", "size": "517...
import tensorflow as tf # LSTM Encoder-decoder Autoencoder model functions def create_LSTM_stack(lstm_hidden_units, lstm_dropout_output_keep_probs): """Create LSTM stacked cells. Given list of LSTM hidden units and list of LSTM dropout output keep probabilities. Args: lstm_hidden_units: List of integers...
{ "content_hash": "a5e1b00acea6a8c51c38777a0afdded9", "timestamp": "", "source": "github", "line_count": 382, "max_line_length": 87, "avg_line_length": 40.390052356020945, "alnum_prop": 0.6533151856892864, "repo_name": "turbomanage/training-data-analyst", "id": "dea9f5ebc16d19f7c841fa5d0b4385b4785b6ae...
import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError from .. import models class BackupProtectedItemsOperations(object): """BackupProtectedItemsOperations operations. :param client: Client for service requests. :param config: Configuration of serv...
{ "content_hash": "1397da64d2875de1663a116e468fefce", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 167, "avg_line_length": 45.08490566037736, "alnum_prop": 0.6333961079723791, "repo_name": "lmazuel/azure-sdk-for-python", "id": "795ea6e78e384ad0030d7c0eee5843d82ed123f6", ...
import time from tvm.rpc import proxy def start_proxy_server(port, timeout): prox = proxy.Proxy("localhost", port=port, port_end=port+1) if timeout > 0: import time time.sleep(timeout) prox.terminate() else: prox.proc.join() if __name__ == "__main__": import sys if ...
{ "content_hash": "4c27632c117d123c9d7e468160417dc5", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 63, "avg_line_length": 25.68421052631579, "alnum_prop": 0.5922131147540983, "repo_name": "mlperf/training_results_v0.6", "id": "09b7e4a6fe02c9c2be5492e9216d958fde63132a", "...
import time import datetime from django import template from django.utils.translation import ugettext as _ from django.conf import settings from django.utils.translation import get_language from django.utils import formats from codenerix.helpers import zeropad, monthname, nameunify register = template.Library() regi...
{ "content_hash": "e38a93e0c599fbb53344f0d74b91ef34", "timestamp": "", "source": "github", "line_count": 324, "max_line_length": 117, "avg_line_length": 20.271604938271604, "alnum_prop": 0.5927222898903776, "repo_name": "centrologic/django-codenerix", "id": "a4a98e6e97d56faaa79d489884e6824230a6effb", ...
"""This example gets all audience segments. """ # Import appropriate modules from the client library. from googleads import ad_manager def main(client): # Initialize appropriate service. audience_segment_service = client.GetService( 'AudienceSegmentService', version='v202211') # Create a statement to se...
{ "content_hash": "f828f20355d6b78bed3d143e2c4e3cb1", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 77, "avg_line_length": 35.891891891891895, "alnum_prop": 0.6905120481927711, "repo_name": "googleads/googleads-python-lib", "id": "296a3d7dd4879deb5d2576a1c37077837f92a7cc", ...
""" Ansible module to add boundary meters. (c) 2013, curtis <curtis@serverascode.com> This file is part of Ansible Ansible is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at...
{ "content_hash": "10afcbe76576896d502c69313e8a5354", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 96, "avg_line_length": 32.019762845849804, "alnum_prop": 0.6138748302678682, "repo_name": "mith1979/ansible_automation", "id": "f6d84328597960fed76f5a5a810c5d5a9b93b3ad", ...
from switch import Map from switch import MediaItem from switch import Rule from switch import Switch from switch import TwilioMessageRequest from _version import __version__
{ "content_hash": "5d9d31c2c35b7f345ace01466baf8720", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 39, "avg_line_length": 25.142857142857142, "alnum_prop": 0.8295454545454546, "repo_name": "skimbrel/strowger", "id": "932e0c470080716316fbf05949cdde13c83b9c1b", "size": "176...
"""Program to locate the first space in the input string.""" s = input("Please enter a string: ") pos = 0 for c in s: if c == " ": print("First space occurred at position", pos) break pos += 1 else: print("No spaces in that string.")
{ "content_hash": "6e0d596211f3537c74aff669afaefbe0", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 60, "avg_line_length": 23.818181818181817, "alnum_prop": 0.5954198473282443, "repo_name": "ceeblet/OST_PythonCertificationTrack", "id": "cb61698a6a93f7c6005e24fdaf85d9ccaed53...
from django.contrib import admin from src.comms.models import Channel, Msg, PlayerChannelConnection, ExternalChannelConnection class MsgAdmin(admin.ModelAdmin): list_display = ('id', 'db_date_sent', 'db_sender', 'db_receivers', 'db_channels', 'db_message', 'db_lock_storage') list_display_links = ("id",) or...
{ "content_hash": "59eff9204cd0a6fdc6dd6050c4b0b0e1", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 124, "avg_line_length": 39.73134328358209, "alnum_prop": 0.6416228399699474, "repo_name": "TaliesinSkye/evennia", "id": "b88a7ad240f0a40325573fc0cf6d9b8ee6125a68", "size": ...
from django.core.exceptions import ImproperlyConfigured from django.core.management import call_command from django.apps import apps from .conf import settings from haystack import connections, connection_router from haystack.exceptions import NotHandled as IndexNotFoundException from celery.app.task import Task # ...
{ "content_hash": "340d9de6d2e25d0eb4072d1e6ad20897", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 85, "avg_line_length": 40.59748427672956, "alnum_prop": 0.5657629744384198, "repo_name": "roverdotcom/celery-haystack", "id": "7dbe479fc814b55dc4f0de5537acc598dc88fead", "...
from __future__ import absolute_import import re try: from django.urls import get_resolver except ImportError: from django.core.urlresolvers import get_resolver def get_regex(resolver_or_pattern): """Utility method for django's deprecated resolver.regex""" try: regex = resolver_or_pattern.re...
{ "content_hash": "2bafb9af63b2ca99b8bb3b7a16ddd2d6", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 87, "avg_line_length": 32.24242424242424, "alnum_prop": 0.5620300751879699, "repo_name": "getsentry/raven-python", "id": "3f3c74f4c6cff845f9a78b37df606f8ce9770bd7", "size":...
from typing import List, Dict from datetime import datetime import numpy as np from vnpy.app.portfolio_strategy import StrategyTemplate, StrategyEngine from vnpy.trader.utility import BarGenerator from vnpy.trader.object import TickData, BarData class PairTradingStrategy(StrategyTemplate): """""" author = ...
{ "content_hash": "ec0c06d198f22d3de471e77b1bfa2040", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 91, "avg_line_length": 27.505208333333332, "alnum_prop": 0.5300132550653285, "repo_name": "bigdig/vnpy", "id": "0b66dc7e52451d468d6a02ad6f63eb493fb5eed1", "size": "5317", ...
"""Test the openml loader. """ import gzip import json import numpy as np import os import re import scipy.sparse import sklearn import pytest from sklearn.datasets import fetch_openml from sklearn.datasets.openml import (_open_openml_url, _get_data_description_by_id, ...
{ "content_hash": "b945d2de34d7f6ccd9b0e0ec2a1b8301", "timestamp": "", "source": "github", "line_count": 596, "max_line_length": 79, "avg_line_length": 41.49832214765101, "alnum_prop": 0.6178385153438726, "repo_name": "vortex-ape/scikit-learn", "id": "cf9cfcdc81edee8899a1ff2e0c73c824d24c6776", "size...
from findatapy.market import Market, MarketDataRequest, MarketDataGenerator market = Market(market_data_generator=MarketDataGenerator()) # download event data from Bloomberg # we have to use the special category "events" keyword for economic data events # so findatapy can correctly identify them (given the underlying...
{ "content_hash": "ef703c820d1e23503bab9103c7728b78", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 140, "avg_line_length": 51.1875, "alnum_prop": 0.6027676027676028, "repo_name": "kalaytan/findatapy", "id": "3b33ecee8758d7341aa309997109e6b42a22f69d", "size": "2457", "b...
import collections def cross_product(lhs, rhs): return lhs.x * rhs.y - lhs.y * rhs.x class Point(collections.namedtuple('Point', 'x y')): def __add__(self, other): return Point(self.x+other.x, self.y+other.y) def __sub__(self, other): return Point(self.x-other.x, self.y-other.y) def dire...
{ "content_hash": "5b87c7ef8114aef309e147a8cdace8be", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 80, "avg_line_length": 36.7906976744186, "alnum_prop": 0.6605562579013906, "repo_name": "rik0/rk-exempla", "id": "4dfce0129e35c0ee490ebf3661553b192ab8faf6", "size": "1582",...
import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): """Remove unvouched users from groups.""" orm['groups.GroupMembership'].objects.filter(userprofile__is_vouched=False).delete() def ...
{ "content_hash": "2e076df955e5c0d2a989e1879903c342", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 226, "avg_line_length": 84.55633802816901, "alnum_prop": 0.5501790622137087, "repo_name": "ChristineLaMuse/mozillians", "id": "d640ef3a6cca83fa1b77ddaacb29d9a705d449f6", "...
try: from setuptools import setup except ImportError: from distutils.core import setup REQUIREMENTS = [i.strip() for i in open("requirements.txt").readlines()] config = dict(description='Kandilli last earthquakes api', long_description=open('README.md').read(), author='Halit Alptekin',...
{ "content_hash": "26a3b54062808f1d130bbcf962ef543a", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 72, "avg_line_length": 33.42857142857143, "alnum_prop": 0.6011396011396012, "repo_name": "halitalptekin/kandilli", "id": "2688aa5558c1064cddb9c19909fc99fe6356fac7", "size":...
""" Support for Modbus switches. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.modbus/ """ import logging import voluptuous as vol import homeassistant.components.modbus as modbus from homeassistant.const import CONF_NAME, CONF_SLAVE from homeas...
{ "content_hash": "401f41d4c0cad9e97d9fd8a972957058", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 74, "avg_line_length": 29.10126582278481, "alnum_prop": 0.6272292301000435, "repo_name": "alexmogavero/home-assistant", "id": "95168d5b830041268aad6916c7538e9a4d7075fd", "s...
""" This module contains functions that generate ctypes prototypes for the GDAL routines. """ from ctypes import c_char_p, c_double, c_int, c_void_p from django.contrib.gis.gdal.prototypes.errcheck import ( check_arg_errcode, check_errcode, check_geom, check_geom_offset, check_pointer, check_srs, check_str_a...
{ "content_hash": "10eeb6a9245a4f8be660fd393ea1b728", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 78, "avg_line_length": 28.92753623188406, "alnum_prop": 0.657314629258517, "repo_name": "yceruto/django", "id": "6b38dc593f51ee40bb68843faa7fcb85fbd9f2be", "size": "3992",...
import os import sys import ast import re import subprocess from setuptools import find_packages import functools import fnmatch # get version number # avoid importing from package version_re = re.compile(r'__version__\s+=\s+(.*)') with open('butterflow/version.py', 'rb') as f: version = str(ast.literal_eval(vers...
{ "content_hash": "7aa2c10c4309956e4d83f7d66b4ef6b5", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 109, "avg_line_length": 36.448132780082986, "alnum_prop": 0.6068989071038251, "repo_name": "dthpham/butterflow", "id": "a3bd3887eb98ee0e1c44f34ae6c2df3aa2ab0254", "size": ...
import numpy as np from pymatgen.core.structure import Structure """ This module implements symmetry-related structure forms. """ __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2012, The Materials Project" __version__ = "0.1" __maintainer__ = "Shyue Ping Ong" __email__ = "shyuep@gmail.com" __date__ = "Mar ...
{ "content_hash": "47c60eec8228f64a25747a1ac32f915b", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 78, "avg_line_length": 36.21621621621622, "alnum_prop": 0.6380597014925373, "repo_name": "montoyjh/pymatgen", "id": "eba58609e3d57c3d3c30f39b1f1b3bfe5debafa0", "size": "279...
import unittest from datetime import datetime from unittest import mock import pytest from airflow.exceptions import AirflowException from airflow.providers.google.cloud.transfers.gcs_to_gcs import WILDCARD, GCSToGCSOperator TASK_ID = 'test-gcs-to-gcs-operator' TEST_BUCKET = 'test-bucket' PREFIX = 'TEST' SOURCE_OBJE...
{ "content_hash": "75fbf1e4c4e5d0fd42396dcbd1844a72", "timestamp": "", "source": "github", "line_count": 530, "max_line_length": 109, "avg_line_length": 44.19245283018868, "alnum_prop": 0.6531039193920246, "repo_name": "mistercrunch/airflow", "id": "a23b50d42f89328e640e5126d5407cf7f16e71f4", "size":...
from collections import namedtuple from calendar import monthrange from configparser import ExtendedInterpolation import numpy as np from datetime import datetime __all__ = ["Date", "all_dates_in_year", "number_of_days_in_month", "generate_days", "generate_years", "generate_months", "extract_months", "extract_...
{ "content_hash": "8d09a1f5c0ade9bb4fa572af84cedc34", "timestamp": "", "source": "github", "line_count": 303, "max_line_length": 119, "avg_line_length": 39.161716171617165, "alnum_prop": 0.6612169222990055, "repo_name": "ulikoehler/UliEngineering", "id": "1fe3cdae8e8c5f44117e80b306a3e585de2dc446", "...
""" Author : Jaganadh Gopinadhan e-mail : jaganadhg@gmail.com Licence : MIT Third Eye V1.0 Udacity Self Driving Car Nano Degree Project 1 Finding Lane Lines on the Road """ import matplotlib.image as mpimg import numpy as np from moviepy.editor import VideoFileClip from pputil import FrameTransformer from lineutil...
{ "content_hash": "2e404adc7f3a2f56b9356703ba91d000", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 71, "avg_line_length": 23.345454545454544, "alnum_prop": 0.6207165109034268, "repo_name": "jaganadhg/sdcnd_p1_lld", "id": "26bae1a522e4e49929b69d825a8f7dfe979c7a3d", "size"...
import nltk nltk.download('stopwords') nltk.download('punkt') from nltk.corpus import stopwords from nltk.stem import PorterStemmer from nltk.tokenize import word_tokenize, sent_tokenize import bs4 as BeautifulSoup import urllib.request import sys #URI of the data source URI = sys.argv[1] if len(sys.argv) > 1 else '...
{ "content_hash": "266db03b970a77ddbad3f0e1d269ef00", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 109, "avg_line_length": 30.225806451612904, "alnum_prop": 0.6824973319103522, "repo_name": "jasonclark/python-samples", "id": "e0ab2a2a8b2305f5e5cfb2b010575e937c298645", "...
from revscoring import Feature from revscoring.datasources.datasource import Datasource from revscoring.features import wikibase as wikibase_ from revscoring.features import modifiers from revscoring.features.meta import aggregators, bools from revscoring.features.modifiers import not_ from . import wikibase from .wik...
{ "content_hash": "2f111ebd71532fe94c1ee48e29541ff3", "timestamp": "", "source": "github", "line_count": 313, "max_line_length": 78, "avg_line_length": 32.83067092651757, "alnum_prop": 0.7162319968859479, "repo_name": "halfak/Wiki-Class", "id": "bffdfb2f04ab1976575da06eb541b8b5dd03f7eb", "size": "10...
from .pool import Pool, _NaivePool # NoQA __all__ = ('Pool',)
{ "content_hash": "47c99285bbbbd5174a68643c88d8cb62", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 42, "avg_line_length": 16.25, "alnum_prop": 0.5846153846153846, "repo_name": "edgedb/edgedb", "id": "577dffa0fcf4e0d69ad174665d16c79dd160c437", "size": "745", "binary": fa...
debug = True debug = False # from CommonClasses import * # hxl: comment out this line for submission class Solution: # @param head, a ListNode # @return a ListNode def sortList(self, head): if head == None: return None elif head.next == None: ...
{ "content_hash": "0f4b9d9fd9ad2a3891b42e4d33548a7f", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 90, "avg_line_length": 33.89333333333333, "alnum_prop": 0.47482297403619195, "repo_name": "54lihaoxin/leetcode_python", "id": "78b87232934b70ef90b21221bbf3d1c766663d18", "s...
from __future__ import unicode_literals import bluebottle.utils.fields from decimal import Decimal from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0002_remove_content_type_name'), ('funding', '002...
{ "content_hash": "882ff6ad1f213b970fc7d9511508f5d6", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 213, "avg_line_length": 40.76470588235294, "alnum_prop": 0.60990860990861, "repo_name": "onepercentclub/bluebottle", "id": "9fdfd50235b930d3544ce23ed4854801993c39a6", "size...
from supriya.ugens.InfoUGenBase import InfoUGenBase class BufInfoUGenBase(InfoUGenBase): """ Abstract base class for buffer information ugens. Buffer information ugens expose both scalar-rate and control-rate constructors, as buffer topology may change after a synth is instantiated. """ ### ...
{ "content_hash": "fc4bd2674f07a32e31c86149884079be", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 27.714285714285715, "alnum_prop": 0.729381443298969, "repo_name": "Pulgama/supriya", "id": "41937483fd228016e2095677b591a8a02787fd12", "size": "388",...
""" WSGI config for composeexample project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANG...
{ "content_hash": "ce40bf341295dc0d9bfec0d4304fd28b", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 25.3125, "alnum_prop": 0.7777777777777778, "repo_name": "uobdic/dice-docker", "id": "737f080f1f2f2bd8e32205241b422e39cedfffe6", "size": "405", "bin...
import platform from rsqueakvm.error import PrimitiveFailedError from rpython.rlib import jit from rpython.rtyper.lltypesystem import rffi try: assert "64bit" in platform.architecture()[0] from sqpyte.capi import CConfig from sqpyte.interpreter import SQPyteDB except (ImportError, AssertionError): cla...
{ "content_hash": "3d6248b1f20fb73b7fe354daf52987c7", "timestamp": "", "source": "github", "line_count": 307, "max_line_length": 79, "avg_line_length": 33.36482084690554, "alnum_prop": 0.5471053402323538, "repo_name": "HPI-SWA-Lab/RSqueak", "id": "8e9562955e5d3848c0b57dd1d1605aa00f0b0f42", "size": "...
import catoclient.catocommand from catoclient.param import Param class GetTaskParameters(catoclient.catocommand.CatoCommand): Description = 'Gets a json formatted parameters template for a task.' API = 'get_task_parameters' Examples = ''' _To get the parameters of the default version of a task and redirec...
{ "content_hash": "c9b968e052dfbdc5b330d39f96a2ad4a", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 96, "avg_line_length": 39.91428571428571, "alnum_prop": 0.6220472440944882, "repo_name": "cloudsidekick/catoclient", "id": "20375896c499191ce6ca336efb34223109ebc564", "size...
''' Created by auto_sdk on 2015.04.21 ''' from aliyun.api.base import RestApi class Slb20140515DescribeHealthStatusRequest(RestApi): def __init__(self,domain='slb.aliyuncs.com',port=80): RestApi.__init__(self,domain, port) self.ListenerPort = None self.LoadBalancerId = None def getapiname(self): r...
{ "content_hash": "e6703f8fe126ccd14ce1b591521e8726", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 59, "avg_line_length": 31.5, "alnum_prop": 0.7275132275132276, "repo_name": "wanghe4096/website", "id": "3442be5f221abb449379bc6ec748a67fd4fa702d", "size": "378", "binary...
import socket port = 8080 server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) #udp server.bind(('', port)) print('Listen on port: %s' % port) while True: data, addr = server.recvfrom(1024) print('Received from %s data: %s' % (addr, data))
{ "content_hash": "cca0ea7dca087ba5b4c0f66302d6e5e3", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 63, "avg_line_length": 18.571428571428573, "alnum_prop": 0.6538461538461539, "repo_name": "istommao/pynotes", "id": "1e09ec9a64f1ab20977186793f62242b04cb6430", "size": "260...
''' API service module of deepnlp.org ''' from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals # compatible with python3 unicode coding import requests import re import sys if (sys.version_info>(3,0)): from url...
{ "content_hash": "e2db3f810455057a86a49927012a6f13", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 107, "avg_line_length": 34.16483516483517, "alnum_prop": 0.6069475715664201, "repo_name": "rockingdingo/deepnlp", "id": "f2a1a3f3eba3e14598888837d39230718ca21aac", "size": ...
from __future__ import absolute_import from agms.response.response import Response class InvoicingResponse(Response): """ A class representing AGMS Invoicing Response objects. """ def __init__(self): self._response = None self._mapping = []
{ "content_hash": "1aae0041dd2ba8f6bd95fd921667f637", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 57, "avg_line_length": 22.916666666666668, "alnum_prop": 0.6618181818181819, "repo_name": "agmscode/agms_python", "id": "4f67b6c257ddae355c26158c07e24c4b0dcea5bb", "size": ...
""" Algorithms implementation to retrieve geophysical parameters """ from satistjenesten import data import numpy def compute_parameter(scene, alg='dummy_sic'): eval("compute_{0}(scene)".format(alg)) def compute_dummy_sic(scene): """ Compute sea ice concentration using a selection of algorithms Appe...
{ "content_hash": "5ede4fad9f67965e1e9273dd5e8a6579", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 72, "avg_line_length": 27.96153846153846, "alnum_prop": 0.686382393397524, "repo_name": "mitkin/satistjenesten", "id": "99ca8858e4eaf5387d5950e11e50050bb23d34ff", "size": "...
import pathlib import subprocess import tempfile from unittest.mock import MagicMock import pytest from utils.guestfsprocess import CompletedProcess, GuestFSInterface, run class TestWithoutCheck: def test_capture_stdout(self): cmd = 'echo abc123' result = run(_make_local_guestfs(), cmd, raiseOnError=False)...
{ "content_hash": "6bd4bca87f29695a3e4bd804bb8f7550", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 76, "avg_line_length": 35.878787878787875, "alnum_prop": 0.6638513513513513, "repo_name": "adjackura/compute-image-tools", "id": "2a7c85ca3bb0f3f0095ef889231305f718b1d610", ...
from cps import * import math, random, time class ResourceChannel(WorldChannel): """ Updates the world's concentration of resource R due to: - diffusion with an agent (Nvirtual/Nmax virtual cells) - exchange with a reservoir and sink """ def scheduleEvent(self, world, cells, time, src)...
{ "content_hash": "ac312a692ab1327e71ae6be6488c526c", "timestamp": "", "source": "github", "line_count": 269, "max_line_length": 100, "avg_line_length": 33.446096654275095, "alnum_prop": 0.6608869623207736, "repo_name": "nvictus/CellPopSim", "id": "a25f0fd4f8c3fb2179ce84c350cc987aca0aa269", "size": ...
import copy import operator import re import sys import warnings import weakref import numbers from functools import reduce from collections import OrderedDict from contextlib import suppress import numpy as np from numpy import char as chararray from .card import Card, CARD_LENGTH from .util import (pairwise, _is_i...
{ "content_hash": "55207728690929588a6f63c9b2dcaeb3", "timestamp": "", "source": "github", "line_count": 2654, "max_line_length": 90, "avg_line_length": 37.04031650339111, "alnum_prop": 0.5707135954427547, "repo_name": "StuartLittlefair/astropy", "id": "1dad3278622102895d37848212d07a6ba6e771b6", "si...
from btcmarkets_api import Market BTC = Market("/market/BTC/AUD/tick", "BTC") LTC = Market("/market/LTC/AUD/tick", "LTC") ETH = Market("/market/ETH/AUD/tick", "ETH") ETC = Market("/market/ETC/AUD/tick", "ETC") XRP = Market("/market/XRP/AUD/tick", "XRP") BCH = Market("/market/BCH/AUD/tick", "BCH") BTC.update_data() LT...
{ "content_hash": "66eb9d7819eeb53da97c789916e49ee7", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 43, "avg_line_length": 27.2, "alnum_prop": 0.6740196078431373, "repo_name": "infectiious/Pharaoh_script", "id": "5821dd47fba75dd2ea15fba39cbd3efaf72653d2", "size": "431", ...
import simplejson as json import unicodecsv as csv import urllib url = "https://www.publicstuff.com/api/2.0/requests_list?return_type=json&limit=100&lat=35.62336&request_type_id=11339&lon=-82.561531&nearby=250&api_key=58j013k159vpqz87xd85df0uy7epvl" response = urllib.urlopen(url); data = json.loads(response.read()) f...
{ "content_hash": "b9fb0fe9a7bf0b2451efc0712c0602db", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 184, "avg_line_length": 18.387755102040817, "alnum_prop": 0.6670366259711432, "repo_name": "CodeForAsheville/get-json-convert-to-csv", "id": "93c755319783346b989496bf9bb85a17...
"""Setup.py module for the workflow's worker utilities. All the workflow related code is gathered in a package that will be built as a source distribution, staged in the staging area for the workflow being run and then installed in the workers when they start running. This behavior is triggered by specifying the --se...
{ "content_hash": "fb8eae3927be0b9b562d31bfdfb886c3", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 80, "avg_line_length": 36.39090909090909, "alnum_prop": 0.7299525355983013, "repo_name": "RyanSkraba/beam", "id": "ee02a16d4d844a04b5529696c59f02a9c8720f2e", "size": "4788...
"""Tests for refstack's migrations.""" import alembic import mock from oslotest import base from refstack.db import migration from refstack.db.migrations.alembic import migration as alembic_migration class AlembicConfigTestCase(base.BaseTestCase): @mock.patch('alembic.config.Config') @mock.patch('os.path.j...
{ "content_hash": "dc056d35ccaa708d800638f3b5a1141a", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 79, "avg_line_length": 38.24691358024691, "alnum_prop": 0.6733376371852808, "repo_name": "markvoelker/refstack", "id": "c140be47e264092339edc5223627c5c2a0131412", "size": "...
from .api.native import * from .api.rest import *
{ "content_hash": "4f4a4c3fc732476fbb276fb9452c23e9", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 25, "avg_line_length": 25, "alnum_prop": 0.72, "repo_name": "ResearchSoftwareInstitute/MyHPOM", "id": "c1dc1801f8e667104127231816ffba59c670030f", "size": "50", "binary": f...
import collections import bisect class SortedItems(collections.Sequence): def __init__(self, initial=None): self._items = sorted(initial) if initial is None else [] # Required sequence methods def __getitem__(self, index): return self._items[index] def __len__(self): return le...
{ "content_hash": "03c51422c94f3093da85d2b8c5c2e2c4", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 64, "avg_line_length": 23.59375, "alnum_prop": 0.6119205298013245, "repo_name": "tuanavu/python-cookbook-3rd", "id": "f8ab10f34f688c06f8f55dc769ade18a61d2bc73", "size": "78...
""" Vamp is a function/codeblock signaturing framework which is a subcomponent of vivisect. These may be used to import/export signature sets and potentially identify code reuse or static linking... Current signature ideas: function arg count code block count globals refs code block refs unusual i...
{ "content_hash": "dd488f621660087d9c369fac6d17c4c0", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 85, "avg_line_length": 26.120481927710845, "alnum_prop": 0.6208487084870848, "repo_name": "cmaruti/vivisect", "id": "5c24a86244afb7a495032ff07da89e5b3d14af1e", "size": "216...
'''This is like pexpect, but it will work with any file descriptor that you pass it. You are responsible for opening and close the file descriptor. This allows you to use Pexpect with sockets and named pipes (FIFOs). PEXPECT LICENSE This license is approved by the OSI and FSF as GPL-compatible. http://ope...
{ "content_hash": "f69e43f99c1f02fb33fba1755e84c3d4", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 138, "avg_line_length": 39.37837837837838, "alnum_prop": 0.6336650652024708, "repo_name": "kennethreitz/pipenv", "id": "cddd50e10058a8b65b57c3d5bb2724fb35a22c2a", "size": ...
from m5.SimObject import SimObject class RiscvISA(SimObject): type = 'RiscvISA' cxx_class = 'RiscvISA::ISA' cxx_header = "arch/riscv/isa.hh"
{ "content_hash": "7965895dfb09cffa9f1202afb11424b3", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 36, "avg_line_length": 25.666666666666668, "alnum_prop": 0.6883116883116883, "repo_name": "austinharris/gem5-riscv", "id": "90a907b917f53ccddaca4a9fd849a8e5e3486f50", "size"...
''' Created on Feb 19, 2012 @author: dsussman Copyright (c) 2012 Johns Hopkins University. All rights reserved. ''' import numpy as np # import networkx as nx # Disa - Not necessary for OCP import scipy.sparse as sparse from scipy.sparse import linalg as la from scipy import linalg #from sklearn.cluster import KMeans...
{ "content_hash": "6afd13af61d97584f6e05a34c9a1b5c1", "timestamp": "", "source": "github", "line_count": 310, "max_line_length": 97, "avg_line_length": 31.05483870967742, "alnum_prop": 0.5744260932793186, "repo_name": "openconnectome/m2g", "id": "0723e72795101a2b274efe4aefabbc4ca785832b", "size": "1...
import _plotly_utils.basevalidators class CminValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="cmin", parent_name="scatterpolargl.marker", **kwargs ): super(CminValidator, self).__init__( plotly_name=plotly_name, parent_name=pare...
{ "content_hash": "1c717ba25beb56e248910ed7bcad6118", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 79, "avg_line_length": 35.53333333333333, "alnum_prop": 0.5909943714821764, "repo_name": "plotly/python-api", "id": "d563757261d75fdccd0a64b025f27f120f1187b8", "size": "533...
from ctypes import * ## page permissions PAGE_EXECUTE = 0x10 PAGE_EXECUTE_READ = 0x20 PAGE_EXECUTE_READWRITE = 0x40 PAGE_EXECUTE_WRITECOPY = 0x80 PAGE_NOACCESS = 0x01 PAGE_READONLY = 0x02 PAGE_READWRITE = 0x04 PAGE_WRITECOPY = 0x08 PAGE_GUARD = 0x100 PAGE_NOCACHE = 0x200 PAGE_WRITECOMBINE = 0x400 ## process access per...
{ "content_hash": "22b31287b49e6e28b206f667ee0af9c9", "timestamp": "", "source": "github", "line_count": 269, "max_line_length": 212, "avg_line_length": 28.851301115241636, "alnum_prop": 0.6527509341579694, "repo_name": "arizvisa/syringe", "id": "f98e48acde11693bff6ed5fb4766d8def3add1cd", "size": "7...
import requests from collections import OrderedDict a = requests.get('http://bot.notenoughmods.com/1.6.2.json').json() b = requests.get('http://bot.notenoughmods.com/1.6.4.json').json() a = {x.pop('name'): x for x in a} b = {x.pop('name'): x for x in b} unique_a = set(a) - set(b) unique_b = set(b) - set(a)...
{ "content_hash": "19c6f963703738079d5c5376a7e1ec85", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 94, "avg_line_length": 33.24528301886792, "alnum_prop": 0.5590238365493757, "repo_name": "Pyker/nem-list-diff", "id": "87e1d443e8662b843bce906ce9e5631ad15da593", "size": "1...
import mxnet as mx import numpy as np from mxnet.executor_manager import _split_input_slice from rcnn.config import config from rcnn.io.image import tensor_vstack from rcnn.io.rpn import get_rpn_testbatch, get_rpn_batch, assign_anchor from rcnn.io.rcnn import get_rcnn_testbatch, get_rcnn_batch class TestLoader(mx.io...
{ "content_hash": "54985a9a79538806857bb477d7b35e41", "timestamp": "", "source": "github", "line_count": 392, "max_line_length": 114, "avg_line_length": 37.22959183673469, "alnum_prop": 0.5626284774564889, "repo_name": "Guneet-Dhillon/mxnet", "id": "826ee20f080cba15a9df3d7217a6ce2f23a632c7", "size":...
from git.objects import (Commit, Tree) import io import os import git.refs from gitdb import IStream from gitdb.util import bin_to_hex from git.objects.util import altz_to_utctz_str from io import StringIO, BytesIO from collections import deque blob_mode = '100644' tree_mode = '40000' def tree_item_str(mode, file_na...
{ "content_hash": "bb09391dc6a2cabe4d49822365f3b306", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 100, "avg_line_length": 31.258426966292134, "alnum_prop": 0.6044212796549245, "repo_name": "niyaton/kenja", "id": "0973ca3a6daab0553ed256db8d4f1430293a14d0", "size": "5564...
""" Description: This program uses Yelp"s Fusion API to: (1) Query for a specific business --->>> GET https://api.yelp.com/v3/businesses/search using the criteira: "categories", "location", "name" in the query string, and (2) Once the page url is extracted for a business, scrape the reivews and ratings for t...
{ "content_hash": "19a1e1e717023ffe1687b53983078224", "timestamp": "", "source": "github", "line_count": 282, "max_line_length": 118, "avg_line_length": 38.138297872340424, "alnum_prop": 0.6294746629474663, "repo_name": "mmillions/get-yelp-reviews", "id": "a095c8dcb44494f57d1db43005d286953aa099a5", ...
"""Common utility for topi test""" import tvm from tvm import topi _injective_schedule = { "generic": topi.generic.schedule_injective, "cpu": topi.x86.schedule_injective, "arm_cpu": topi.arm_cpu.schedule_injective, "gpu": topi.cuda.schedule_injective, "hls": topi.hls.schedule_injective, } _reduce...
{ "content_hash": "12d8d4cbc059c6a1a7c3c7403d6f9035", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 98, "avg_line_length": 30.580645161290324, "alnum_prop": 0.6919831223628692, "repo_name": "tqchen/tvm", "id": "51ea19afe7ce610b1d7c631db6050f5c8a6d6850", "size": "2712", ...
from datetime import date from graphql import ( GraphQLObjectType, GraphQLField, GraphQLArgument, GraphQLString, GraphQLInt, GraphQLNonNull, GraphQLList, GraphQLInputObjectType, GraphQLInputObjectField ) from api.graphql.common import SpotDateType, SpotIpType, SpotOperationOutputTyp...
{ "content_hash": "080032334816e7ee4d51bee6c168012b", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 129, "avg_line_length": 33.60891089108911, "alnum_prop": 0.6048018854028575, "repo_name": "LedaLima/incubator-spot", "id": "32c4aeaed0c2fb2a7bb6ca7772d207482718c3e3", "siz...
# Copyright (c) 2003-present, Jodd Team (http://jodd.org) # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list ...
{ "content_hash": "00f4d53f6471452f683991fa5c49fdc5", "timestamp": "", "source": "github", "line_count": 181, "max_line_length": 128, "avg_line_length": 24.845303867403317, "alnum_prop": 0.6644429619746498, "repo_name": "oblac/jodd", "id": "ce669f1c6917aa2459130fd0db459d3dd38691b7", "size": "4497", ...
import sys, os # 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 configurat...
{ "content_hash": "5e9fdd861fe26fbf9e42f34a7132cfaf", "timestamp": "", "source": "github", "line_count": 287, "max_line_length": 80, "avg_line_length": 31.83275261324042, "alnum_prop": 0.698007880910683, "repo_name": "mraspaud/dask", "id": "4c8576a5ddf8f330d012a4e9686b00fa29e2a422", "size": "9551", ...
from btlogic import term a = term(term=[0,1], type="minterm", bit=2) print a.getMaxterm()
{ "content_hash": "774a3a973d08b226372cd4a3cba50e4d", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 43, "avg_line_length": 22.5, "alnum_prop": 0.7, "repo_name": "bongtrop/python-btlogic", "id": "405d82fb5b6519c629944566ee76999a5e316162", "size": "108", "binary": false, ...
"""Run a basic simulation of the example origami system.""" from lattice_origami_domains import * # Specificy initial configuration by setting input file and step number #input_file = JSONInputFile('simple_loop_linear.json') input_file = JSONInputFile('simple_loop.json') #input_file = JSONInputFile('cyclic_example.js...
{ "content_hash": "4ce352618b87f29859f0a5e0e9090f69", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 81, "avg_line_length": 30.489795918367346, "alnum_prop": 0.715528781793842, "repo_name": "acumb/LatticeDNAOrigami", "id": "793322935a135b436a43c7cdee41fb9bc376aed1", "size"...
""" onedrive-d A Microsoft OneDrive client for Linux. :copyright: (c) Xiangyu Bu <xybu92@live.com> :license: MIT """ import os import pkgutil __project__ = 'onedrived' __author__ = 'Xiangyu Bu' __email__ = 'xybu92@live.com' __version__ = '2.0.0' __homepage__ = 'https://github.com/xybu/onedrived-dev' def mkdir(path,...
{ "content_hash": "92513daef495a47336a7678b7eba6238", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 76, "avg_line_length": 23.67391304347826, "alnum_prop": 0.620752984389348, "repo_name": "xybu/onedrived-dev", "id": "d5efe0d69b9d72ef200d496f48280bf66b139f15", "size": "108...
from six import string_types from six.moves import map # pylint: disable=redefined-builtin from .base import Resource, ResourceWithID class Domain(Resource): """ A domain resource, representing a domain name whose DNS is managed by DigitalOcean's nameservers. New domains are created via the...
{ "content_hash": "c7648076428c24933ea249a0c84ea9f4", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 81, "avg_line_length": 34.786026200873366, "alnum_prop": 0.599548079337183, "repo_name": "jwodder/doapi", "id": "fa21342bcdce8788624fcf7a29b3d64f26fd0c09", "size": "7966",...
from qtpy.QtWidgets import QWidget, QSizePolicy class FormBaseWidget(QWidget): def __init__(self): super().__init__() self.setMaximumWidth(400) self.setMinimumWidth(400) sp = self.sizePolicy() sp.setVerticalPolicy(QSizePolicy.Minimum) self.setSizePolicy(sp)
{ "content_hash": "7f1b6037882a135aaee763e9ff5e5595", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 49, "avg_line_length": 26.083333333333332, "alnum_prop": 0.6485623003194888, "repo_name": "NSLS-II-HXN/PyXRF", "id": "0311ba998257064c50476e8d29d345ce8f06aa1f", "size": "31...
import numpy as np def tensor(*args): return reduce(np.kron, args) def extend_vib_operator(n_vibrational_levels, m, vib_operator): """ Extends the vibrational operator vib_operator, associated with vibrational mode m, into an operator on the full vibrational subspace """ return tensor(np.eye...
{ "content_hash": "5ca9a5f14ecbfa2fcdb6246ca1473a54", "timestamp": "", "source": "github", "line_count": 334, "max_line_length": 80, "avg_line_length": 30.652694610778443, "alnum_prop": 0.6051963274076968, "repo_name": "shoyer/qspectra", "id": "67471c192694519bf20bb1c3b218e94e96eedee9", "size": "102...
import warnings from typing import Any, Dict, NamedTuple, Union, cast import numpy as np from onnx import OptionalProto, SequenceProto, TensorProto TensorDtypeMap = NamedTuple( "TensorDtypeMap", [("np_dtype", np.dtype), ("storage_dtype", int), ("name", str)] ) # tensor_dtype: (numpy type, storage type, string n...
{ "content_hash": "75fe3665b8b0c57ee932b6be3d3b0936", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 121, "avg_line_length": 38.21081081081081, "alnum_prop": 0.6582260574338662, "repo_name": "onnx/onnx", "id": "0c2aaa6c784d8b34fe404f85bb84df6252452171", "size": "7069", ...
__version__ = "0.3.0" try: __TRANSIT_SETUP__ except NameError: __TRANSIT_SETUP__ = False if not __TRANSIT_SETUP__: __all__ = ["System", "Central", "Body", "SimpleSystem"] from .transit import System, Central, Body from .simple import SimpleSystem
{ "content_hash": "f747dad01236fbe22865b0df3ad5dabf", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 59, "avg_line_length": 24.454545454545453, "alnum_prop": 0.6245353159851301, "repo_name": "dfm/transit", "id": "81c456fad1bcee5fb2f4cd81e9b78a377dc03cea", "size": "316", ...
"""Utilties for testing video models.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensor2tensor.data_generators import video_generated # pylint: disable=unused-import from tensor2tensor.layers import modalities from tensor2t...
{ "content_hash": "89758bd99be1d660d2a345b328884391", "timestamp": "", "source": "github", "line_count": 263, "max_line_length": 90, "avg_line_length": 39.10266159695818, "alnum_prop": 0.6361338000777907, "repo_name": "mlperf/training_results_v0.5", "id": "7bda4b09355b7203dec9fdc5f02658c4929afb94", ...
import pyqtgraph as pg from acq4.devices.DAQGeneric.taskGUI import DAQGenericTaskGui from acq4.util import Qt Ui_Form = Qt.importTemplate('.TaskTemplate') class CameraTaskGui(DAQGenericTaskGui): def __init__(self, dev, taskRunner): DAQGenericTaskGui.__init__(self, dev, taskRunner, ownUi=False) ## When i...
{ "content_hash": "4c9c300cc19f780d5f7160b38cf67128", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 154, "avg_line_length": 39.34108527131783, "alnum_prop": 0.609064039408867, "repo_name": "acq4/acq4", "id": "a44b9b36de96d20c0e2def7fc120a005f637c721", "size": "5099", "...
from interfaces import * from api import * import declarative __all__ = ['Schema'] class Schema(FancyValidator): """ A schema validates a dictionary of values, applying different validators (be key) to the different values. If allow_extra_fields=True, keys without validators will be allowed; oth...
{ "content_hash": "3ffb3daecf27e42fbb1f32211128b209", "timestamp": "", "source": "github", "line_count": 353, "max_line_length": 136, "avg_line_length": 36.54390934844193, "alnum_prop": 0.5235658914728683, "repo_name": "santisiri/popego", "id": "b6affd1aeb5d35717216e638f1caadda2a6e2bc8", "size": "12...
""" This module tries to retrieve as much platform-identifying data as possible. It makes this information available via function APIs. If called from the command line, it prints the platform information concatenated as single string to stdout. The output format is useable as part of a filename. """ ...
{ "content_hash": "c39c1054e4e79e80f46eb38e4a41695b", "timestamp": "", "source": "github", "line_count": 1784, "max_line_length": 128, "avg_line_length": 27.931053811659194, "alnum_prop": 0.5781171606895583, "repo_name": "ricarkol/agentless-system-crawler", "id": "07c87318cd54c39a90c17475303286482435d...
from modeltranslation.translator import translator, TranslationOptions from geotrek.common.models import Theme class ThemeTO(TranslationOptions): fields = ('label', ) translator.register(Theme, ThemeTO)
{ "content_hash": "d7c092c065ea60a2464cd53ffb30f0cd", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 70, "avg_line_length": 23.444444444444443, "alnum_prop": 0.8009478672985783, "repo_name": "johan--/Geotrek", "id": "009ce74a152b5b475af5ba43838c8c3aa7656b38", "size": "211",...
def msgRcv (timestamp, source, groupID, message, attachments): print ("msgRcv called") print (message) return from pydbus import SystemBus from gi.repository import GLib bus = SystemBus() loop = GLib.MainLoop() signal = bus.get('org.asamk.Signal') signal.onMessageReceived = msgRcv loop.run()
{ "content_hash": "dd22ba62d13b9b5313b38b50a8ae94a7", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 62, "avg_line_length": 20.4, "alnum_prop": 0.7352941176470589, "repo_name": "mh-g/python-signal-cli", "id": "1428c73e147b3f274759abe8680e156b5709d0db", "size": "341", "bi...
import datetime from south.db import db from south.v2 import DataMigration from django.db import models from oscar.core.utils import slugify class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." # Note: Remember to use orm['appname.ModelName'] rather than "fr...
{ "content_hash": "0f2da23e1edc6fa1bccf6db77add72d7", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 222, "avg_line_length": 83.72946859903382, "alnum_prop": 0.5608123701823217, "repo_name": "michaelBenin/django-oscar", "id": "53ca211eb3837becd04ff5ecabda1c2f1d1fe5be", "s...
import os import os.path import logging import hashlib import shutil import jsonHelper ##----------------------------------------------------------------## class CacheManager(object): _singleton = None @staticmethod def get(): return CacheManager._singleton def __init__( self ): assert not CacheManager._si...
{ "content_hash": "7eb151380c9b28c8ac2af4ca9aec9740", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 68, "avg_line_length": 17.444444444444443, "alnum_prop": 0.6178343949044586, "repo_name": "cloudteampro/juma-editor", "id": "4d36fe1f90a8c94ce509a44d1ea4bf5020b17dbd", "siz...
import pytest import libqtile import libqtile.confreader import libqtile.manager import libqtile.config import libqtile.layout import libqtile.bar import libqtile.widget class CallConfig(object): keys = [ libqtile.config.Key( ["control"], "j", libqtile.command._Call([("layout", No...
{ "content_hash": "353bdb452d4a25ae10547df1c2857a41", "timestamp": "", "source": "github", "line_count": 384, "max_line_length": 79, "avg_line_length": 26.3359375, "alnum_prop": 0.5981410066251359, "repo_name": "cortesi/qtile", "id": "4f82e1b36dca6a4ca61159b44de10c13fd2fc192", "size": "11314", "bi...
import unittest from oeqa.oetest import oeRuntimeTest, skipModule from oeqa.utils.decorators import * def setUpModule(): if not oeRuntimeTest.hasPackage("pax-utils"): skipModule("pax-utils package not installed") class ScanelfTest(oeRuntimeTest): def setUp(self): self.scancmd = 'scanelf --qui...
{ "content_hash": "e01ae03881962e3c35c942358cba07e8", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 79, "avg_line_length": 34.07142857142857, "alnum_prop": 0.6530398322851153, "repo_name": "wwright2/dcim3-angstrom1", "id": "43a024ab9a3471b7e49a73b0cf43bc89d65ad121", "size...
import inspect import mock import webob from nova.api.openstack import api_version_request as api_version from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova import exception from nova import i18n from nova import test from nova.tests.unit.api.openstack import fakes from nova.tests...
{ "content_hash": "b22136f83a957f1be445bae4654258f5", "timestamp": "", "source": "github", "line_count": 1156, "max_line_length": 79, "avg_line_length": 36.13235294117647, "alnum_prop": 0.5755464578993991, "repo_name": "cloudbase/nova-virtualbox", "id": "d431fbb7ce2ca785684ea82547640157e1d57576", "s...
""" Example code to call Rosette API to get the complete morphological analysis of a piece of text. """ import argparse import pprint from rosette.api import API, DocumentParameters parser = argparse.ArgumentParser(description="Get the complete morphological analysis of a piece of text") parser.add_argument("--key",...
{ "content_hash": "10e7b5cf21f3c103a0a595e8b5031cd9", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 106, "avg_line_length": 31.4, "alnum_prop": 0.7477707006369426, "repo_name": "JamieMoon/rosette-api", "id": "ae13be19e129e4726808d937429a0ab29f5f65e9", "size": "810", "bi...
from PIL import Image from six import StringIO from django.core.files.uploadedfile import InMemoryUploadedFile def gen_watermark_and_thumbnail_of_image(source, watermark_path=None, thumbnail_width=640): """ :source: an instance of django's InMemoryUploadedFile """ # TODO: need to specify the real wat...
{ "content_hash": "71fb6c714ef91206dd11e4e3c689f420", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 116, "avg_line_length": 38.88461538461539, "alnum_prop": 0.6409495548961425, "repo_name": "theo-l/django_common", "id": "40a72f6f70fc2491ecae5c6befb8197e8ccf9993", "size": ...
from __future__ import (absolute_import, print_function) # From system from boto.s3.connection import S3Connection from boto.s3.key import Key import boto3 from boto3.session import Session from boto3.s3.transfer import (S3Transfer, TransferConfig) try: from cStringIO import StringIO except ImportError: from S...
{ "content_hash": "0a990fe4899a2efe21678fc4f45d7436", "timestamp": "", "source": "github", "line_count": 345, "max_line_length": 143, "avg_line_length": 33.971014492753625, "alnum_prop": 0.6030716723549489, "repo_name": "kikinteractive/cassandra_snapshotter", "id": "23b878593c2f694a78b2d4a231f7e809222...