repo_name stringlengths 7 94 | repo_path stringlengths 4 237 | repo_head_hexsha stringlengths 40 40 | content stringlengths 10 680k | apis stringlengths 2 680k |
|---|---|---|---|---|
tpudlik/RaspAC | website/raspac.py | e0a01a8b9123e74f6e4fb53f084e4ddf3ea24677 | import sqlite3
import subprocess, datetime
from flask import Flask, request, session, g, redirect, url_for, \
abort, render_template, flash
from contextlib import closing
from tquery import get_latest_record
from config import *
app = Flask(__name__)
app.config.from_object(__name__)... | [((272, 287), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (277, 287), False, 'from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash\n'), ((373, 412), 'sqlite3.connect', 'sqlite3.connect', (["app.config['DATABASE']"], {}), "(app.config['DATABASE'])\n", (388, 412),... |
NLESC-JCER/pyspectra | tests/util_test.py | b7ece1fff537039f3306b23e00812aa1c8ffc729 | """Helper functions to tests."""
import numpy as np
def norm(vs: np.array) -> float:
"""Compute the norm of a vector."""
return np.sqrt(np.dot(vs, vs))
def create_random_matrix(size: int) -> np.array:
"""Create a numpy random matrix."""
return np.random.normal(size=size ** 2).reshape(size, size)
... | [((147, 161), 'numpy.dot', 'np.dot', (['vs', 'vs'], {}), '(vs, vs)\n', (153, 161), True, 'import numpy as np\n'), ((265, 297), 'numpy.random.normal', 'np.random.normal', ([], {'size': '(size ** 2)'}), '(size=size ** 2)\n', (281, 297), True, 'import numpy as np\n'), ((705, 741), 'numpy.dot', 'np.dot', (['matrix', 'eigen... |
leetcode-notebook/wonz | solutions/Interview-03-shu-zu-zhong-zhong-fu-de-shu-zi-lcof/03.py | 9ffd2ce9b5f3a544ee958f5a0673215afd176c2b | from typing import List
class Solution:
def findRepeatNumber(self, nums: List[int]) -> int:
# solution one: 哈希表
n = len(nums)
flag = [False for i in range(n)]
for i in range(n):
if flag[nums[i]] == False:
flag[nums[i]] = True
else:
... | [] |
Charles-Peeke/gwu_nn | examples/test_network.py | 3f5e9937abf2bfb81a74a2d6f3653a661e705f67 | import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from gwu_nn.gwu_network import GWUNetwork
from gwu_nn.layers import Dense
from gwu_nn.activation_layers import Sigmoid
np.random.seed(8)
num_obs = 8000
# Create our features to draw from two distinct 2D... | [((233, 250), 'numpy.random.seed', 'np.random.seed', (['(8)'], {}), '(8)\n', (247, 250), True, 'import numpy as np\n'), ((348, 418), 'numpy.random.multivariate_normal', 'np.random.multivariate_normal', (['[0, 0]', '[[1, 0.75], [0.75, 1]]', 'num_obs'], {}), '([0, 0], [[1, 0.75], [0.75, 1]], num_obs)\n', (377, 418), True... |
XiaoboLinlin/scattering | scattering/van_hove.py | 0173b63f3243bdbcccfa562dbf5e3714920cded2 | import itertools as it
import numpy as np
import mdtraj as md
from progressbar import ProgressBar
from scattering.utils.utils import get_dt
from scattering.utils.constants import get_form_factor
def compute_van_hove(trj, chunk_length, water=False,
r_range=(0, 1.0), bin_width=0.005, n_bins=None,... | [((1585, 1643), 'itertools.combinations_with_replacement', 'it.combinations_with_replacement', (['unique_elements[::-1]', '(2)'], {}), '(unique_elements[::-1], 2)\n', (1617, 1643), True, 'import itertools as it\n'), ((5407, 5418), 'scattering.utils.utils.get_dt', 'get_dt', (['trj'], {}), '(trj)\n', (5413, 5418), False,... |
QDucasse/nn_benchmark | nn_benchmark/networks/__init__.py | 0a32db241e75853c7d78dccf6d7b6940e5a0e4d0 | # -*- coding: utf-8 -*-
# nn_benchmark
# author - Quentin Ducasse
# https://github.com/QDucasse
# quentin.ducasse@ensta-bretagne.org
from __future__ import absolute_import
__all__ = ["lenet","lenet5","quant_lenet5",
"quant_cnv", "quant_tfc",
"mobilenetv1","quant_mobilenetv1",
"vggnet... | [] |
NeeharikaDva/opencv_course | Section1_Basics/contours.py | 234515ab59a1228c8dfd3c69f310dbc1d86c6089 | #pylint:disable=no-member
import cv2 as cv
import numpy as np
img = cv.imread('/Users/webileapp/Desktop/niharika_files/projects/opencv_course_master/Resources/Photos/cats.jpg')
cv.imshow('Cats', img)
#
blank = np.zeros(img.shape[:2], dtype='uint8')
cv.imshow('Blank', blank)
gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)... | [((70, 188), 'cv2.imread', 'cv.imread', (['"""/Users/webileapp/Desktop/niharika_files/projects/opencv_course_master/Resources/Photos/cats.jpg"""'], {}), "(\n '/Users/webileapp/Desktop/niharika_files/projects/opencv_course_master/Resources/Photos/cats.jpg'\n )\n", (79, 188), True, 'import cv2 as cv\n'), ((179, 201... |
RangeKing/FCOSR | mmdet/ops/fcosr_tools/__init__.py | b92f0cee2e89d6a268884bacd02fb28881cd44a4 | from . import fcosr_tools
__all__ = ['fcosr_tools'] | [] |
Jnalis/frappe-health-care | health_care/health_care/doctype/practitioner/practitioner.py | ed347c216f568cc044c1365965d35945697cf7dc | # Copyright (c) 2022, Juve and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class Practitioner(Document):
def before_save(self):
self.practitioner_full_name = f'{self.first_name} {self.second_name or ""}'
| [] |
JustasGau/DonjinKrawler | install-hooks.py | faff50dcfcebf82028c9af10434359f975247d33 | import sys
from os import path
import urllib; from urllib.request import urlretrieve
from subprocess import call
def install_hooks(directory):
checkstyleUrl = 'https://github.com/checkstyle/checkstyle/releases/download/checkstyle-8.36.1/checkstyle-8.36.1-all.jar'
preCommitUrl = 'https://gist.githubusercontent.... | [((516, 539), 'os.path.abspath', 'path.abspath', (['directory'], {}), '(directory)\n', (528, 539), False, 'from os import path\n'), ((634, 704), 'urllib.request.urlretrieve', 'urlretrieve', (['checkstyleUrl', "(basePath + '/.git/hooks/' + checkstyleName)"], {}), "(checkstyleUrl, basePath + '/.git/hooks/' + checkstyleNa... |
Rockfish/PythonCourse | 09_MicroServer_Cookies/micro_server.py | 1d650e49950d1987d052028139fcdfcb0bbfcc70 | """
Micro webapp based on WebOb, Jinja2, WSGI with a simple router
"""
import os
import hmac
import hashlib
import mimetypes
from wsgiref.simple_server import WSGIServer, WSGIRequestHandler
from webob import Request
from webob import Response
from jinja2 import Environment, FileSystemLoader
class MicroServer(obje... | [((1522, 1538), 'webob.Request', 'Request', (['environ'], {}), '(environ)\n', (1529, 1538), False, 'from webob import Request\n'), ((1563, 1573), 'webob.Response', 'Response', ([], {}), '()\n', (1571, 1573), False, 'from webob import Response\n'), ((3802, 3844), 'wsgiref.simple_server.WSGIServer', 'WSGIServer', (["('',... |
clouserw/olympia | apps/addons/management/commands/jetpackers.py | 1d5755b08a526372ec66e6bc64ab636018181969 | import logging
from django.core import mail
from django.conf import settings
from django.core.management.base import BaseCommand
import amo.utils
from users.models import UserProfile
log = logging.getLogger('z.mailer')
FROM = settings.DEFAULT_FROM_EMAIL
class Command(BaseCommand):
help = "Send the email for bu... | [] |
edose/astroplan | astroplan/constraints.py | b3cf55340c50ccf69ec363889c1fe8ff2f93cada | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Specify and constraints to determine which targets are observable for
an observer.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
# Standard library
from abc import ABCMeta, abstractme... | [((1322, 1338), 'time.localtime', 'time.localtime', ([], {}), '()\n', (1336, 1338), False, 'import time\n'), ((15084, 15115), 'astropy.units.quantity_input', 'u.quantity_input', ([], {'horizon': 'u.deg'}), '(horizon=u.deg)\n', (15100, 15115), True, 'import astropy.units as u\n'), ((36318, 36360), 'numpy.logical_and.red... |
Raulios/django-blog | backend/views.py | ff25c8f21a3f6644e77a2ef5bb7bf7026770e0c2 | from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.core.urlresolvers import reverse
from django.shortcuts import render
from django.http import HttpResponseRedirect
from core.models import Po... | [((424, 440), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {}), '()\n', (438, 440), False, 'from django.contrib.auth.decorators import login_required\n'), ((575, 591), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {}), '()\n', (589, 591), False, 'from django.contrib.... |
FynnBe/tiktorch | tiktorch/server/session/process.py | 60c6fa9700e7ff73e44338e8755c56c6e8846f2f | import dataclasses
import io
import multiprocessing as _mp
import uuid
import zipfile
from concurrent.futures import Future
from multiprocessing.connection import Connection
from typing import List, Optional, Tuple
import numpy
from tiktorch import log
from tiktorch.rpc import Shutdown
from tiktorch.rpc import mp as ... | [((2405, 2433), 'tiktorch.rpc.mp.MPServer', 'MPServer', (['session_proc', 'conn'], {}), '(session_proc, conn)\n', (2413, 2433), False, 'from tiktorch.rpc.mp import MPServer\n'), ((2640, 2650), 'multiprocessing.Pipe', '_mp.Pipe', ([], {}), '()\n', (2648, 2650), True, 'import multiprocessing as _mp\n'), ((2662, 2842), 'm... |
dangerstudios/OpenPype | openpype/modules/ftrack/event_handlers_server/event_del_avalon_id_from_new.py | 10ddcc4699137888616eec57cd7fac9648189714 | from openpype.modules.ftrack.lib import BaseEvent
from openpype.modules.ftrack.lib.avalon_sync import CUST_ATTR_ID_KEY
from openpype.modules.ftrack.event_handlers_server.event_sync_to_avalon import (
SyncToAvalonEvent
)
class DelAvalonIdFromNew(BaseEvent):
'''
This event removes AvalonId from custom attri... | [] |
elifesciences/elife-bot | tests/workflow/test_workflow_ingest_accepted_submission.py | d3a102c8030e4b7ec83cbd45e5f839dba4f9ffd9 | import unittest
import tests.settings_mock as settings_mock
from tests.activity.classes_mock import FakeLogger
from workflow.workflow_IngestAcceptedSubmission import workflow_IngestAcceptedSubmission
class TestWorkflowIngestAcceptedSubmission(unittest.TestCase):
def setUp(self):
self.workflow = workflow_I... | [((372, 384), 'tests.activity.classes_mock.FakeLogger', 'FakeLogger', ([], {}), '()\n', (382, 384), False, 'from tests.activity.classes_mock import FakeLogger\n')] |
lynnUg/vumi-go | go/token/views.py | 852f906c46d5d26940bd6699f11488b73bbc3742 | from urllib import urlencode
import urlparse
from django.shortcuts import Http404, redirect
from django.contrib.auth.views import logout
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from vumi.utils import load_class_by_strin... | [((526, 536), 'go.base.utils.vumi_api', 'vumi_api', ([], {}), '()\n', (534, 536), False, 'from go.base.utils import vumi_api\n'), ((2263, 2298), 'vumi.utils.load_class_by_string', 'load_class_by_string', (['callback_name'], {}), '(callback_name)\n', (2283, 2298), False, 'from vumi.utils import load_class_by_string\n'),... |
tylerbutler/typogrify | typogrify/templatetags/typogrify_tags.py | 7b7a67348a2d51400fd38c0b61e30e34ca98994e | from typogrify.filters import amp, caps, initial_quotes, smartypants, titlecase, typogrify, widont, TypogrifyError
from functools import wraps
from django.conf import settings
from django import template
from django.utils.safestring import mark_safe
from django.utils.encoding import force_unicode
register = template.... | [] |
carbrock/bvbabel | bvbabel/vmr.py | baac12d106455e34d9924309eadb4df991d3d8c9 | """Read, write, create Brainvoyager VMR file format."""
import struct
import numpy as np
from bvbabel.utils import (read_variable_length_string,
write_variable_length_string)
# =============================================================================
def read_vmr(filename):
"""Read... | [((3535, 3605), 'numpy.zeros', 'np.zeros', (["(header['DimZ'] * header['DimY'] * header['DimX'])"], {'dtype': '"""<B"""'}), "(header['DimZ'] * header['DimY'] * header['DimX'], dtype='<B')\n", (3543, 3605), True, 'import numpy as np\n'), ((3752, 3822), 'numpy.reshape', 'np.reshape', (['data_img', "(header['DimZ'], heade... |
Vikas-kum/incubator-mxnet | example/image-classification/test_score.py | ba02bf2fe2da423caa59ddb3fd5e433b90b730bf | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [((1002, 1078), 'mxnet.test_utils.download', 'mx.test_utils.download', (['"""http://data.mxnet.io/data/val-5k-256.rec"""', 'VAL_DATA'], {}), "('http://data.mxnet.io/data/val-5k-256.rec', VAL_DATA)\n", (1024, 1078), True, 'import mxnet as mx\n'), ((1595, 1618), 'mxnet.metric.create', 'mx.metric.create', (['"""acc"""'], ... |
vertica/vertica_ml_python | verticapy/vcolumn.py | 9e82dba94afe8447bfa2492f343af6669128e2fb | # (c) Copyright [2018-2022] Micro Focus or one of its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | [((21802, 21871), 'verticapy.plot.bar', 'bar', (['self', 'method', 'of', 'max_cardinality', 'nbins', 'h'], {'ax': 'ax'}), '(self, method, of, max_cardinality, nbins, h, ax=ax, **style_kwds)\n', (21805, 21871), False, 'from verticapy.plot import bar\n'), ((23663, 23735), 'verticapy.plot.boxplot', 'boxplot', (['self', 'b... |
MagicSword/Booktags | booktags/flaskapp/book/views.py | 44142e19aec5ce75266233964d7ab21503bbe57c | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
example.py
~~~~~~~~~
A simple command line application to run flask apps.
:copyright: 2019 Miller
:license: BSD-3-Clause
"""
# Known bugs that can't be fixed here:
# - synopsis() cannot be prevented from clobbering existing
# loaded modules.
... | [((1136, 1155), 'flask_sqlalchemy.get_debug_queries', 'get_debug_queries', ([], {}), '()\n', (1153, 1155), False, 'from flask_sqlalchemy import get_debug_queries\n'), ((1611, 1648), 'flask.request.args.get', 'request.args.get', (['"""page"""', '(1)'], {'type': 'int'}), "('page', 1, type=int)\n", (1627, 1648), False, 'f... |
Snider/narwhallet | narwhallet/core/kws/http/enumerations/mediatypes.py | 0d528763c735f1e68b8264e302854d41e7cf1956 | from enum import Enum
class content_type(Enum):
# https://www.iana.org/assignments/media-types/media-types.xhtml
css = 'text/css'
gif = 'image/gif'
htm = 'text/html'
html = 'text/html'
ico = 'image/bmp'
jpg = 'image/jpeg'
jpeg = 'image/jpeg'
js = 'application/javascript'
png = ... | [] |
drix00/ElectronDiffraction | electrondiffraction/__init__.py | 9dc258d90d0b73745b904b1bb6e1e3e794403a27 | # -*- coding: utf-8 -*-
__author__ = """Hendrix Demers"""
__email__ = 'hendrix.demers@mail.mcgill.ca'
__version__ = '0.1.0'
| [] |
markembling/storelet | storelet.py | 9951368e2f143855d2c14509bdb8cf796d6e54b8 | import os
import logging
from tempfile import mkstemp, mkdtemp
from shutil import rmtree
from zipfile import ZipFile, ZIP_DEFLATED
from datetime import datetime
from boto.s3.connection import S3Connection
from boto.s3.key import Key
__version__ = "0.1.8"
__author__ = "Mark Embling"
__email__ = "mark@markembling.info"
... | [((330, 357), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (347, 357), False, 'import logging\n'), ((376, 397), 'logging.NullHandler', 'logging.NullHandler', ([], {}), '()\n', (395, 397), False, 'import logging\n'), ((683, 710), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '(... |
jimforit/lagou | apps/delivery/migrations/0001_initial.py | 165593a15597012092b5e0ba34158fbc1d1c213d | # Generated by Django 2.0.2 on 2019-03-08 13:03
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Delivery',
fields=[
('create_time', models.... | [((313, 373), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)', 'verbose_name': '"""创建时间"""'}), "(auto_now_add=True, verbose_name='创建时间')\n", (333, 373), False, 'from django.db import migrations, models\n'), ((408, 464), 'django.db.models.DateTimeField', 'models.DateTimeField', (... |
vargad/exercises | elementary/date-and-time-convertor.py | 1a2fc2557672749d590ebdf596f99f53405320a1 | #!/usr/bin/env python3
def date_time(time):
months = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"]
hour, minute = int(time[11:13]), int(time[14:16])
return f"{int(time[0:2])} {months[int(time[3:5])-1]} {time[6:10]} year {h... | [] |
snapperVibes/lbry-sdk | lbry/wallet/server/peer.py | 77a51d1ad43404e5dc52af715a7bebfaeb3fee16 | # Copyright (c) 2017, Neil Booth
#
# All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the r... | [((5528, 5561), 'lbry.wallet.server.util.is_valid_hostname', 'util.is_valid_hostname', (['self.host'], {}), '(self.host)\n', (5550, 5561), False, 'from lbry.wallet.server import util\n'), ((8080, 8112), 'lbry.wallet.server.util.protocol_tuple', 'util.protocol_tuple', (['version_str'], {}), '(version_str)\n', (8099, 811... |
aomann/core | tests/components/deconz/test_diagnostics.py | 5e71e7b775461cd4849c36075c6a1459a7d0ad22 | """Test deCONZ diagnostics."""
from unittest.mock import patch
from pydeconz.websocket import STATE_RUNNING
from homeassistant.const import Platform
from .test_gateway import DECONZ_CONFIG, setup_deconz_integration
from tests.components.diagnostics import get_diagnostics_for_config_entry
async def test_entry_dia... | [((610, 725), 'unittest.mock.patch', 'patch', (['"""homeassistant.helpers.system_info.async_get_system_info"""'], {'return_value': "{'get_system_info': 'fake data'}"}), "('homeassistant.helpers.system_info.async_get_system_info',\n return_value={'get_system_info': 'fake data'})\n", (615, 725), False, 'from unittest.... |
l1zp/jax-md | jax_md/partition.py | 2440794aebb1c77116459e2ec2051d537a94ecf4 | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [((2979, 3018), 'numpy.floor', 'onp.floor', (['(box_size / minimum_cell_size)'], {}), '(box_size / minimum_cell_size)\n', (2988, 3018), True, 'import numpy as onp\n'), ((3078, 3120), 'numpy.array', 'onp.array', (['cells_per_side'], {'dtype': 'jnp.int64'}), '(cells_per_side, dtype=jnp.int64)\n', (3087, 3120), True, 'imp... |
sebascuri/rhucrl | rhucrl_experiments/evaluate/launch_evaluate_mass.py | 27663e1302f3bbc636dff28495c6f2667bb7c1da | """Run from rhucrl_experiments.evaluate folder."""
import socket
from lsf_runner import init_runner, make_commands
from rhucrl_experiments.evaluate.utilities import ENVIRONMENTS
RARL_DIR = "../../runs/RARLAgent"
ZERO_SUM_DIR = "../../runs/ZeroSumAgent"
SCRIPT = "evaluate_mass_change.py"
EXPERIMENTS = {
"supermod... | [((650, 699), 'lsf_runner.init_runner', 'init_runner', (['"""EvaluateMassChange."""'], {'num_threads': '(4)'}), "('EvaluateMassChange.', num_threads=4)\n", (661, 699), False, 'from lsf_runner import init_runner, make_commands\n'), ((573, 593), 'socket.gethostname', 'socket.gethostname', ([], {}), '()\n', (591, 593), Fa... |
seukjung/sentry-custom | src/sentry/api/endpoints/project_tags.py | c5f6bb2019aef3caff7f3e2b619f7a70f2b9b963 | from __future__ import absolute_import
import six
from rest_framework.response import Response
from sentry.api.bases.project import ProjectEndpoint
from sentry.models import TagKey, TagKeyStatus
class ProjectTagsEndpoint(ProjectEndpoint):
def get(self, request, project):
tag_keys = TagKey.objects.filte... | [((300, 367), 'sentry.models.TagKey.objects.filter', 'TagKey.objects.filter', ([], {'project': 'project', 'status': 'TagKeyStatus.VISIBLE'}), '(project=project, status=TagKeyStatus.VISIBLE)\n', (321, 367), False, 'from sentry.models import TagKey, TagKeyStatus\n'), ((724, 738), 'rest_framework.response.Response', 'Resp... |
TensorTom/async-Eel | examples/02 - callbacks/callbacks.py | d6484b6c5c9f89b64f5119d908fcdf29b173bd57 | from __future__ import print_function # For Py2/3 compatibility
import async_eel
import random
import asyncio
loop = asyncio.get_event_loop()
@async_eel.expose
async def py_random():
return random.random()
async def print_num(n):
"""callback of js_random"""
print('Got this from Javascript:', n)
asyn... | [((119, 143), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (141, 143), False, 'import asyncio\n'), ((198, 213), 'random.random', 'random.random', ([], {}), '()\n', (211, 213), False, 'import random\n'), ((351, 372), 'async_eel.init', 'async_eel.init', (['"""web"""'], {}), "('web')\n", (365, 372... |
AMA-AC/datacube-core | datacube/index/_api.py | 0d2fe0792cb9298cc93d1a97bbb921cfa59d6f2d | # coding=utf-8
"""
Access methods for indexing datasets & products.
"""
import logging
from datacube.config import LocalConfig
from datacube.drivers import index_driver_by_name, index_drivers
from .index import Index
_LOG = logging.getLogger(__name__)
def index_connect(local_config=None, application_name=None, val... | [((227, 254), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (244, 254), False, 'import logging\n'), ((1110, 1143), 'datacube.drivers.index_driver_by_name', 'index_driver_by_name', (['driver_name'], {}), '(driver_name)\n', (1130, 1143), False, 'from datacube.drivers import index_driver_by... |
WeilerWebServices/PostgreSQL | pgarchives/loader/load_message.py | ae594ed077bebbad1be3c1d95c38b7c2c2683e8c | #!/usr/bin/env python3
#
# load_message.py - takes a single email or mbox formatted
# file on stdin or in a file and reads it into the database.
#
import os
import sys
from optparse import OptionParser
from configparser import ConfigParser
import psycopg2
from lib.storage import ArchivesParserStorage
from lib.mbox ... | [((612, 712), 'lib.log.log.error', 'log.error', (["('Failed to load message (msgid %s) from %s, spec %s: %s' % (msgid, srctype,\n src, err))"], {}), "('Failed to load message (msgid %s) from %s, spec %s: %s' % (msgid,\n srctype, src, err))\n", (621, 712), False, 'from lib.log import log, opstatus\n'), ((1190, 120... |
manson800819/test | shop/migrations/0009_auto_20200310_1430.py | 6df7d92eababe76a54585cb8102a00a6d79ca467 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-03-10 14:30
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('shop', '0008_auto_20200310_1134'),
]
operations =... | [((331, 387), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""category"""', 'name': '"""id"""'}), "(model_name='category', name='id')\n", (353, 387), False, 'from django.db import migrations, models\n'), ((533, 620), 'django.db.models.CharField', 'models.CharField', ([], {'db_index... |
jrcai/ACE | lib/dataset/iNaturalist.py | 1e2b04d1cf4bb517f107664ac489a1a96e95a4c1 | from dataset.baseset import BaseSet
import random, cv2
import numpy as np
class iNaturalist(BaseSet):
def __init__(self, mode='train', cfg=None, transform=None):
super(iNaturalist, self).__init__(mode, cfg, transform)
random.seed(0)
self.class_dict = self._get_class_dict()
... | [((248, 262), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (259, 262), False, 'import random, cv2\n'), ((1059, 1088), 'random.choice', 'random.choice', (['sample_indexes'], {}), '(sample_indexes)\n', (1072, 1088), False, 'import random, cv2\n'), ((651, 690), 'random.randint', 'random.randint', (['(0)', '(self.... |
mattclark/osf.io | tests/test_conferences.py | 7a362ceb6af3393d3d0423aafef336ee13277303 | # -*- coding: utf-8 -*-
import mock
from nose.tools import * # noqa (PEP8 asserts)
import hmac
import hashlib
from StringIO import StringIO
from django.core.exceptions import ValidationError
from django.db import IntegrityError
import furl
from framework.auth import get_or_create_user
from framework.auth.core impo... | [((799, 825), 'furl.furl', 'furl.furl', (['settings.DOMAIN'], {}), '(settings.DOMAIN)\n', (808, 825), False, 'import furl\n'), ((843, 857), 'furl.furl', 'furl.furl', (['url'], {}), '(url)\n', (852, 857), False, 'import furl\n'), ((971, 987), 'furl.furl', 'furl.furl', (['first'], {}), '(first)\n', (980, 987), False, 'im... |
innovationgarage/socket-tentacles | socket_tentacles/__init__.py | 1cfbf7649017493fafacfcbc96cd05f3c4c5d6b6 | import socketserver
import socket
import sys
import threading
import json
import queue
import time
import datetime
import traceback
class TCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
def server_bind(self):
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self.soc... | [((1097, 1140), 'threading.Thread.__init__', 'threading.Thread.__init__', (['self', '*arg'], {}), '(self, *arg, **kw)\n', (1122, 1140), False, 'import threading\n'), ((3331, 3392), 'json.dumps', 'json.dumps', (['connection'], {'sort_keys': '(True)', 'separators': "(',', ':')"}), "(connection, sort_keys=True, separators... |
shooking/ZoomPedalFun | G5/DerivedData/ParameterProbing/checkme.py | 7b9f5f4441cfe42e988e06cf6b98603c21ac2466 | # -*- coding: ascii -*-
import sys
import json
def check(data):
OnOffstart = data.find(b"OnOff")
if OnOffstart != -1:
fxName=""
OnOffblockSize = 0x30
for j in range(12):
if data[OnOffstart + j + OnOffblockSize] == 0x00:
break
fxName ... | [((3647, 3673), 'json.dump', 'json.dump', (['tD', 'f'], {'indent': '(4)'}), '(tD, f, indent=4)\n', (3656, 3673), False, 'import json\n')] |
pilihaotian/pythonlearning | leehao/learn63.py | e84b7766cc9ea8131e9720fb1f06761c9581d0da | # 随机6位密码 a-zA-Z0-9下划线
import random
source = ''
lower_char = [chr(x) for x in range(ord('a'), ord('z') + 1)]
upper_char = [chr(x) for x in range(ord('A'), ord('Z') + 1)]
number_char = [chr(x) for x in range(ord('0'), ord('9') + 1)]
source += "".join(lower_char)
source += "".join(upper_char)
source += "".join(number_ch... | [((400, 425), 'random.sample', 'random.sample', (['source', '(20)'], {}), '(source, 20)\n', (413, 425), False, 'import random\n')] |
fga-eps-mds/2017.2-SiGI-Op_API | gbic/tests.py | 4532019c15414fd17e06bb3aa78501886e00da1d | from django.test import TestCase
from rest_framework.test import APIRequestFactory
from .models import GBIC, GBICType
from .views import GBICListViewSet
# Create your tests here.
class GBICTest(TestCase):
def test_gbic_view_set(self):
request = APIRequestFactory().get("")
gbic_detail = GBICListVi... | [((260, 279), 'rest_framework.test.APIRequestFactory', 'APIRequestFactory', ([], {}), '()\n', (277, 279), False, 'from rest_framework.test import APIRequestFactory\n'), ((765, 784), 'rest_framework.test.APIRequestFactory', 'APIRequestFactory', ([], {}), '()\n', (782, 784), False, 'from rest_framework.test import APIReq... |
alienkrieg/fruits | fruits/core/fruit.py | b3b4b6afd7f97d2d4060909689f9811dc97981ed | import inspect
from typing import List, Union, Set, Any
import numpy as np
from fruits.cache import Cache, CoquantileCache
from fruits.scope import force_input_shape, FitTransform
from fruits.core.callback import AbstractCallback
from fruits.signature.iss import SignatureCalculator, CachePlan
from fruits.words.word i... | [((6257, 6299), 'numpy.nan_to_num', 'np.nan_to_num', (['result'], {'copy': '(False)', 'nan': '(0.0)'}), '(result, copy=False, nan=0.0)\n', (6270, 6299), True, 'import numpy as np\n'), ((15954, 15971), 'fruits.cache.CoquantileCache', 'CoquantileCache', ([], {}), '()\n', (15969, 15971), False, 'from fruits.cache import C... |
pa3kDaWae/workoutizer | workoutizer/__main__.py | 15501d0060711bbd8308642bc89b45c1442d4d0f | import os
import argparse
import subprocess
import socket
import sys
import click
from django.core.management import execute_from_command_line
from workoutizer.settings import WORKOUTIZER_DIR, WORKOUTIZER_DB_PATH, TRACKS_DIR
from workoutizer import __version__
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
SE... | [((330, 361), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""setup"""'], {}), "(BASE_DIR, 'setup')\n", (342, 361), False, 'import os\n'), ((561, 574), 'click.group', 'click.group', ([], {}), '()\n', (572, 574), False, 'import click\n'), ((598, 763), 'click.command', 'click.command', ([], {'help': '"""Mandatory comma... |
matanhofree/bcbio-nextgen | bcbio/bam/trim.py | e6938cedb20ff3b7632165105941d71189e46aac | """Provide trimming of input reads from Fastq or BAM files.
"""
import os
import sys
import tempfile
from bcbio.utils import (file_exists, safe_makedir,
replace_suffix, append_stem, is_pair,
replace_directory, map_wrap)
from bcbio.log import logger
from bcbio.bam impor... | [((917, 967), 'bcbio.pipeline.config_utils.get_resources', 'config_utils.get_resources', (['"""AlienTrimmer"""', 'config'], {}), "('AlienTrimmer', config)\n", (943, 967), False, 'from bcbio.pipeline import config_utils\n'), ((1251, 1296), 'bcbio.pipeline.config_utils.get_jar', 'config_utils.get_jar', (['"""AlienTrimmer... |
nasserarbabi/FEniCSUI-dev | FEniCSUI/AnalysesHub/views.py | f8f161e1b49932843e01301212e7d031fff4f6c8 | from rest_framework.response import Response
from rest_framework.views import APIView
from django.shortcuts import get_object_or_404
from dashboard.models import projects
from .models import AnalysisConfig, SolverResults, SolverProgress, DockerLogs
from rest_framework.parsers import FormParser, JSONParser, MultiPartPar... | [((787, 839), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['projects'], {'id': "kwargs['project_id']"}), "(projects, id=kwargs['project_id'])\n", (804, 839), False, 'from django.shortcuts import get_object_or_404\n'), ((984, 1015), 'json.loads', 'json.loads', (['parentConfig.config'], {}), '(parentConfi... |
EnjoyLifeFund/macHighSierra-py36-pkgs | fs/opener/appfs.py | 5668b5785296b314ea1321057420bcd077dba9ea | # coding: utf-8
"""``AppFS`` opener definition.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from .base import Opener
from .errors import OpenerError
from ..subfs import ClosingSubFS
from .. import appfs
class AppFSOpener(Opener):
"""``... | [] |
cyberj0g/verification-classifier | scripts/modeling_toolbox/evaluation.py | efb19a3864e27a7f149a1c27ee8e13eaa19f96eb | import numpy as np
from sklearn.metrics import fbeta_score, roc_curve, auc, confusion_matrix
from sklearn.decomposition import PCA
from sklearn import random_projection
from sklearn import svm
from sklearn.ensemble import IsolationForest
import matplotlib.pyplot as plt
from keras.layers import Dense, Input, Dropout
fro... | [((6712, 6744), 'keras.layers.Input', 'Input', ([], {'shape': '(x_train.shape[1],)'}), '(shape=(x_train.shape[1],))\n', (6717, 6744), False, 'from keras.layers import Dense, Input, Dropout\n'), ((6920, 6948), 'keras.models.Model', 'Model', (['input_vector', 'decoded'], {}), '(input_vector, decoded)\n', (6925, 6948), Fa... |
mrtazz/notifo.py | tests/test_notifo_message.py | 26079db3b40c26661155af20a9f16a0eca06dbde | # encoding: utf-8
import unittest
import os
import sys
sys.path.append(os.getcwd())
from notifo import Notifo, send_message
class TestNotifyUser(unittest.TestCase):
def setUp(self):
self.provider = "test_provider"
self.provider_banned = "test_provider_msg_banned"
self.user = "test_user"
... | [((71, 82), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (80, 82), False, 'import os\n'), ((1880, 1895), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1893, 1895), False, 'import unittest\n'), ((804, 878), 'notifo.send_message', 'send_message', (['self.sender', 'self.sender_token'], {'to': 'self.user', 'msg': '""... |
wqqpp007/geoist | geoist/cattools/Smoothing.py | 116b674eae3da4ee706902ce7f5feae1f61f43a5 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
import numpy as np
import .Selection as Sel
import .Exploration as Exp
import .CatUtils as CU
#-----------------------------------------------------------------------------------------
def GaussWin (Dis, Sig):
return np.exp(-(Dis**2)/(Sig**2.))
#------------------... | [] |
dkarmon/HebSafeHarbor | hebsafeharbor/identifier/signals/lexicon_based_recognizer.py | fdad7481c74feb78f8c3265c327eae7712cf16ce | from typing import List
from presidio_analyzer import EntityRecognizer, RecognizerResult, AnalysisExplanation
from presidio_analyzer.nlp_engine import NlpArtifacts
from hebsafeharbor.common.terms_recognizer import TermsRecognizer
class LexiconBasedRecognizer(EntityRecognizer):
"""
A class which extends the E... | [((1415, 1443), 'hebsafeharbor.common.terms_recognizer.TermsRecognizer', 'TermsRecognizer', (['phrase_list'], {}), '(phrase_list)\n', (1430, 1443), False, 'from hebsafeharbor.common.terms_recognizer import TermsRecognizer\n'), ((2536, 2597), 'presidio_analyzer.AnalysisExplanation', 'AnalysisExplanation', (['self.name',... |
cyx233/vim_config | my_plugins/YouCompleteMe/third_party/ycmd/ycmd/tests/clangd/subcommands_test.py | f09c9206344c17df20a05dd2c08a02f098a7e873 | # encoding: utf-8
#
# Copyright (C) 2018 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd 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 your option) any lat... | [((1957, 1971), 'ycmd.tests.clangd.IsolatedYcmd', 'IsolatedYcmd', ([], {}), '()\n', (1969, 1971), False, 'from ycmd.tests.clangd import IsolatedYcmd, SharedYcmd, PathToTestFile, RunAfterInitialized\n'), ((2034, 2093), 'ycmd.tests.clangd.PathToTestFile', 'PathToTestFile', (['"""GoTo_Clang_ZeroBasedLineAndColumn_test.cc"... |
TheRensselaerIDEA/covid19_tweet_ids | sentiment/config.py | fee7d951b11cf2650e48668614c30672179ab3af | """
Config class containing all the settings for running sentiment scoring tool
"""
import jsonpickle
class Config(object):
"""Container for sentiment scoring tool settings.
"""
def __init__(self):
"""Initializes the Config instance.
"""
#Elasticsearch settings
self.elasti... | [((987, 1010), 'jsonpickle.decode', 'jsonpickle.decode', (['json'], {}), '(json)\n', (1004, 1010), False, 'import jsonpickle\n')] |
GuoSuiming/mindspore | tests/ut/python/dataset/test_invert.py | 48afc4cfa53d970c0b20eedfb46e039db2a133d5 | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [((1160, 1196), 'mindspore.log.info', 'logger.info', (['"""Test Invert Python op"""'], {}), "('Test Invert Python op')\n", (1171, 1196), True, 'from mindspore import log as logger\n'), ((1235, 1293), 'mindspore.dataset.ImageFolderDataset', 'ds.ImageFolderDataset', ([], {'dataset_dir': 'DATA_DIR', 'shuffle': '(False)'})... |
aliciawyy/dmining | puzzle/tests/test_candy.py | 513f6f036f8f258281e1282fef052a74bf9cc3d3 | from parameterized import parameterized
from numpy.testing import TestCase
from .. import candy
class TestCollectCandies(TestCase):
@parameterized.expand(
[(5, 5, 12,
[[2, 1, 1, 1, 1], [2, 2, 1, 1, 1], [1, 2, 1, 1, 1],
[2, 2, 1, 1, 3], [2, 2, 2, 2, 2]])]
)
def test_candy(self... | [((140, 266), 'parameterized.parameterized.expand', 'parameterized.expand', (['[(5, 5, 12, [[2, 1, 1, 1, 1], [2, 2, 1, 1, 1], [1, 2, 1, 1, 1], [2, 2, 1, 1,\n 3], [2, 2, 2, 2, 2]])]'], {}), '([(5, 5, 12, [[2, 1, 1, 1, 1], [2, 2, 1, 1, 1], [1, 2, \n 1, 1, 1], [2, 2, 1, 1, 3], [2, 2, 2, 2, 2]])])\n', (160, 266), Fal... |
fernandoq/quiz-show | audio.py | 6e130db7923d14cf1976e1c522c58f848e48f2af | import time
import subprocess
import os
print os.uname()
if not os.uname()[0].startswith("Darw"):
import pygame
pygame.mixer.init()
# Plays a song
def playSong(filename):
print "play song"
if not os.uname()[0].startswith("Darw"):
pygame.mixer.music.fadeout(1000) #fadeout current music over 1 sec.
pygame.m... | [] |
unfoldingWord-dev/python-aws-tools | tests/test_dynamodbHandler.py | 8e856697ab07c5c33e60cde2d82ac805dec3ddf3 | from __future__ import absolute_import, unicode_literals, print_function
import mock
import unittest
import d43_aws_tools as aws_tools
from boto3.dynamodb.conditions import Attr
class DynamoDBHandlerTests(unittest.TestCase):
@classmethod
def setUpClass(cls):
with mock.patch("d43_aws_tools.dynamodb_han... | [((463, 479), 'mock.MagicMock', 'mock.MagicMock', ([], {}), '()\n', (477, 479), False, 'import mock\n'), ((378, 434), 'd43_aws_tools.dynamodb_handler.DynamoDBHandler', 'aws_tools.dynamodb_handler.DynamoDBHandler', (['"""table_name"""'], {}), "('table_name')\n", (420, 434), True, 'import d43_aws_tools as aws_tools\n'), ... |
sbustamante/heroku_app | app.py | 6c8ff0b570750f3fe53ec67e24b71641167d53ce | from dash import Dash, html, dcc
import plotly.express as px
import pandas as pd
app = Dash(__name__)
server = app.server
# assume you have a "long-form" data frame
# see https://plotly.com/python/px-arguments/ for more options
df = pd.DataFrame({
"Fruit": ["Apples", "Oranges", "Bananas", "Apples", "Oranges", "Ba... | [((88, 102), 'dash.Dash', 'Dash', (['__name__'], {}), '(__name__)\n', (92, 102), False, 'from dash import Dash, html, dcc\n'), ((235, 426), 'pandas.DataFrame', 'pd.DataFrame', (["{'Fruit': ['Apples', 'Oranges', 'Bananas', 'Apples', 'Oranges', 'Bananas'],\n 'Amount': [4, 1, 2, 2, 4, 5], 'City': ['SF', 'SF', 'SF', 'Mo... |
aptise/peter_sslers | peter_sslers/web/lib/form_utils.py | 1dcae3fee0c1f4c67ae8a614aed7e2a3121e88b0 | # pypi
import six
# local
from ...lib import db as lib_db
from ...lib import utils
from ...model import objects as model_objects
from ...model import utils as model_utils
from . import formhandling
# ==============================================================================
def decode_args(getcreate_args):
... | [] |
jlamperez/Vitis-Tutorials | AI_Engine_Development/Feature_Tutorials/07-AI-Engine-Floating-Point/Utils/GenerationLib.py | 9a5b611caabb5656bbb2879116e032227b164bfd | #
# Copyright 2020–2021 Xilinx, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | [((4629, 4640), 'numpy.zeros', 'np.zeros', (['(2)'], {}), '(2)\n', (4637, 4640), True, 'import numpy as np\n'), ((2525, 2552), 'random.randint', 'random.randint', (['(-5000)', '(5000)'], {}), '(-5000, 5000)\n', (2539, 2552), False, 'import random\n'), ((2573, 2600), 'random.randint', 'random.randint', (['(-5000)', '(50... |
ashish-ad/Python-Projects | Object Oriented Programming/Lecture 01/Intro.py | 7f49476b6945189165d536629109030f10603556 | item1='phone'
item1_price = 100
item1_quantity = 5
item1_price_total = item1_price * item1_quantity
print(type(item1)) # str
print(type(item1_price)) # int
print(type(item1_quantity)) # int
print(type(item1_price_total)) # int
# output:
# <class 'str'>
# <class 'int'>
# ... | [] |
THU-DA-6D-Pose-Group/self6dpp | configs/deepim/ycbvPbrSO/FlowNet512_1.5AugCosyAAEGray_NoiseRandom_AggressiveR_ClipGrad_fxfy1_Dtw01_LogDz_PM10_Flat_ycbvPbr_SO/FlowNet512_1.5AugCosyAAEGray_NoiseRandom_AggressiveR_ClipGrad_fxfy1_Dtw01_LogDz_PM10_Flat_Pbr_16_36WoodBlock.py | c267cfa55e440e212136a5e9940598720fa21d16 | _base_ = "./FlowNet512_1.5AugCosyAAEGray_NoiseRandom_AggressiveR_ClipGrad_fxfy1_Dtw01_LogDz_PM10_Flat_Pbr_01_02MasterChefCan.py"
OUTPUT_DIR = "output/deepim/ycbvPbrSO/FlowNet512_1.5AugCosyAAEGray_NoiseRandom_AggressiveR_ClipGrad_fxfy1_Dtw01_LogDz_PM10_Flat_ycbvPbr_SO/16_36WoodBlock"
DATASETS = dict(TRAIN=("ycbv_036_woo... | [] |
jhihruei/sqlakeyset | sqlakeyset/__init__.py | 0aa0f6e041dc37bc5f918303578875ad334cad6c |
from .columns import OC
from .paging import get_page, select_page, process_args
from .results import serialize_bookmark, unserialize_bookmark, Page, Paging
__all__ = [
'OC',
'get_page',
'select_page',
'serialize_bookmark',
'unserialize_bookmark',
'Page',
'Paging',
'process_args'
]
| [] |
shaun95/google-research | low_rank_local_connectivity/models/simple_model.py | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [((1396, 1417), 'copy.deepcopy', 'copy.deepcopy', (['config'], {}), '(config)\n', (1409, 1417), False, 'import copy\n'), ((5475, 5497), 'tensorflow.compat.v1.keras.layers.ReLU', 'tf.keras.layers.ReLU', ([], {}), '()\n', (5495, 5497), True, 'import tensorflow.compat.v1 as tf\n'), ((5836, 5939), 'tensorflow.compat.v1.ker... |
jacoblb64/pico_rgb_keypad_hid | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/examples/icm20x_icm20948_gyro_data_rate_test.py | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
import time
import board
import busio
from adafruit_icm20x import ICM20948
cycles = 200
i2c = busio.I2C(board.SCL, board.SDA)
icm = ICM20948(i2c)
# Cycle between two data rates
# Best viewed in the Mu serial plotter where y... | [((190, 221), 'busio.I2C', 'busio.I2C', (['board.SCL', 'board.SDA'], {}), '(board.SCL, board.SDA)\n', (199, 221), False, 'import busio\n'), ((228, 241), 'adafruit_icm20x.ICM20948', 'ICM20948', (['i2c'], {}), '(i2c)\n', (236, 241), False, 'from adafruit_icm20x import ICM20948\n'), ((492, 505), 'time.sleep', 'time.sleep'... |
TheLurkingCat/TIOJ | 1186.py | 077e1cd22239d8f6bc1cd7561f27c68143e80263 | a = int(input())
while a:
for x in range(a-1):
out = '*' + ' ' * (a-x-2) + '*' + ' ' * (a-x-2) + '*'
print(out.center(2*a-1))
print('*' * (2 * a - 1))
for x in range(a-1):
out = '*' + ' ' * x + '*' + ' ' * x + '*'
print(out.center(2*a-1))
a = int(input())
| [] |
initialed85/eds-cctv-system | utils/common.py | fcdb7e7e23327bf3a901d23d506b3915833027d1 | import datetime
import json
import os
from pathlib import Path
from types import SimpleNamespace
from typing import List
from typing import NamedTuple, Union, Optional, Callable
from uuid import uuid3, NAMESPACE_DNS
from dateutil.parser import parse
_VIDEO_SUFFIXES = [".mkv", ".mp4"]
_IMAGE_SUFFIXES = [".jpg"]
_PERMI... | [((1047, 1063), 'dateutil.parser.parse', 'parse', (['timestamp'], {}), '(timestamp)\n', (1052, 1063), False, 'from dateutil.parser import parse\n'), ((6220, 6505), 'json.dumps', 'json.dumps', (["{'event_id': x.event_id, 'timestamp': x.timestamp, 'camera_name': x.\n camera_name, 'high_res_image_path': x.high_res_imag... |
schoolio-co/schoolio_site | schoolio/migrations/0005_auto_20190927_1423.py | a616807c504c7a7cab3b9f7c3dab42f827cb0580 | # Generated by Django 2.2.1 on 2019-09-27 14:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('schoolio', '0004_auto_20190927_0405'),
]
operations = [
migrations.AlterField(
model_name='student_assessment',
name... | [((358, 400), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'blank': '(True)', 'null': '(True)'}), '(blank=True, null=True)\n', (377, 400), False, 'from django.db import migrations, models\n'), ((544, 586), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'blank': '(True)', 'null': '(True)'... |
linerxliner/ValCAT | taattack/_datasets/dataset.py | e62985c6c64f6415bb2bb4716bd02d9686badd47 | class Dataset:
_data = None
_first_text_col = 'text'
_second_text_col = None
_label_col = 'label'
def __init__(self):
self._idx = 0
if self._data is None:
raise Exception('Dataset is not loaded')
def __iter__(self):
return self
def __next__(self):
... | [] |
akhilpandey95/scholarlyimpact | scripts/extract_gs_citations.py | 215ae832c90f0564fa0301e4c3f1c99525617625 | #!/usr/bin/env python3
# This Source Code Form is subject to the terms of the MIT
# License. If a copy of the same was not distributed with this
# file, You can obtain one at
# https://github.com/akhilpandey95/scholarlyimpact/blob/master/LICENSE.
import os
import csv
import glob
import json
import requests
import sub... | [((5053, 5097), 'subprocess.Popen', 'subprocess.Popen', (["['service', 'tor', 'stop']"], {}), "(['service', 'tor', 'stop'])\n", (5069, 5097), False, 'import subprocess\n'), ((5173, 5220), 'subprocess.Popen', 'subprocess.Popen', (["['service', 'tor', 'restart']"], {}), "(['service', 'tor', 'restart'])\n", (5189, 5220), ... |
Jianwei-Wang/python2.7_lib | dist-packages/reportlab/pdfgen/pathobject.py | 911b8e81512e5ac5f13e669ab46f7693ed897378 | #Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/pdfgen/pathobject.py
__version__=''' $Id$ '''
__doc__="""
PDFPathObject is an efficient way to draw paths on a Canvas. Do not
instantiate directly, obt... | [((2432, 2483), 'reportlab.pdfgen.pdfgeom.bezierArc', 'pdfgeom.bezierArc', (['x1', 'y1', 'x2', 'y2', 'startAng', 'extent'], {}), '(x1, y1, x2, y2, startAng, extent)\n', (2449, 2483), False, 'from reportlab.pdfgen import pdfgeom\n'), ((2687, 2738), 'reportlab.pdfgen.pdfgeom.bezierArc', 'pdfgeom.bezierArc', (['x1', 'y1',... |
devagul93/Jarvis-System | client/modules/Wikipedia.py | 8d1865b19bb8530831c868147c3b27a1c3bad59b | import wikipedia
import re
import TCPclient as client
WORDS = ["WIKIPEDIA","SEARCH","INFORMATION"]
def handle(text,mic,profile):
# SEARCH ON WIKIPEDIA
# ny = wikipedia.summary("New York",sentences=3);
# mic.say("%s"% ny)
#mic.say("What you want to search about")
#text = mic.activeListen()
print "entering wik... | [] |
nikhil-amin/python-mini-project | Madlibs/madlibs.py | cd70a6a43408ce74cff501ce4d4658ab82260c2d | import random
print("Title : Eat, Drink, And Be Sick")
noun = []
for i in range(4):
n = input("Enter noun : ")
noun.append(n)
plural = []
for i in range(6):
pn = input("Enter plural noun : ")
plural.append(pn)
adjective = []
for i in range(2):
a = input("Enter adjective : ")
adjective.append(a)
... | [((493, 512), 'random.choice', 'random.choice', (['noun'], {}), '(noun)\n', (506, 512), False, 'import random\n'), ((559, 583), 'random.choice', 'random.choice', (['adjective'], {}), '(adjective)\n', (572, 583), False, 'import random\n'), ((654, 678), 'random.choice', 'random.choice', (['adjective'], {}), '(adjective)\... |
saikrishnarallabandi/python_connectionist | scripts/transpose.py | e3f8f92c8de865190ad727951eb2b0e514248afc | import numpy
g = open('/home/srallaba/mgc/transposed/arctic_a0404.mgc','w')
x = numpy.loadtxt('/home/srallaba/mgc_spaces/arctic_a0404.mgc')
numpy.savetxt(g, numpy.transpose(x))
g.close()
| [((82, 141), 'numpy.loadtxt', 'numpy.loadtxt', (['"""/home/srallaba/mgc_spaces/arctic_a0404.mgc"""'], {}), "('/home/srallaba/mgc_spaces/arctic_a0404.mgc')\n", (95, 141), False, 'import numpy\n'), ((159, 177), 'numpy.transpose', 'numpy.transpose', (['x'], {}), '(x)\n', (174, 177), False, 'import numpy\n')] |
yfaway/zone-apis | tests/zone_api_test/core/zone_manager_test.py | 4aa4120cb4a66812dac1d32e86e825bbafe652b8 | from zone_api.core.zone_manager import ZoneManager
from zone_api import platform_encapsulator as pe
from zone_api.core.zone import Zone
from zone_api.core.zone_event import ZoneEvent
from zone_api.core.devices.dimmer import Dimmer
from zone_api.core.devices.switch import Fan, Light, Switch
from zone_api.core.devices.i... | [((1361, 1406), 'zone_api.core.devices.illuminance_sensor.IlluminanceSensor', 'IlluminanceSensor', (['self.illuminanceSensorItem'], {}), '(self.illuminanceSensorItem)\n', (1378, 1406), False, 'from zone_api.core.devices.illuminance_sensor import IlluminanceSensor\n'), ((1428, 1482), 'zone_api.core.devices.switch.Light'... |
Zasling/meiduo_mall33 | meiduo_mall/meiduo_mall/apps/orders/views.py | ec55597758d5052b311d65aee44533b001f6ddd8 | from rest_framework.response import Response
from rest_framework.views import APIView
from django_redis import get_redis_connection
from goods.models import SKU
from decimal import Decimal
from rest_framework.generics import CreateAPIView,ListAPIView
from rest_framework.mixins import ListModelMixin
from orders.serializ... | [((777, 805), 'django_redis.get_redis_connection', 'get_redis_connection', (['"""cart"""'], {}), "('cart')\n", (797, 805), False, 'from django_redis import get_redis_connection\n'), ((1156, 1190), 'goods.models.SKU.objects.filter', 'SKU.objects.filter', ([], {'id__in': 'sku_ids'}), '(id__in=sku_ids)\n', (1174, 1190), F... |
melmorabity/streamlink | src/streamlink_cli/main.py | 24c59a23103922977991acc28741a323d8efa7a1 | import argparse
import errno
import logging
import os
import platform
import signal
import sys
from collections import OrderedDict
from contextlib import closing
from distutils.version import StrictVersion
from functools import partial
from gettext import gettext
from itertools import chain
from pathlib import Path
fro... | [((1732, 1767), 'logging.getLogger', 'logging.getLogger', (['"""streamlink.cli"""'], {}), "('streamlink.cli')\n", (1749, 1767), False, 'import logging\n'), ((2765, 2785), 'streamlink_cli.output.FileOutput', 'FileOutput', (['filename'], {}), '(filename)\n', (2775, 2785), False, 'from streamlink_cli.output import FileOut... |
Koushik-ks/FlaskAPP | dbaccesslibUserMailInfo.py | 6f1bd98450bc8f33c3896aa7ec690c51dc414d19 | from io import BytesIO
from io import StringIO
import json
from bson.dbref import DBRef
import datetime
from bson import json_util
import logging
import base64
jsonCode ={
"building":{
"Essae Vaishnavi Solitaire": {
"id": "B1",
"division": {
"SS"... | [((7101, 7195), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""server.log"""', 'format': '"""%(asctime)s %(message)s"""', 'filemode': '"""a"""'}), "(filename='server.log', format='%(asctime)s %(message)s',\n filemode='a')\n", (7120, 7195), False, 'import logging\n'), ((7282, 7301), 'logging.getL... |
google/cc4d | src/test/dags/bq_to_cm_dag_test.py | 206543832368f96bac7f55c0de93c96e32127779 | # python3
# coding=utf-8
# Copyright 2020 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | [((3473, 3488), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3486, 3488), False, 'import unittest\n'), ((1901, 1974), 'mock.patch.object', 'mock.patch.object', (['cloud_auth', '"""build_impersonated_client"""'], {'autospec': '(True)'}), "(cloud_auth, 'build_impersonated_client', autospec=True)\n", (1918, 1974),... |
burgwyn/State-TalentMAP-API | talentmap_api/common/management/commands/load_xml.py | 1f4f3659c5743ebfd558cd87af381f5460f284b3 | from django.core.management.base import BaseCommand
import logging
import re
from talentmap_api.common.xml_helpers import XMLloader, strip_extra_spaces, parse_boolean, parse_date, get_nested_tag
from talentmap_api.language.models import Language, Proficiency
from talentmap_api.position.models import Grade, Skill, Pos... | [((544, 571), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (561, 571), False, 'import logging\n'), ((2223, 2299), 'talentmap_api.common.xml_helpers.XMLloader', 'XMLloader', (['model', 'instance_tag', 'tag_map', 'collision_behavior', 'collision_field'], {}), '(model, instance_tag, tag_ma... |
oscarfonts/web2py | gluon/tests/test_recfile.py | a18e0e489fe7a770c62fca510a4299886b0a9bb7 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Unit tests for gluon.recfile
"""
import unittest
import os
import shutil
import uuid
from .fix_path import fix_sys_path
fix_sys_path(__file__)
from gluon import recfile
class TestRecfile(unittest.TestCase):
def setUp(self):
os.mkdir('tests')
d... | [((2565, 2580), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2578, 2580), False, 'import unittest\n'), ((296, 313), 'os.mkdir', 'os.mkdir', (['"""tests"""'], {}), "('tests')\n", (304, 313), False, 'import os\n'), ((347, 369), 'shutil.rmtree', 'shutil.rmtree', (['"""tests"""'], {}), "('tests')\n", (360, 369), Fa... |
cfrome77/liquid-stats | configLambdas.py | 7a4d751dea215c94b650beb154a90abce7e1592d | import json
import os
import subprocess
from dotenv import load_dotenv
from subprocess import check_output, Popen, PIPE
load_dotenv()
# Accessing variables.
CLIENT_ID = os.environ.get('CLIENT_ID')
CLIENT_SECRET = os.environ.get('CLIENT_SECRET')
USERNAME = os.environ.get('USERNAME')
BUCKET_NAME = os.environ.get('BUCK... | [((122, 135), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (133, 135), False, 'from dotenv import load_dotenv\n'), ((172, 199), 'os.environ.get', 'os.environ.get', (['"""CLIENT_ID"""'], {}), "('CLIENT_ID')\n", (186, 199), False, 'import os\n'), ((216, 247), 'os.environ.get', 'os.environ.get', (['"""CLIENT_SEC... |
SaitoYutaka/microbitAnim | microbitAnim.py | 6630d5cdb3ae867d3467a035a1c14358944c0367 | # -*- coding: utf-8 -*-
###########################################################################
## Python code generated with wxFormBuilder (version Aug 8 2018)
## http://www.wxformbuilder.org/
##
## PLEASE DO *NOT* EDIT THIS FILE!
###########################################################################
impo... | [((859, 880), 'wx.GridBagSizer', 'wx.GridBagSizer', (['(0)', '(0)'], {}), '(0, 0)\n', (874, 880), False, 'import wx\n'), ((8427, 8440), 'wx.MenuBar', 'wx.MenuBar', (['(0)'], {}), '(0)\n', (8437, 8440), False, 'import wx\n'), ((8466, 8475), 'wx.Menu', 'wx.Menu', ([], {}), '()\n', (8473, 8475), False, 'import wx\n'), ((8... |
nicoddemus/dependencies | src/dependencies/contrib/celery.py | 74180e2c6098d8ad03bc53c5703bdf8dc61c3ed9 | """
dependencies.contrib.celery
---------------------------
This module implements injectable Celery task.
:copyright: (c) 2016-2020 by dry-python team.
:license: BSD, see LICENSE for more details.
"""
from _dependencies.contrib.celery import shared_task
from _dependencies.contrib.celery import task
__all__ = ["sha... | [] |
gaxu/keras-yolo3 | yolo3/utils.py | 7f6be0fb9a8583401246bfe65d2df2ee40777d72 | """Miscellaneous utility functions."""
from functools import reduce
from PIL import Image
import numpy as np
from matplotlib.colors import rgb_to_hsv, hsv_to_rgb
def compose(*funcs):
"""Compose arbitrarily many functions, evaluated left to right.
Reference: https://mathieularose.com/function-composition-in-... | [((847, 886), 'PIL.Image.new', 'Image.new', (['"""RGB"""', 'size', '(128, 128, 128)'], {}), "('RGB', size, (128, 128, 128))\n", (856, 886), False, 'from PIL import Image\n'), ((1257, 1276), 'PIL.Image.open', 'Image.open', (['line[0]'], {}), '(line[0])\n', (1267, 1276), False, 'from PIL import Image\n'), ((2591, 2632), ... |
MardanovTimur/kaggle | text_classification/config.py | 62392863a07fcc5de9821c28cf9c6dbbf39ced59 | import logging
import pathlib
logging.basicConfig(level=logging.INFO)
# Dirs
ROOT_DIR = pathlib.Path(__file__).parent.absolute()
DUMP_DIR = ROOT_DIR / 'dumps'
| [((31, 70), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (50, 70), False, 'import logging\n'), ((90, 112), 'pathlib.Path', 'pathlib.Path', (['__file__'], {}), '(__file__)\n', (102, 112), False, 'import pathlib\n')] |
JosephDErwin/sportsreference | sportsreference/ncaaf/rankings.py | f026366bec91fdf4bebef48e3a4bfd7c5bfab4bd | import re
from pyquery import PyQuery as pq
from .. import utils
from .constants import RANKINGS_SCHEME, RANKINGS_URL
from six.moves.urllib.error import HTTPError
class Rankings:
"""
Get all Associated Press (AP) rankings on a week-by-week basis.
Grab a list of the rankings published by the Associated Pr... | [((2268, 2299), 're.sub', 're.sub', (['"""/.*"""', '""""""', 'abbreviation'], {}), "('/.*', '', abbreviation)\n", (2274, 2299), False, 'import re\n'), ((1235, 1258), 'pyquery.PyQuery', 'pq', (['(RANKINGS_URL % year)'], {}), '(RANKINGS_URL % year)\n', (1237, 1258), True, 'from pyquery import PyQuery as pq\n')] |
davide97l/DI-engine | ding/hpc_rl/wrapper.py | d48c93bcd5c07c29f2ce4ac1b7756b8bc255c423 | import importlib
from ditk import logging
from collections import OrderedDict
from functools import wraps
import ding
'''
Overview:
`hpc_wrapper` is the wrapper for functions which are supported by hpc. If a function is wrapped by it, we will
search for its hpc type and return the function implemented by hpc.
... | [((3513, 3547), 'importlib.import_module', 'importlib.import_module', (['fn_str[0]'], {}), '(fn_str[0])\n', (3536, 3547), False, 'import importlib\n'), ((3650, 3663), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (3661, 3663), False, 'from collections import OrderedDict\n'), ((3987, 3996), 'functools.wrap... |
JLJTECH/TutorialTesting | CodeWars/2016/NumberOfOccurrences-7k.py | f2dbbd49a86b3b086d0fc156ac3369fb74727f86 | #Return the count of int(s) in passed array.
def number_of_occurrences(s, xs):
return xs.count(s) | [] |
islam-200555/Telethon | telethon_generator/parsers/tlobject.py | 85103bcf6de8024c902ede98f0b9bf0f7f47a0aa | import re
from zlib import crc32
from ..utils import snake_to_camel_case
CORE_TYPES = (
0xbc799737, # boolFalse#bc799737 = Bool;
0x997275b5, # boolTrue#997275b5 = Bool;
0x3fedd339, # true#3fedd339 = True;
0x1cb5c415, # vector#1cb5c415 {t:Type} # [ t ] = Vector t;
)
# https://github.com/telegramde... | [((8192, 8307), 're.match', 're.match', (['"""^([\\\\w.]+)(?:#([0-9a-fA-F]+))?(?:\\\\s{?\\\\w+:[\\\\w\\\\d<>#.?!]+}?)*\\\\s=\\\\s([\\\\w\\\\d<>#.?]+);$"""', 'line'], {}), "(\n '^([\\\\w.]+)(?:#([0-9a-fA-F]+))?(?:\\\\s{?\\\\w+:[\\\\w\\\\d<>#.?!]+}?)*\\\\s=\\\\s([\\\\w\\\\d<>#.?]+);$'\n , line)\n", (8200, 8307), Fa... |
purkhusid/rules_dotnet | dotnet/private/actions/resx_core.bzl | 934e62d65ed3657be20b2ae3a63e032a2de9ff84 | "Actions for compiling resx files"
load(
"@io_bazel_rules_dotnet//dotnet/private:providers.bzl",
"DotnetResourceInfo",
)
def _make_runner_arglist(dotnet, source, output, resgen):
args = dotnet.actions.args()
if type(source) == "Target":
args.add_all(source.files)
else:
args.add(so... | [] |
xiaohanhuang/pytorch | test/jit/test_modules.py | a31aea8eaa99a5ff72b5d002c206cd68d5467a5e | # Owner(s): ["oncall: jit"]
import torch
import os
import sys
from torch.testing._internal.jit_utils import JitTestCase
# Make the helper files in test/ importable
pytorch_test_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(pytorch_test_dir)
if __name__ == '__main__':
raise Ru... | [((246, 279), 'sys.path.append', 'sys.path.append', (['pytorch_test_dir'], {}), '(pytorch_test_dir)\n', (261, 279), False, 'import sys\n'), ((217, 243), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (233, 243), False, 'import os\n'), ((1017, 1031), 'torch.randn', 'torch.randn', (['(5)'], {... |
Swayamshu/Pixelate_Sample_Arena | pixelate_task_1.py | d8e8b4614987f9302a19ec1e20a922618e67b943 | import gym
import pix_sample_arena
import time
import pybullet as p
import pybullet_data
import cv2
if __name__ == "__main__":
env = gym.make("pix_sample_arena-v0")
x = 0
while True:
p.stepSimulation()
time.sleep(100) | [((138, 169), 'gym.make', 'gym.make', (['"""pix_sample_arena-v0"""'], {}), "('pix_sample_arena-v0')\n", (146, 169), False, 'import gym\n'), ((227, 242), 'time.sleep', 'time.sleep', (['(100)'], {}), '(100)\n', (237, 242), False, 'import time\n'), ((204, 222), 'pybullet.stepSimulation', 'p.stepSimulation', ([], {}), '()\... |
vgoehler/python-i3-battery-block | tests/test_timeparser.py | e47ce80b315d812d731df84f2a1c8e1155b2469a | from datetime import time
import pytest
from i3_battery_block_vgg.timeparser import __parse_time_manually
from i3_battery_block_vgg.timeparser import parse_time
@pytest.mark.parametrize(
"time_input, expected",
[
("12:13", time(hour=12, minute=13)),
("12:13:14", time(hour=12, minute=13, seco... | [((469, 502), 'i3_battery_block_vgg.timeparser.__parse_time_manually', '__parse_time_manually', (['time_input'], {}), '(time_input)\n', (490, 502), False, 'from i3_battery_block_vgg.timeparser import __parse_time_manually\n'), ((850, 872), 'i3_battery_block_vgg.timeparser.parse_time', 'parse_time', (['time_input'], {})... |
fyquah/circt | frontends/PyCDE/test/polynomial.py | cee685bf12dbf27a3f2274e08cd1af6874f70baa | # RUN: %PYTHON% %s 2>&1 | FileCheck %s
from __future__ import annotations
import mlir
import pycde
from pycde import (Input, Output, Parameter, module, externmodule, generator,
types, dim)
from circt.dialects import comb, hw
@module
def PolynomialCompute(coefficients: Coefficients):
class Pol... | [((1548, 1579), 'pycde.externmodule', 'externmodule', (['"""supercooldevice"""'], {}), "('supercooldevice')\n", (1560, 1579), False, 'from pycde import Input, Output, Parameter, module, externmodule, generator, types, dim\n'), ((1615, 1631), 'pycde.Input', 'Input', (['types.i32'], {}), '(types.i32)\n', (1620, 1631), Fa... |
davidgcameron/arc | python/examples/service_discovery.py | 9813ef5f45e5089507953239de8fa2248f5ad32c | #! /usr/bin/env python
import arc
import sys
import os
def retrieve(uc, endpoints):
# The ComputingServiceRetriever needs the UserConfig to know which credentials
# to use in case of HTTPS connections
retriever = arc.ComputingServiceRetriever(uc, endpoints)
# the constructor of the ComputingServiceRetr... | [((226, 270), 'arc.ComputingServiceRetriever', 'arc.ComputingServiceRetriever', (['uc', 'endpoints'], {}), '(uc, endpoints)\n', (255, 270), False, 'import arc\n'), ((350, 372), 'sys.stdout.write', 'sys.stdout.write', (['"""\n"""'], {}), "('\\n')\n", (366, 372), False, 'import sys\n'), ((377, 467), 'sys.stdout.write', '... |
netajik/oppia | core/domain/rights_manager.py | d3780352d615db7438e010c5aa5eb60588bb7de6 | # coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | [((1001, 1047), 'core.platform.models.Registry.import_current_user_services', 'models.Registry.import_current_user_services', ([], {}), '()\n', (1045, 1047), False, 'from core.platform import models\n'), ((1083, 1170), 'core.platform.models.Registry.import_models', 'models.Registry.import_models', (['[models.NAMES.coll... |
GDGSNF/setuptools | pkg_resources/_vendor/packaging/_typing.py | 3a209029fd2217c039593cd1f6cb378a28527a59 | """For neatly implementing static typing in packaging.
`mypy` - the static type analysis tool we use - uses the `typing` module, which
provides core functionality fundamental to mypy's functioning.
Generally, `typing` would be imported at runtime and used in that fashion -
it acts as a no-op at runtime and does not h... | [] |
aolin480/openpilot | selfdrive/car/toyota/carcontroller.py | 9ac00c3e5e111a05a0bb10018ccd190571dfff4d | from cereal import car
from common.numpy_fast import clip, interp
from selfdrive.car import apply_toyota_steer_torque_limits, create_gas_interceptor_command, make_can_msg
from selfdrive.car.toyota.toyotacan import create_steer_command, create_ui_command, \
create_accel_command... | [((1057, 1076), 'opendbc.can.packer.CANPacker', 'CANPacker', (['dbc_name'], {}), '(dbc_name)\n', (1066, 1076), False, 'from opendbc.can.packer import CANPacker\n'), ((2264, 2352), 'common.numpy_fast.clip', 'clip', (['actuators.accel', 'CarControllerParams.ACCEL_MIN', 'CarControllerParams.ACCEL_MAX'], {}), '(actuators.a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.