code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from django.contrib import admin
from .models import SearchResult
# Register your models here.
class SearchResultAdmin(admin.ModelAdmin):
fields = ["query", "heading", "url", "text"]
admin.site.register(SearchResult, SearchResultAdmin) | [
"django.contrib.admin.site.register"
] | [((189, 241), 'django.contrib.admin.site.register', 'admin.site.register', (['SearchResult', 'SearchResultAdmin'], {}), '(SearchResult, SearchResultAdmin)\n', (208, 241), False, 'from django.contrib import admin\n')] |
import asyncio
import os
import tempfile
from contextlib import ExitStack
from typing import Text, Optional, List, Union, Dict
from rasa.importers.importer import TrainingDataImporter
from rasa import model
from rasa.model import FingerprintComparisonResult
from rasa.core.domain import Domain
from rasa.utils.common im... | [
"rasa.model.FingerprintComparisonResult",
"rasa_addons.importers.BotfrontFileImporter",
"rasa.model.update_model_with_new_domain",
"rasa.model.should_retrain",
"asyncio.new_event_loop",
"rasa.cli.utils.print_color",
"rasa.cli.utils.print_warning",
"rasa.importers.importer.TrainingDataImporter.load_nlu... | [((3729, 3952), 'rasa.cli.utils.print_warning', 'print_warning', (['"""Core training was skipped because no valid domain file was found. Only an nlu-model was created.Please specify a valid domain using \'--domain\' argument or check if the provided domain file exists."""'], {}), '(\n "Core training was skipped beca... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author:
''' PNASNet in PyTorch.
Paper: Progressive Neural Architecture Search
'''
from easyai.base_name.block_name import NormalizationType, ActivationType
from easyai.base_name.backbone_name import BackboneName
from easyai.model.backbone.utility.base_backbone import *
fr... | [
"easyai.model.base_block.utility.utility_block.ConvBNActivationBlock"
] | [((1225, 1425), 'easyai.model.base_block.utility.utility_block.ConvBNActivationBlock', 'ConvBNActivationBlock', ([], {'in_channels': 'self.data_channel', 'out_channels': 'self.first_output', 'kernel_size': '(3)', 'stride': '(1)', 'padding': '(1)', 'bias': '(False)', 'bnName': 'self.bn_name', 'activationName': 'self.act... |
# -*- coding: utf-8 -*-
# coding=utf-8
import json
import os
import math
import logging
import requests
import time
from map_download.cmd.BaseDownloader import DownloadEngine, BaseDownloaderThread, latlng2tile_terrain, BoundBox
def get_access_token(token):
resp = None
request_count = 0
url = "https://ap... | [
"logging.getLogger",
"os.path.exists",
"logging.StreamHandler",
"math.ceil",
"os.makedirs",
"map_download.cmd.BaseDownloader.latlng2tile_terrain",
"math.floor",
"logging.Formatter",
"map_download.cmd.BaseDownloader.BoundBox",
"os.path.join",
"requests.get",
"time.sleep",
"os.path.dirname",
... | [((1646, 1671), 'os.path.exists', 'os.path.exists', (['file_path'], {}), '(file_path)\n', (1660, 1671), False, 'import os\n'), ((3201, 3251), 'map_download.cmd.BaseDownloader.latlng2tile_terrain', 'latlng2tile_terrain', (['bbox.min_lat', 'bbox.min_lng', 'z'], {}), '(bbox.min_lat, bbox.min_lng, z)\n', (3220, 3251), Fals... |
"""Forms for RTD donations"""
import logging
from django import forms
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from readthedocs.payments.forms import StripeModelForm, StripeResourceMixin
from readthedocs.payments.utils import stripe
from .models import Supporter
log ... | [
"logging.getLogger",
"django.forms.HiddenInput",
"django.utils.translation.ugettext_lazy",
"django.forms.CharField",
"django.forms.TextInput"
] | [((322, 349), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (339, 349), False, 'import logging\n'), ((2007, 2037), 'django.forms.CharField', 'forms.CharField', ([], {'required': '(True)'}), '(required=True)\n', (2022, 2037), False, 'from django import forms\n'), ((2050, 2080), 'django.fo... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from .base import DataReaderBase
from ..tools import COL, _get_dates, to_float, to_int
import pandas as pd
#from pandas.tseries.frequencies import to_offset
from six.moves import cStringIO as StringIO
import logging
import traceback
import datetime
import json
import tok... | [
"json.loads",
"tokenize.untokenize",
"six.moves.cStringIO",
"doctest.testmod",
"datetime.date",
"pandas.DataFrame",
"pandas.concat",
"pandas.to_datetime"
] | [((588, 625), 'datetime.date', 'datetime.date', ([], {'year': 'y', 'month': 'm', 'day': 'd'}), '(year=y, month=m, day=d)\n', (601, 625), False, 'import datetime\n'), ((2146, 2173), 'tokenize.untokenize', 'tokenize.untokenize', (['result'], {}), '(result)\n', (2165, 2173), False, 'import token, tokenize\n'), ((6240, 625... |
from django.db.models import Q
from django.shortcuts import render
from django.http import Http404
# Create your views here.
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.decorators import api_view
from .models import Product, Category
from .serializers imp... | [
"rest_framework.response.Response",
"rest_framework.decorators.api_view",
"django.db.models.Q"
] | [((1481, 1499), 'rest_framework.decorators.api_view', 'api_view', (["['POST']"], {}), "(['POST'])\n", (1489, 1499), False, 'from rest_framework.decorators import api_view\n'), ((559, 584), 'rest_framework.response.Response', 'Response', (['serializer.data'], {}), '(serializer.data)\n', (567, 584), False, 'from rest_fra... |
##########################################################################
#
# Copyright (c) 2010-2012, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redis... | [
"IECore.SearchPath",
"IECore.Parameterised",
"IECore.CapturingMessageHandler",
"IECore.BoolVectorData",
"os.path.join",
"shutil.rmtree",
"os.path.isfile",
"os.path.dirname",
"os.path.isdir",
"IECore.ClassVectorParameter",
"IECore.FloatParameter",
"IECore.StringVectorData",
"unittest.main",
... | [((11326, 11341), 'unittest.main', 'unittest.main', ([], {}), '()\n', (11339, 11341), False, 'import unittest\n'), ((1977, 2019), 'IECore.Parameterised', 'IECore.Parameterised', (['"""testParameterised1"""'], {}), "('testParameterised1')\n", (1997, 2019), False, 'import IECore\n'), ((2174, 2216), 'IECore.Parameterised'... |
from zeit.cms.i18n import MessageFactory as _
import zope.interface
import zope.schema
class IGlobalSettings(zope.interface.Interface):
"""Global CMS settings."""
default_year = zope.schema.Int(
title=_("Default year"),
min=1900,
max=2100)
default_volume = zope.schema.Int(
... | [
"zeit.cms.i18n.MessageFactory"
] | [((220, 237), 'zeit.cms.i18n.MessageFactory', '_', (['"""Default year"""'], {}), "('Default year')\n", (221, 237), True, 'from zeit.cms.i18n import MessageFactory as _\n'), ((328, 347), 'zeit.cms.i18n.MessageFactory', '_', (['"""Default volume"""'], {}), "('Default volume')\n", (329, 347), True, 'from zeit.cms.i18n imp... |
import imtreat
img = imtreat.imageManagerClass.openImageFunction("../images/soleil.png", 0)
img = imtreat.definedModesClass.detailEnhanceFunction(img)
imtreat.imageManagerClass.saveImageFunction("/Téléchargements/", "image_1", ".png", img)
| [
"imtreat.imageManagerClass.saveImageFunction",
"imtreat.imageManagerClass.openImageFunction",
"imtreat.definedModesClass.detailEnhanceFunction"
] | [((22, 92), 'imtreat.imageManagerClass.openImageFunction', 'imtreat.imageManagerClass.openImageFunction', (['"""../images/soleil.png"""', '(0)'], {}), "('../images/soleil.png', 0)\n", (65, 92), False, 'import imtreat\n'), ((100, 152), 'imtreat.definedModesClass.detailEnhanceFunction', 'imtreat.definedModesClass.detailE... |
import requests
words_list = requests.get("https://raw.githubusercontent.com/atebits/Words/master/Words/fr.txt").text
words_list = filter(lambda x: len(x) > 4, words_list.split('\n'))
path = input("Chemin d'écriture ? (words.txt) ")
if path == "":
path = "./words.txt"
with open(path, "w", encoding="utf-8") as ... | [
"requests.get"
] | [((30, 118), 'requests.get', 'requests.get', (['"""https://raw.githubusercontent.com/atebits/Words/master/Words/fr.txt"""'], {}), "(\n 'https://raw.githubusercontent.com/atebits/Words/master/Words/fr.txt')\n", (42, 118), False, 'import requests\n')] |
import unittest
from unittest import mock
import os
import subprocess
from testfixtures import TempDirectory
from simplegallery.upload.uploader_factory import get_uploader
class AWSUploaderTestCase(unittest.TestCase):
def test_no_location(self):
uploader = get_uploader('aws')
self.assertFalse(upl... | [
"testfixtures.TempDirectory",
"subprocess.CompletedProcess",
"os.path.join",
"unittest.main",
"unittest.mock.patch",
"simplegallery.upload.uploader_factory.get_uploader"
] | [((352, 380), 'unittest.mock.patch', 'mock.patch', (['"""subprocess.run"""'], {}), "('subprocess.run')\n", (362, 380), False, 'from unittest import mock\n'), ((1607, 1622), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1620, 1622), False, 'import unittest\n'), ((272, 291), 'simplegallery.upload.uploader_factory.... |
# Copyright The PyTorch Lightning team.
#
# 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 i... | [
"logging.getLogger",
"re.sub",
"os.environ.get"
] | [((720, 747), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (737, 747), False, 'import logging\n'), ((1246, 1278), 'os.environ.get', 'os.environ.get', (['"""SLURM_NODELIST"""'], {}), "('SLURM_NODELIST')\n", (1260, 1278), False, 'import os\n'), ((1848, 1878), 'os.environ.get', 'os.environ... |
#
# Copyright (c) 2021 The GPflux Contributors.
#
# 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 agr... | [
"numpy.testing.assert_equal",
"tensorflow_probability.distributions.MultivariateNormalDiag",
"tensorflow_probability.distributions.MultivariateNormalTriL",
"numpy.testing.assert_allclose",
"numpy.concatenate",
"numpy.testing.assert_array_equal",
"numpy.eye",
"numpy.allclose",
"gpflux.encoders.Direct... | [((897, 935), 'tensorflow.keras.backend.set_floatx', 'tf.keras.backend.set_floatx', (['"""float64"""'], {}), "('float64')\n", (924, 935), True, 'import tensorflow as tf\n'), ((2330, 2370), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""w_dim"""', '[1, 5]'], {}), "('w_dim', [1, 5])\n", (2353, 2370), False, ... |
from floodsystem.stationdata import build_station_list
from floodsystem.flood import stations_highest_rel_level
def run():
stations = build_station_list()
warning_stations = stations_highest_rel_level(stations,10)
for entry in warning_stations:
print(entry[0].name,entry[1])
if __name__ == "__mai... | [
"floodsystem.stationdata.build_station_list",
"floodsystem.flood.stations_highest_rel_level"
] | [((139, 159), 'floodsystem.stationdata.build_station_list', 'build_station_list', ([], {}), '()\n', (157, 159), False, 'from floodsystem.stationdata import build_station_list\n'), ((183, 223), 'floodsystem.flood.stations_highest_rel_level', 'stations_highest_rel_level', (['stations', '(10)'], {}), '(stations, 10)\n', (... |
import logging
import time
from datetime import timedelta
from typing import List
from homeassistant.components.binary_sensor import (
BinarySensorEntity,
DEVICE_CLASS_MOTION
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_ATTRIBUTION
from homeassistant.core import H... | [
"logging.getLogger",
"datetime.timedelta",
"time.time"
] | [((500, 527), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (517, 527), False, 'import logging\n'), ((582, 603), 'datetime.timedelta', 'timedelta', ([], {'seconds': '(10)'}), '(seconds=10)\n', (591, 603), False, 'from datetime import timedelta\n'), ((1476, 1487), 'time.time', 'time.time'... |
"""
This script will modulate the blinky lights using the following algorithm:
1) uses user-provided location to obtain row of pixel data from bathy image
2) samples a 'number of LEDs' number of pixels from that row
3) shifts the sampled row data to center it at the location specified by user
4) displays resulting pix... | [
"PIL.Image.open",
"numpy.roll",
"numpy.asarray",
"optparse.OptionParser",
"time.sleep",
"numpy.take",
"blinkytape.BlinkyTape",
"sys.exit",
"json.load"
] | [((1945, 1968), 'optparse.OptionParser', 'optparse.OptionParser', ([], {}), '()\n', (1966, 1968), False, 'import optparse\n'), ((3304, 3328), 'blinkytape.BlinkyTape', 'BlinkyTape', (['port', 'n_leds'], {}), '(port, n_leds)\n', (3314, 3328), False, 'from blinkytape import BlinkyTape\n'), ((3366, 3374), 'time.sleep', 'sl... |
# pylint: disable=protected-access
import os
import re
import pytest
from dagster import file_relative_path
from dagster.core.errors import DagsterInstanceMigrationRequired
from dagster.core.instance import DagsterInstance, InstanceRef
from dagster.utils.test import restore_directory
# test that we can load runs an... | [
"dagster.file_relative_path",
"dagster.core.instance.InstanceRef.from_dir",
"dagster.utils.test.restore_directory",
"re.escape"
] | [((383, 429), 'dagster.file_relative_path', 'file_relative_path', (['__file__', '"""snapshot_0_6_4"""'], {}), "(__file__, 'snapshot_0_6_4')\n", (401, 429), False, 'from dagster import file_relative_path\n'), ((1092, 1145), 'dagster.file_relative_path', 'file_relative_path', (['__file__', '"""snapshot_0_6_6/sqlite"""'],... |
import matplotlib.pyplot as plt
import pandas as pd
def group_by_category(df):
grouped = df.groupby(['CATEGORY']).size().to_frame('Crimes')
labels = ['Trespassing', 'Vehicle theft', 'General Theft',
'Damage to Property', 'Robbery', 'Homicide']
p = grouped.plot.pie(y='Crimes', labels=labels, ... | [
"matplotlib.pyplot.savefig",
"pandas.read_csv"
] | [((428, 465), 'matplotlib.pyplot.savefig', 'plt.savefig', (['"""../charts/category.png"""'], {}), "('../charts/category.png')\n", (439, 465), True, 'import matplotlib.pyplot as plt\n'), ((749, 789), 'matplotlib.pyplot.savefig', 'plt.savefig', (['"""../charts/time_of_day.png"""'], {}), "('../charts/time_of_day.png')\n",... |
# Unit tests
import unittest
def run_test_instance(unittestinstance, profile, committeesize, tests):
import rules_approval
# all rules used?
for rule in rules_approval.MWRULES:
unittestinstance.assertTrue(rule in tests.keys())
for rule in tests.keys():
output = rules_approval.comp... | [
"rules_approval.compute_rule",
"score_functions.monroescore_matching",
"preferences.Profile",
"rules_approval.compute_monroe",
"rules_approval.MWRULES.keys",
"preferences.DichotomousPreferences",
"score_functions.monroescore_flowbased",
"unittest.main"
] | [((15333, 15348), 'unittest.main', 'unittest.main', ([], {}), '()\n', (15346, 15348), False, 'import unittest\n'), ((301, 374), 'rules_approval.compute_rule', 'rules_approval.compute_rule', (['rule', 'profile', 'committeesize'], {'resolute': '(False)'}), '(rule, profile, committeesize, resolute=False)\n', (328, 374), F... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016, 2017 Red Hat, Inc.
# Red Hat Author: <NAME> <<EMAIL>>
#
# 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 ... | [
"logging.getLogger",
"os.path.exists",
"os.makedirs",
"threading.Lock",
"json.dumps",
"os.path.join",
"webbrowser.open",
"requests.request",
"uuid.uuid4",
"os.path.isdir",
"urllib.parse.urlencode",
"copy.copy",
"time.time",
"os.path.expanduser",
"wsgiref.simple_server.make_server"
] | [((4037, 4064), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (4054, 4064), False, 'import logging\n'), ((4451, 4495), 'os.path.expanduser', 'os.path.expanduser', (["(cachedir or '~/.openidc')"], {}), "(cachedir or '~/.openidc')\n", (4469, 4495), False, 'import os\n'), ((4773, 4779), 'th... |
import datetime
import uuid
import simplejson as json
from src.db.s3_client import Client as S3Client
from decimal import Decimal
def get_from_archive(archive_key):
''' Download a VP Save from S3.
:param str archive_key: The vp_save data's location (S3 bucket and file path). This value is required.
'''
if ... | [
"simplejson.dumps",
"datetime.datetime.now",
"uuid.uuid4",
"src.db.s3_client.Client"
] | [((448, 458), 'src.db.s3_client.Client', 'S3Client', ([], {}), '()\n', (456, 458), True, 'from src.db.s3_client import Client as S3Client\n'), ((2070, 2080), 'src.db.s3_client.Client', 'S3Client', ([], {}), '()\n', (2078, 2080), True, 'from src.db.s3_client import Client as S3Client\n'), ((945, 957), 'uuid.uuid4', 'uui... |
"""
Basic usage
===========
This example presents the basic usage of brokenaxes
"""
import matplotlib.pyplot as plt
from brokenaxes import brokenaxes
import numpy as np
fig = plt.figure(figsize=(5,2))
bax = brokenaxes(xlims=((0, .1), (.4, .7)), ylims=((-1, .7), (.79, 1)), hspace=.05)
x = np.linspace(0, 1, 100)
bax... | [
"matplotlib.pyplot.figure",
"brokenaxes.brokenaxes",
"numpy.linspace",
"numpy.cos",
"numpy.sin"
] | [((180, 206), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(5, 2)'}), '(figsize=(5, 2))\n', (190, 206), True, 'import matplotlib.pyplot as plt\n'), ((212, 299), 'brokenaxes.brokenaxes', 'brokenaxes', ([], {'xlims': '((0, 0.1), (0.4, 0.7))', 'ylims': '((-1, 0.7), (0.79, 1))', 'hspace': '(0.05)'}), '(xlims... |
import shutil
import os
import json
import glob
import yaml
import sys
import urllib
import ssl
import csv
import time
import requests
import json
import csv
from rdflib import URIRef, BNode, Literal, Graph
from rdflib.namespace import RDF, RDFS, FOAF, XSD
from rdflib import Namespace
all = Graph()
with open("data/... | [
"os.path.exists",
"rdflib.Literal",
"rdflib.Graph",
"json.load",
"rdflib.URIRef"
] | [((295, 302), 'rdflib.Graph', 'Graph', ([], {}), '()\n', (300, 302), False, 'from rdflib import URIRef, BNode, Literal, Graph\n'), ((351, 363), 'json.load', 'json.load', (['f'], {}), '(f)\n', (360, 363), False, 'import json\n'), ((435, 447), 'json.load', 'json.load', (['f'], {}), '(f)\n', (444, 447), False, 'import jso... |
import unittest
try:
from unittest.mock import *
except ImportError:
from mock import *
from msgpack import *
import bootloader_read_config
from commands import *
import sys
import json
class ReadConfigToolTestCase(unittest.TestCase):
@patch('utils.write_command_retry')
@patch('utils.write_command'... | [
"bootloader_read_config.main",
"json.dumps"
] | [((769, 798), 'bootloader_read_config.main', 'bootloader_read_config.main', ([], {}), '()\n', (796, 798), False, 'import bootloader_read_config\n'), ((1902, 1931), 'bootloader_read_config.main', 'bootloader_read_config.main', ([], {}), '()\n', (1929, 1931), False, 'import bootloader_read_config\n'), ((1038, 1087), 'jso... |
import logging
from asyncio import sleep
import discord
from discord.ext import commands
from config import SETTINGS
from crew import crew_embed
from diary import diary_embed
from film import film_embed
from helpers import LetterboxdError
from list_ import list_embed
from review import review_embed
from user import us... | [
"logging.basicConfig",
"discord.ext.commands.Bot",
"user.user_embed",
"discord.ext.commands.bot_has_permissions",
"film.film_embed",
"discord.ext.commands.check",
"crew.crew_embed",
"discord.Color.from_rgb",
"asyncio.sleep",
"diary.diary_embed",
"logging.error"
] | [((330, 435), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(asctime)s | %(message)s"""', 'datefmt': '"""%m/%d %H:%M:%S"""'}), "(level=logging.INFO, format='%(asctime)s | %(message)s',\n datefmt='%m/%d %H:%M:%S')\n", (349, 435), False, 'import logging\n'), ((452, 507), '... |
localhost = "http://localhost/" # your local host
database = "mysql://root@localhost/vaticChecker" # server://user:pass@localhost/dbname
min_training = 2 # the minimum number of training videos to be considered
recaptcha_secret = "" # recaptcha secret for verification
duplicate_annotations = False #... | [
"os.path.abspath"
] | [((431, 456), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (446, 456), False, 'import os\n')] |
"""Timezone helper functions.
This module uses pytz when it's available and fallbacks when it isn't.
"""
from datetime import datetime, timedelta, tzinfo
from threading import local
import time as _time
try:
import pytz
except ImportError:
pytz = None
from django.conf import settings
__all__ = [
'utc',... | [
"datetime.tzinfo.__init__",
"time.localtime",
"pytz.timezone",
"threading.local",
"datetime.datetime.utcnow",
"time.mktime",
"datetime.datetime.now",
"datetime.timedelta"
] | [((506, 518), 'datetime.timedelta', 'timedelta', (['(0)'], {}), '(0)\n', (515, 518), False, 'from datetime import datetime, timedelta, tzinfo\n'), ((3077, 3084), 'threading.local', 'local', ([], {}), '()\n', (3082, 3084), False, 'from threading import local\n'), ((1259, 1293), 'datetime.timedelta', 'timedelta', ([], {'... |
#!/usr/bin/env python3
import kfp.dsl as dsl
import kfp.gcp as gcp
# Pipeline input variables.
KUBECTL_IMAGE = "gcr.io/mcas-195423/trackml_master_kfp_kubectl"
KUBECTL_IMAGE_VERSION = "1"
TRACKML_IMAGE = "gcr.io/mcas-195423/trackml_master_trackml"
TRACKML_IMAGE_VERSION = "1"
def train_op():
return dsl.ContainerOp(
... | [
"kfp.gcp.use_gcp_secret",
"kfp.dsl.pipeline",
"kfp.compiler.Compiler"
] | [((1025, 1114), 'kfp.dsl.pipeline', 'dsl.pipeline', ([], {'name': '"""trackml"""', 'description': '"""A pipeline that predicts particle tracks"""'}), "(name='trackml', description=\n 'A pipeline that predicts particle tracks')\n", (1037, 1114), True, 'import kfp.dsl as dsl\n'), ((464, 484), 'kfp.gcp.use_gcp_secret',... |
# coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# 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 a... | [
"logging.getLogger",
"os.path.join"
] | [((902, 929), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (919, 929), False, 'import logging\n'), ((9721, 9760), 'os.path.join', 'os.path.join', (['save_directory', '"""encoder"""'], {}), "(save_directory, 'encoder')\n", (9733, 9760), False, 'import os\n'), ((9800, 9839), 'os.path.join... |
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.operators.python_operator import PythonOperator, BranchPythonOperator
from datetime import datetime, timedelta
import pandas as pd
import random
# Default args definition
default_args = {
'owner': 'Rafael',
'depends_o... | [
"datetime.datetime",
"random.choice",
"airflow.operators.python_operator.PythonOperator",
"pandas.read_csv",
"airflow.operators.bash_operator.BashOperator",
"airflow.DAG",
"datetime.timedelta",
"airflow.operators.python_operator.BranchPythonOperator"
] | [((567, 738), 'airflow.DAG', 'DAG', (['"""treino-03"""'], {'description': '"""Extrai dados do Titanic e calcula idade media para homens ou mulheres"""', 'default_args': 'default_args', 'schedule_interval': '"""*/20 * * * *"""'}), "('treino-03', description=\n 'Extrai dados do Titanic e calcula idade media para homen... |
# This is a reusable webcraawler architecture that can be adapted to scrape any webstie.
# RESULTS:
# Roughly 24 seconds per thousand courses scraped for ThreadPoolExecutor vs 63s for unthreaded script.
# This is a very basic implementation of multithreading in order to show the proof of concept, but is a good base to... | [
"csv.DictWriter",
"concurrent.futures.ThreadPoolExecutor",
"mitopencourseware_crawler_worker.mit_crawler",
"requests.get",
"bs4.BeautifulSoup",
"concurrent.futures.as_completed",
"time.time"
] | [((1782, 1799), 'mitopencourseware_crawler_worker.mit_crawler', 'mit_crawler', (['link'], {}), '(link)\n', (1793, 1799), False, 'from mitopencourseware_crawler_worker import mit_crawler\n'), ((885, 902), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (897, 902), False, 'import requests\n'), ((956, 996), 'bs4... |
from typing import List, Optional, NewType, Tuple, NamedTuple, Type
import attr
from jinja2 import Template as JinjaTemplate, StrictUndefined
from genyrator.entities.Entity import Entity
from genyrator.path import create_relative_path
OutPath = NewType('OutPath', Tuple[List[str], str])
Import = NamedTuple('Import',
... | [
"genyrator.path.create_relative_path",
"typing.NamedTuple",
"typing.NewType",
"attr.ib"
] | [((247, 288), 'typing.NewType', 'NewType', (['"""OutPath"""', 'Tuple[List[str], str]'], {}), "('OutPath', Tuple[List[str], str])\n", (254, 288), False, 'from typing import List, Optional, NewType, Tuple, NamedTuple, Type\n'), ((298, 366), 'typing.NamedTuple', 'NamedTuple', (['"""Import"""', "[('module_name', str), ('im... |
# uncompyle6 version 3.3.5
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)]
# Embedded file name: c:\Jenkins\live\output\win_64_static\Release\python-bundle\MIDI Remote Scripts\Push2\mode_collector.py
# Compiled at: 2018-11-30 15:48:11
from __fut... | [
"ableton.v2.base.listens"
] | [((1193, 1218), 'ableton.v2.base.listens', 'listens', (["b'selected_mode'"], {}), "(b'selected_mode')\n", (1200, 1218), False, 'from ableton.v2.base import listenable_property, listens, EventObject\n'), ((1404, 1429), 'ableton.v2.base.listens', 'listens', (["b'selected_mode'"], {}), "(b'selected_mode')\n", (1411, 1429)... |
from pytest import raises
from discopy.cartesian import *
def test_Box_repr():
f = Box('f', 1, 2, lambda x: (x, x))
assert "Box('f', 1, 2" in repr(f)
def test_Function_str():
f = Function(2, 1, lambda x, y: x + y)
assert 'Function(dom=2, cod=1,' in str(f)
def test_Function_call():
f = Swap(2, ... | [
"pytest.raises"
] | [((352, 369), 'pytest.raises', 'raises', (['TypeError'], {}), '(TypeError)\n', (358, 369), False, 'from pytest import raises\n'), ((737, 754), 'pytest.raises', 'raises', (['TypeError'], {}), '(TypeError)\n', (743, 754), False, 'from pytest import raises\n'), ((870, 888), 'pytest.raises', 'raises', (['AxiomError'], {}),... |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | [
"qiskit_metal.draw.union",
"math.cos",
"qiskit_metal.Dict",
"numpy.array",
"qiskit_metal.draw.rectangle",
"qiskit_metal.draw.translate",
"qiskit_metal.draw.rotate",
"math.sin"
] | [((4010, 4566), 'qiskit_metal.Dict', 'Dict', ([], {'pad_width': '"""1000um"""', 'pad_height': '"""300um"""', 'finger_width': '"""50um"""', 'finger_height': '"""100um"""', 'finger_space': '"""50um"""', 'pad_pos_x': '"""0um"""', 'pad_pos_y': '"""0um"""', 'comb_width': '"""50um"""', 'comb_space_vert': '"""50um"""', 'comb_... |
# Copyright 2019-present NAVER Corp.
# Apache License v2.0
# <NAME>
import os, json
from copy import deepcopy
from matplotlib.pylab import *
import torch
import torch.nn as nn
import torch.nn.functional as F
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
from sqlova.utils.utils import topk_... | [
"torch.mul",
"torch.log",
"torch.nn.Tanh",
"torch.nn.Softmax",
"torch.nn.LSTM",
"torch.stack",
"torch.nn.functional.binary_cross_entropy",
"torch.sigmoid",
"torch.nn.functional.sigmoid",
"torch.tensor",
"torch.cuda.is_available",
"torch.nn.Linear",
"torch.nn.functional.cross_entropy",
"tor... | [((40296, 40311), 'torch.nn.functional.sigmoid', 'F.sigmoid', (['s_wc'], {}), '(s_wc)\n', (40305, 40311), True, 'import torch.nn.functional as F\n'), ((40323, 40352), 'torch.nn.functional.binary_cross_entropy', 'F.binary_cross_entropy', (['p', 'im'], {}), '(p, im)\n', (40345, 40352), True, 'import torch.nn.functional a... |
import inspect
import numpy as np
from pandas._libs import reduction as libreduction
from pandas.util._decorators import cache_readonly
from pandas.core.dtypes.common import (
is_dict_like,
is_extension_array_dtype,
is_list_like,
is_sequence,
)
from pandas.core.dtypes.generic import ABCSeries
def f... | [
"pandas.core.dtypes.common.is_list_like",
"pandas._libs.reduction.compute_reduction",
"pandas.Series",
"pandas.core.dtypes.common.is_sequence",
"numpy.asarray",
"inspect.getfullargspec",
"numpy.errstate",
"numpy.apply_along_axis",
"numpy.empty_like",
"pandas.core.dtypes.common.is_dict_like"
] | [((5381, 5409), 'numpy.empty_like', 'np.empty_like', (['target.values'], {}), '(target.values)\n', (5394, 5409), True, 'import numpy as np\n'), ((2193, 2213), 'pandas.core.dtypes.common.is_list_like', 'is_list_like', (['self.f'], {}), '(self.f)\n', (2205, 2213), False, 'from pandas.core.dtypes.common import is_dict_lik... |
import os.path
from collections import Counter
import pytest
INPUT_TXT = os.path.join(os.path.dirname(__file__), 'input.txt')
def compute(s: str) -> int:
lines = s.splitlines()
numbers = Counter(int(f) for f in lines[0].split(","))
for d in range(80):
numbers2 = Counter({8: numbers[0], 6: numbe... | [
"collections.Counter",
"pytest.mark.parametrize"
] | [((535, 607), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (["('input_s', 'expected')", '((INPUT_S, EXPECTED),)'], {}), "(('input_s', 'expected'), ((INPUT_S, EXPECTED),))\n", (558, 607), False, 'import pytest\n'), ((288, 331), 'collections.Counter', 'Counter', (['{(8): numbers[0], (6): numbers[0]}'], {}), '({(... |
from pathlib import Path
root = Path(__file__).parent.absolute()
import envo
envo.add_source_roots([root])
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple
from envo import Env, Namespace, env_var, logger, run
from env_comm import StickybeakCommEnv as ParentEnv
p = Namespace("p")
cl... | [
"envo.Namespace",
"pathlib.Path",
"envo.run",
"envo.add_source_roots",
"envo.env_var"
] | [((80, 109), 'envo.add_source_roots', 'envo.add_source_roots', (['[root]'], {}), '([root])\n', (101, 109), False, 'import envo\n'), ((301, 315), 'envo.Namespace', 'Namespace', (['"""p"""'], {}), "('p')\n", (310, 315), False, 'from envo import Env, Namespace, env_var, logger, run\n'), ((542, 559), 'envo.env_var', 'env_v... |
import os
import sys
import shutil
cwd_path = os.getcwd()
sys.path.append(os.path.join(os.path.dirname(cwd_path), 'rt-thread', 'tools'))
# BSP dist function
def dist_do_building(BSP_ROOT, dist_dir):
from mkdist import bsp_copy_files
import rtconfig
library_dir = os.path.join(dist_dir, 'libraries')
p... | [
"mkdist.bsp_copy_files",
"os.path.dirname",
"os.path.join",
"os.getcwd"
] | [((46, 57), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (55, 57), False, 'import os\n'), ((278, 313), 'os.path.join', 'os.path.join', (['dist_dir', '"""libraries"""'], {}), "(dist_dir, 'libraries')\n", (290, 313), False, 'import os\n'), ((433, 474), 'mkdist.bsp_copy_files', 'bsp_copy_files', (['library_path', 'library_... |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""This module contains utilities for using multi-methods in
spack. You can think of multi-methods like overloaded methods... | [
"spack.spec.Spec",
"llnl.util.lang.caller_locals",
"functools.wraps",
"functools.partial",
"inspect.getmro",
"functools.update_wrapper"
] | [((3566, 3605), 'functools.update_wrapper', 'functools.update_wrapper', (['self', 'default'], {}), '(self, default)\n', (3590, 3605), False, 'import functools\n'), ((3816, 3854), 'functools.update_wrapper', 'functools.update_wrapper', (['self', 'method'], {}), '(self, method)\n', (3840, 3854), False, 'import functools\... |
"""
Create diaries in A5 and A4 sizes based on PDF templates.
<NAME>
"""
import datetime
import math
import sys
from io import BytesIO
from pathlib import Path
from PyPDF2 import PdfFileReader, PdfFileWriter
from reportlab.lib.pagesizes import A5, A4
from reportlab.lib.utils import ImageReader
from reportlab.pdfbase ... | [
"pathlib.Path.exists",
"pathlib.Path",
"datetime.datetime.strptime",
"reportlab.pdfbase.ttfonts.TTFont",
"io.BytesIO",
"pathlib.Path.mkdir",
"reportlab.pdfgen.canvas.Canvas",
"PyPDF2.PdfFileWriter",
"datetime.timedelta",
"PyPDF2.PdfFileReader",
"reportlab.lib.utils.ImageReader"
] | [((3588, 3644), 'pathlib.Path.mkdir', 'Path.mkdir', (['a5_booklets_dir'], {'parents': '(True)', 'exist_ok': '(True)'}), '(a5_booklets_dir, parents=True, exist_ok=True)\n', (3598, 3644), False, 'from pathlib import Path\n'), ((4056, 4071), 'PyPDF2.PdfFileWriter', 'PdfFileWriter', ([], {}), '()\n', (4069, 4071), False, '... |
# Copyright (c) 2017-2018 {Flair Inc.} <NAME>
#
# 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... | [
"taf.foundation.utils.ConnectionCache"
] | [((862, 889), 'taf.foundation.utils.ConnectionCache', 'ConnectionCache', (['identifier'], {}), '(identifier)\n', (877, 889), False, 'from taf.foundation.utils import ConnectionCache\n')] |
"""
Contexts are the "values" that Python would return. However Contexts are at the
same time also the "contexts" that a user is currently sitting in.
A ContextSet is typically used to specify the return of a function or any other
static analysis operation. In jedi there are always multiple returns and not
just one.
"... | [
"jedi._compatibility.zip_longest",
"jedi.evaluate.analysis.add",
"jedi.evaluate.names.ContextName",
"jedi.debug.dbg",
"jedi.evaluate.compiled.CompiledContextName",
"jedi.evaluate.cache.evaluator_as_method_param_cache",
"jedi.evaluate.finder.NameFinder",
"jedi.evaluate.lazy_context.get_merged_lazy_cont... | [((1093, 1126), 'jedi.evaluate.cache.evaluator_as_method_param_cache', 'evaluator_as_method_param_cache', ([], {}), '()\n', (1124, 1126), False, 'from jedi.evaluate.cache import evaluator_as_method_param_cache\n'), ((8011, 8044), 'jedi.evaluate.cache.evaluator_as_method_param_cache', 'evaluator_as_method_param_cache', ... |
from itertools import groupby
class Solution:
def countAndSay(self, n):
def gen(s):
return "".join(str(len(list(g))) + k for k, g in groupby(s))
s, i = "1", 1
while i < n:
s = gen(s)
i += 1
return s
| [
"itertools.groupby"
] | [((159, 169), 'itertools.groupby', 'groupby', (['s'], {}), '(s)\n', (166, 169), False, 'from itertools import groupby\n')] |
"""Test for .prep.read module
"""
from hidrokit.prep import read
import numpy as np
import pandas as pd
A = pd.DataFrame(
data=[
[1, 3, 4, np.nan, 2, np.nan],
[np.nan, 2, 3, np.nan, 1, 4],
[2, np.nan, 1, 3, 4, np.nan]
],
columns=['A', 'B', 'C', 'D', 'E', 'F']
)
A_date = A.set_inde... | [
"pandas.DataFrame",
"hidrokit.prep.read.missing_row",
"pandas.date_range"
] | [((110, 264), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': '[[1, 3, 4, np.nan, 2, np.nan], [np.nan, 2, 3, np.nan, 1, 4], [2, np.nan, 1,\n 3, 4, np.nan]]', 'columns': "['A', 'B', 'C', 'D', 'E', 'F']"}), "(data=[[1, 3, 4, np.nan, 2, np.nan], [np.nan, 2, 3, np.nan, 1, \n 4], [2, np.nan, 1, 3, 4, np.nan]], colum... |
from flasgger import swag_from
from app.blueprints.base_blueprint import Blueprint, BaseBlueprint, request, Security, Auth
from app.controllers.department_controller import DepartmentController
url_prefix = '{}/departments'.format(BaseBlueprint.base_url_prefix)
department_blueprint = Blueprint('department', __name__,... | [
"flasgger.swag_from",
"app.controllers.department_controller.DepartmentController",
"app.blueprints.base_blueprint.Auth.has_role",
"app.blueprints.base_blueprint.Security.validator",
"app.blueprints.base_blueprint.Blueprint",
"app.blueprints.base_blueprint.Auth.has_permission"
] | [((287, 343), 'app.blueprints.base_blueprint.Blueprint', 'Blueprint', (['"""department"""', '__name__'], {'url_prefix': 'url_prefix'}), "('department', __name__, url_prefix=url_prefix)\n", (296, 343), False, 'from app.blueprints.base_blueprint import Blueprint, BaseBlueprint, request, Security, Auth\n'), ((368, 397), '... |
import json
import aiohttp
async def request(url, payload=None, params=None, headers=None):
headers = {'content-type': 'application/json', **(headers or {})}
data = payload and json.dumps(payload)
async with aiohttp.ClientSession() as client:
async with client.post(
url, data=data... | [
"aiohttp.ClientSession",
"json.dumps"
] | [((188, 207), 'json.dumps', 'json.dumps', (['payload'], {}), '(payload)\n', (198, 207), False, 'import json\n'), ((223, 246), 'aiohttp.ClientSession', 'aiohttp.ClientSession', ([], {}), '()\n', (244, 246), False, 'import aiohttp\n')] |
"""Unit tests for nautobot_device_onboarding.netdev_keeper module and its classes.
(c) 2020-2021 Network To Code
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/LICE... | [
"nautobot.dcim.models.Site.objects.create",
"nautobot.dcim.models.Platform.objects.create",
"nautobot_device_onboarding.models.OnboardingTask.objects.create",
"nautobot_device_onboarding.helpers.onboarding_task_fqdn_to_ip",
"unittest.mock.patch",
"nautobot.dcim.models.DeviceRole.objects.create",
"socket... | [((2037, 2106), 'unittest.mock.patch', 'mock.patch', (['"""nautobot_device_onboarding.helpers.socket.gethostbyname"""'], {}), "('nautobot_device_onboarding.helpers.socket.gethostbyname')\n", (2047, 2106), False, 'from unittest import mock\n'), ((2495, 2564), 'unittest.mock.patch', 'mock.patch', (['"""nautobot_device_on... |
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Test for the piezo tensor class
"""
__author__ = "<NAME>"
__version__ = "0.1"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Development"
__date__ = "4/1/16"
import os
import unittest
import numpy as np
... | [
"pymatgen.analysis.piezo.PiezoTensor.from_vasp_voigt",
"pymatgen.analysis.piezo.PiezoTensor",
"numpy.array",
"numpy.zeros",
"pymatgen.analysis.piezo.PiezoTensor.from_voigt",
"unittest.main"
] | [((2195, 2210), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2208, 2210), False, 'import unittest\n'), ((554, 684), 'numpy.array', 'np.array', (['[[0.0, 0.0, 0.0, 0.0, 0.03839, 0.0], [0.0, 0.0, 0.0, 0.03839, 0.0, 0.0], [\n 6.89822, 6.89822, 27.4628, 0.0, 0.0, 0.0]]'], {}), '([[0.0, 0.0, 0.0, 0.0, 0.03839, 0.... |
from direct.showbase import DirectObject
from otp.otpbase import OTPGlobals
import sys
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from otp.otpbase import OTPLocalizer
class ChatInputNormal(DirectObject.DirectObject):
ExecNamespace = None
def __init__(self, chatMgr):
self.chat... | [
"sys.exc_info"
] | [((4495, 4509), 'sys.exc_info', 'sys.exc_info', ([], {}), '()\n', (4507, 4509), False, 'import sys\n'), ((4537, 4551), 'sys.exc_info', 'sys.exc_info', ([], {}), '()\n', (4549, 4551), False, 'import sys\n'), ((4254, 4268), 'sys.exc_info', 'sys.exc_info', ([], {}), '()\n', (4266, 4268), False, 'import sys\n'), ((4300, 43... |
import argparse
import json
import numpy as np
import pandas as pd
import os
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report,f1_score
from keras.models import Sequential
from keras.layers import Dense, Dropout
fro... | [
"pandas.read_csv",
"sklearn.metrics.classification_report",
"keras.utils.vis_utils.plot_model",
"numpy.column_stack",
"keras.layers.Dense",
"numpy.mean",
"argparse.ArgumentParser",
"keras.backend.clip",
"numpy.asarray",
"numpy.concatenate",
"keras.backend.epsilon",
"json.loads",
"sklearn.mod... | [((2973, 2997), 'pandas.read_csv', 'pd.read_csv', (['dataset_csv'], {}), '(dataset_csv)\n', (2984, 2997), True, 'import pandas as pd\n'), ((4112, 4136), 'numpy.asarray', 'np.asarray', (['sentence_emb'], {}), '(sentence_emb)\n', (4122, 4136), True, 'import numpy as np\n'), ((4182, 4203), 'numpy.asarray', 'np.asarray', (... |
'''
-------------------------------------------------------------------------------------------------
This code accompanies the paper titled "Human injury-based safety decision of automated vehicles"
Author: <NAME>, <NAME>, <NAME>, <NAME>
Corresponding author: <NAME> (<EMAIL>)
------------------------------------------... | [
"numpy.abs",
"numpy.sqrt",
"numpy.cos",
"numpy.sin",
"numpy.arctan"
] | [((723, 742), 'numpy.cos', 'np.cos', (['delta_angle'], {}), '(delta_angle)\n', (729, 742), True, 'import numpy as np\n'), ((1050, 1084), 'numpy.arctan', 'np.arctan', (['(veh_cgf[0] / veh_cgs[0])'], {}), '(veh_cgf[0] / veh_cgs[0])\n', (1059, 1084), True, 'import numpy as np\n'), ((1106, 1142), 'numpy.abs', 'np.abs', (['... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
---------------------------------------------... | [
"datamanage.pro.exceptions.GetDataSetCreateInfoError",
"datamanage.utils.api.MetaApi.complex_search",
"datamanage.pro.utils.time.utc_to_local",
"copy.deepcopy"
] | [((2222, 2361), 'datamanage.utils.api.MetaApi.complex_search', 'MetaApi.complex_search', (["{'backend_type': ComplexSearchBackendType.DGRAPH.value, 'statement':\n data_set_create_info_statement}"], {'raw': '(True)'}), "({'backend_type': ComplexSearchBackendType.DGRAPH.\n value, 'statement': data_set_create_info_s... |
#!/usr/bin/env python
# runs after the job (and after the default post-filter)
from galaxy.tools.parameters import DataToolParameter
# Older py compatibility
try:
set()
except:
from sets import Set as set
def validate_input( trans, error_map, param_values, page_param_map ):
dbkeys = set()
data_param_... | [
"sets.Set"
] | [((168, 173), 'sets.Set', 'set', ([], {}), '()\n', (171, 173), True, 'from sets import Set as set\n'), ((299, 304), 'sets.Set', 'set', ([], {}), '()\n', (302, 304), True, 'from sets import Set as set\n'), ((328, 333), 'sets.Set', 'set', ([], {}), '()\n', (331, 333), True, 'from sets import Set as set\n')] |
# -*- coding: utf-8 -*-
'''
Salt module to manage unix mounts and the fstab file
'''
from __future__ import absolute_import
# Import python libs
import os
import re
import logging
# Import salt libs
import salt.utils
from salt._compat import string_types
from salt.utils import which as _which
from salt.exceptions imp... | [
"logging.getLogger",
"os.path.exists",
"os.access",
"os.path.isfile",
"salt.exceptions.CommandNotFoundError",
"salt.utils.which",
"re.sub",
"re.findall"
] | [((391, 418), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (408, 418), False, 'import logging\n'), ((22597, 22608), 'salt.utils.which', '_which', (['cmd'], {}), '(cmd)\n', (22603, 22608), True, 'from salt.utils import which as _which\n'), ((1123, 1151), 'os.access', 'os.access', (['file... |
from django.contrib import admin
from base.models import Topic, Photo
class EONBaseAdmin(admin.ModelAdmin):
def get_changeform_initial_data(self, request):
initial = super().get_changeform_initial_data(request)
if 'add' in request.META['PATH_INFO']:
initial['created_by'] = request.... | [
"django.contrib.admin.site.register"
] | [((829, 867), 'django.contrib.admin.site.register', 'admin.site.register', (['Topic', 'TopicAdmin'], {}), '(Topic, TopicAdmin)\n', (848, 867), False, 'from django.contrib import admin\n'), ((868, 906), 'django.contrib.admin.site.register', 'admin.site.register', (['Photo', 'PhotoAdmin'], {}), '(Photo, PhotoAdmin)\n', (... |
import traceback
from pprint import pformat
from threading import Thread
import itchat
import logging
from wxpy.chat import Chat
from wxpy.chats import Chats
from wxpy.friend import Friend
from wxpy.group import Group
from wxpy.message import MessageConfigs, Messages, Message, MessageConfig
from wxpy.mp import MP
fro... | [
"logging.getLogger",
"traceback.format_exc",
"wxpy.utils.tools.handle_response",
"wxpy.chat.Chat",
"itchat.Core",
"wxpy.message.MessageConfigs",
"wxpy.message.MessageConfig",
"pprint.pformat",
"wxpy.utils.tools.wrap_user_name",
"itchat.instanceList.append",
"wxpy.message.Messages",
"threading.... | [((523, 548), 'logging.getLogger', 'logging.getLogger', (['"""wxpy"""'], {}), "('wxpy')\n", (540, 548), False, 'import logging\n'), ((1995, 2012), 'wxpy.utils.tools.handle_response', 'handle_response', ([], {}), '()\n', (2010, 2012), False, 'from wxpy.utils.tools import handle_response, get_user_name, wrap_user_name, e... |
from algovision import app
if(__name__=="__main__"):
app.run(debug=True,host='0.0.0.0')
| [
"algovision.app.run"
] | [((58, 93), 'algovision.app.run', 'app.run', ([], {'debug': '(True)', 'host': '"""0.0.0.0"""'}), "(debug=True, host='0.0.0.0')\n", (65, 93), False, 'from algovision import app\n')] |
"""Test the search module"""
from collections.abc import Iterable, Sized
from io import StringIO
from itertools import chain, product
from functools import partial
import pickle
import sys
from types import GeneratorType
import re
import numpy as np
import scipy.sparse as sp
import pytest
from sklearn.utils.fixes im... | [
"sklearn.utils._testing.assert_warns_message",
"sklearn.model_selection.GridSearchCV",
"sklearn.model_selection.StratifiedShuffleSplit",
"sklearn.utils._testing.assert_raises",
"sklearn.tree.DecisionTreeRegressor",
"pickle.dumps",
"sklearn.utils._testing.assert_array_equal",
"sklearn.neighbors.KNeighb... | [((4079, 4125), 'numpy.array', 'np.array', (['[[-1, -1], [-2, -1], [1, 1], [2, 1]]'], {}), '([[-1, -1], [-2, -1], [1, 1], [2, 1]])\n', (4087, 4125), True, 'import numpy as np\n'), ((4130, 4152), 'numpy.array', 'np.array', (['[1, 1, 2, 2]'], {}), '([1, 1, 2, 2])\n', (4138, 4152), True, 'import numpy as np\n'), ((4385, 4... |
# -*- encoding:utf-8 -*-
# @Time : 2021/1/3 15:15
# @Author : gfjiang
import os.path as osp
import mmcv
import numpy as np
import cvtools
import matplotlib.pyplot as plt
import cv2.cv2 as cv
from functools import partial
import torch
import math
from cvtools.utils.path import add_prefix_filename_suffix
from mmdet.... | [
"math.sqrt",
"cvtools.imwrite",
"mmdet.ops.nms",
"matplotlib.pyplot.imshow",
"os.path.exists",
"cvtools.utils.path.add_prefix_filename_suffix",
"cvtools.draw_boxes_texts",
"numpy.where",
"mmdet.apis.init_detector",
"numpy.max",
"matplotlib.pyplot.close",
"numpy.vstack",
"numpy.concatenate",
... | [((643, 671), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(32, 32)'}), '(figsize=(32, 32))\n', (653, 671), True, 'import matplotlib.pyplot as plt\n'), ((1399, 1410), 'matplotlib.pyplot.close', 'plt.close', ([], {}), '()\n', (1408, 1410), True, 'import matplotlib.pyplot as plt\n'), ((1815, 1837), 'os.pat... |
# -*- coding: utf-8 -*-
"""
tradingAPI.low_level
~~~~~~~~~~~~~~
This module provides the low level functions with the service.
"""
import time
import re
from datetime import datetime
from pyvirtualdisplay import Display
from bs4 import BeautifulSoup
from splinter import Browser
from .glob import Glob
from .links imp... | [
"logging.getLogger",
"tradingAPI.exceptions.WindowException",
"tradingAPI.exceptions.MarketClosed",
"splinter.Browser",
"tradingAPI.exceptions.ProductNotFound",
"tradingAPI.exceptions.VBroException",
"time.sleep",
"tradingAPI.exceptions.BrowserException",
"bs4.BeautifulSoup",
"datetime.datetime.no... | [((485, 526), 'logging.getLogger', 'logging.getLogger', (['"""tradingAPI.low_level"""'], {}), "('tradingAPI.low_level')\n", (502, 526), False, 'import logging\n'), ((1879, 1888), 'pyvirtualdisplay.Display', 'Display', ([], {}), '()\n', (1886, 1888), False, 'from pyvirtualdisplay import Display\n'), ((2083, 2106), 'spli... |
import math
import torch
import torch.nn as nn
from models.neural import MultiHeadedAttention, PositionwiseFeedForward
from models.rnn import LayerNormLSTM
class Classifier(nn.Module):
def __init__(self, hidden_size):
super(Classifier, self).__init__()
self.linear1 = nn.Linear(hidden_size, 1)
... | [
"torch.nn.Sigmoid",
"torch.nn.ReLU",
"torch.nn.Dropout",
"torch.nn.Softmax",
"torch.nn.LeakyReLU",
"models.neural.MultiHeadedAttention",
"torch.nn.LayerNorm",
"math.sqrt",
"models.neural.PositionwiseFeedForward",
"torch.transpose",
"math.log",
"models.rnn.LayerNormLSTM",
"torch.nn.Linear",
... | [((292, 317), 'torch.nn.Linear', 'nn.Linear', (['hidden_size', '(1)'], {}), '(hidden_size, 1)\n', (301, 317), True, 'import torch.nn as nn\n'), ((341, 353), 'torch.nn.Sigmoid', 'nn.Sigmoid', ([], {}), '()\n', (351, 353), True, 'import torch.nn as nn\n'), ((620, 645), 'torch.zeros', 'torch.zeros', (['max_len', 'dim'], {... |
import requests
from allauth.socialaccount.providers.oauth2.views import (
OAuth2Adapter,
OAuth2CallbackView,
OAuth2LoginView,
)
from .provider import DropboxOAuth2Provider
class DropboxOAuth2Adapter(OAuth2Adapter):
provider_id = DropboxOAuth2Provider.id
access_token_url = "https://api.dropbox.c... | [
"allauth.socialaccount.providers.oauth2.views.OAuth2CallbackView.adapter_view",
"requests.post",
"allauth.socialaccount.providers.oauth2.views.OAuth2LoginView.adapter_view"
] | [((852, 902), 'allauth.socialaccount.providers.oauth2.views.OAuth2LoginView.adapter_view', 'OAuth2LoginView.adapter_view', (['DropboxOAuth2Adapter'], {}), '(DropboxOAuth2Adapter)\n', (880, 902), False, 'from allauth.socialaccount.providers.oauth2.views import OAuth2Adapter, OAuth2CallbackView, OAuth2LoginView\n'), ((92... |
# SPDX-License-Identifier: MIT
# pylint: disable=redefined-builtin,invalid-name
"""See https://www.sphinx-doc.org/en/master/usage/configuration.html"""
from typing import Sequence
import os
import sys
# region Path setup
sys.path.insert(0, os.path.abspath('..'))
# endregion
# region Project information
project = 'Upk... | [
"os.path.abspath"
] | [((241, 262), 'os.path.abspath', 'os.path.abspath', (['""".."""'], {}), "('..')\n", (256, 262), False, 'import os\n')] |
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
import unittest
from aenum import Enum, auto
from dace import registry
@registry.make_registry
class ExtensibleClass(object):
pass
class Extension(ExtensibleClass):
pass
@registry.extensible_enum
class ExtensibleEnumeration(Enum):... | [
"unittest.main",
"dace.registry.autoregister_params",
"aenum.auto"
] | [((329, 335), 'aenum.auto', 'auto', ([], {}), '()\n', (333, 335), False, 'from aenum import Enum, auto\n'), ((344, 350), 'aenum.auto', 'auto', ([], {}), '()\n', (348, 350), False, 'from aenum import Enum, auto\n'), ((2136, 2151), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2149, 2151), False, 'import unittest\... |
import asyncio
import logging
from json import loads
import pytest
from aiologstash2 import create_tcp_handler
logging.getLogger().setLevel(logging.DEBUG)
class FakeTcpServer:
def __init__(self):
self.data = bytearray()
self.server = None
self.futs = set()
async def start(self):
... | [
"logging.getLogger",
"json.loads",
"aiologstash2.create_tcp_handler",
"asyncio.start_server",
"asyncio.get_event_loop"
] | [((115, 134), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (132, 134), False, 'import logging\n'), ((2246, 2283), 'logging.getLogger', 'logging.getLogger', (['"""aiologstash_test"""'], {}), "('aiologstash_test')\n", (2263, 2283), False, 'import logging\n'), ((347, 402), 'asyncio.start_server', 'asyncio.s... |
"""TcEx Framework Playbook module"""
# standard library
import base64
import json
import re
from collections import OrderedDict
from collections.abc import Iterable
class PlaybooksBase:
"""TcEx Playbook Module Base Class
Args:
tcex (TcEx): Instance of TcEx class.
context (str): The Redis cont... | [
"json.loads",
"re.compile",
"base64.b64encode",
"json.dumps",
"base64.b64decode",
"re.finditer",
"re.sub",
"re.search"
] | [((827, 868), 're.compile', 're.compile', (['f"""^{self._variable_pattern}$"""'], {}), "(f'^{self._variable_pattern}$')\n", (837, 868), False, 'import re\n'), ((955, 989), 're.compile', 're.compile', (['self._variable_pattern'], {}), '(self._variable_pattern)\n', (965, 989), False, 'import re\n'), ((1117, 1177), 're.co... |
# coding=utf-8
# Copyright (c) 2019 NVIDIA CORPORATION. All rights reserved.
# Copyright 2018 The Google AI Language Team 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... | [
"utils.utils.setup_xla_flags",
"horovod.tensorflow.init",
"tensorflow.reduce_sum",
"tensorflow.estimator.EstimatorSpec",
"tensorflow.truncated_normal_initializer",
"tensorflow.metrics.mean",
"tensorflow.python.compiler.tensorrt.trt_convert.TrtGraphConverter",
"tensorflow.io.FixedLenFeature",
"tensor... | [((6344, 6560), 'modeling.BertModel', 'modeling.BertModel', ([], {'config': 'bert_config', 'is_training': 'is_training', 'input_ids': 'input_ids', 'input_mask': 'input_mask', 'token_type_ids': 'segment_ids', 'use_one_hot_embeddings': 'use_one_hot_embeddings', 'compute_type': 'tf.float32'}), '(config=bert_config, is_tra... |
# 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 writing, software
# d... | [
"subject.tests.utils.execute"
] | [((1086, 1117), 'subject.tests.utils.execute', 'execute', (['cmd'], {'raise_error': '(False)'}), '(cmd, raise_error=False)\n', (1093, 1117), False, 'from subject.tests.utils import execute\n')] |
from devito import VectorTimeFunction, TimeFunction, NODE
from devito.tools import memoized_meth
from examples.seismic import PointSource
from examples.seismic.viscoacoustic.operators import (ForwardOperator, AdjointOperator)
class ViscoacousticWaveSolver(object):
"""
Solver object that provides operators for... | [
"examples.seismic.PointSource",
"examples.seismic.viscoacoustic.operators.ForwardOperator",
"devito.TimeFunction",
"devito.VectorTimeFunction",
"examples.seismic.viscoacoustic.operators.AdjointOperator"
] | [((1869, 2035), 'examples.seismic.viscoacoustic.operators.ForwardOperator', 'ForwardOperator', (['self.model'], {'save': 'save', 'geometry': 'self.geometry', 'space_order': 'self.space_order', 'kernel': 'self.kernel', 'time_order': 'self.time_order'}), '(self.model, save=save, geometry=self.geometry, space_order=\n ... |
import pandas as pd
import os
from tqdm import tqdm
from collections import defaultdict
from mlxtend.preprocessing import TransactionEncoder
from mlxtend.frequent_patterns import apriori
dataPath = "data/static"
itemSetList = []
def loadDataSet():
with open(os.path.join(dataPath, "aprioriData.csv"), 'r') as f:
... | [
"pandas.read_csv",
"mlxtend.frequent_patterns.apriori",
"os.path.join",
"mlxtend.preprocessing.TransactionEncoder",
"collections.defaultdict",
"pandas.DataFrame"
] | [((514, 534), 'mlxtend.preprocessing.TransactionEncoder', 'TransactionEncoder', ([], {}), '()\n', (532, 534), False, 'from mlxtend.preprocessing import TransactionEncoder\n'), ((600, 641), 'pandas.DataFrame', 'pd.DataFrame', (['te_ary'], {'columns': 'te.columns_'}), '(te_ary, columns=te.columns_)\n', (612, 641), True, ... |
from kajiki import i18n
from flask import request
from flask_kajiki import render_template
# N. B. settting i18n.gettext would affect tests from all modules,
# so we test for request path that only functions from this module could set
def gettext(s):
if request.path == '/test_i18n':
return s.upper()
r... | [
"flask_kajiki.render_template"
] | [((525, 553), 'flask_kajiki.render_template', 'render_template', (['"""i18n.html"""'], {}), "('i18n.html')\n", (540, 553), False, 'from flask_kajiki import render_template\n')] |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
# Copyright 2018 The HuggingFace Inc. team.
#
# 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/licen... | [
"paddlenlp.data.Pad",
"paddlenlp.metrics.squad.compute_prediction",
"paddle.nn.functional.cross_entropy",
"paddle.seed",
"os.path.exists",
"paddle.no_grad",
"json.dumps",
"paddle.distributed.init_parallel_env",
"numpy.random.seed",
"paddle.io.DataLoader",
"paddle.set_device",
"paddle.io.BatchS... | [((1787, 1803), 'paddle.no_grad', 'paddle.no_grad', ([], {}), '()\n', (1801, 1803), False, 'import paddle\n'), ((1704, 1726), 'random.seed', 'random.seed', (['args.seed'], {}), '(args.seed)\n', (1715, 1726), False, 'import random\n'), ((1731, 1756), 'numpy.random.seed', 'np.random.seed', (['args.seed'], {}), '(args.see... |
# Credit to https://medium.com/emergent-future/simple-reinforcement-learning-with-tensorflow-part-0-q-learning-with-tables-and-neural-networks-d195264329d0
import gym
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
env = gym.make('FrozenLake-v0')
# NEURAL NETWORK IMPLEMENTATION
tf.reset_d... | [
"numpy.identity",
"tensorflow.reset_default_graph",
"numpy.random.rand",
"tensorflow.placeholder",
"matplotlib.pyplot.plot",
"tensorflow.Session",
"numpy.max",
"tensorflow.train.GradientDescentOptimizer",
"tensorflow.global_variables_initializer",
"tensorflow.argmax",
"matplotlib.pyplot.figure",... | [((251, 276), 'gym.make', 'gym.make', (['"""FrozenLake-v0"""'], {}), "('FrozenLake-v0')\n", (259, 276), False, 'import gym\n'), ((310, 334), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ([], {}), '()\n', (332, 334), True, 'import tensorflow as tf\n'), ((395, 463), 'tensorflow.placeholder', 'tf.placeholde... |
# 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 writing, software
# distributed under t... | [
"tink.proto.tink_pb2.KeyTemplate"
] | [((5320, 5454), 'tink.proto.tink_pb2.KeyTemplate', 'tink_pb2.KeyTemplate', ([], {'type_url': "('type.googleapis.com/google.crypto.tink.' + 'ChaCha20Poly1305Key')", 'output_prefix_type': 'tink_pb2.TINK'}), "(type_url='type.googleapis.com/google.crypto.tink.' +\n 'ChaCha20Poly1305Key', output_prefix_type=tink_pb2.TINK... |
#!/usr/bin/env python3
#########################################################
# Written by <NAME>, <EMAIL>
# Copyright (c) 2018 Blockscale LLC
# released under the MIT license
#########################################################
from flask import Flask, request, Response, json, jsonify
from src.remote_signer ... | [
"logging.basicConfig",
"flask.Flask",
"flask.json.dumps",
"os.path.isfile",
"flask.request.get_json",
"flask.json.loads",
"flask.Response",
"src.remote_signer.RemoteSigner",
"logging.info",
"flask.jsonify"
] | [((376, 486), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""./remote-signer.log"""', 'format': '"""%(asctime)s %(message)s"""', 'level': 'logging.INFO'}), "(filename='./remote-signer.log', format=\n '%(asctime)s %(message)s', level=logging.INFO)\n", (395, 486), False, 'import logging\n'), ((489... |
from palm_tree import db
class Data(db.Model):
id = db.Column(db.Integer, primary_key=True)
uuid = db.Column(db.Integer)
response = db.Column(db.Text)
datetime = db.Column(db.DateTime)
def __init__(self, uuid, response, datetime):
self.uuid = uuid
self.response = response
... | [
"palm_tree.db.Column"
] | [((58, 97), 'palm_tree.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (67, 97), False, 'from palm_tree import db\n'), ((109, 130), 'palm_tree.db.Column', 'db.Column', (['db.Integer'], {}), '(db.Integer)\n', (118, 130), False, 'from palm_tree import db\n'), ((14... |
# Copyright 2013 Mirantis, 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 ... | [
"subprocess.Popen",
"functools.wraps",
"re.search"
] | [((912, 985), 'subprocess.Popen', 'subprocess.Popen', (['command'], {'stdout': 'subprocess.PIPE', 'stderr': 'subprocess.PIPE'}), '(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n', (928, 985), False, 'import subprocess\n'), ((1342, 1381), 're.search', 're.search', (['""".*<(?P<state>.*)>.*"""', 'state'], {})... |
from ma import ma
from models.johnson_scanner_data import JohnsonScannerDataModel
from schemas.brand import BrandSchema
from schemas.category import CategorySchema
from schemas.facts_in_data import FactsInDataSchema
from schemas.market import MarketSchema
from schemas.period import PeriodSchema
class JohnsonScannerDa... | [
"ma.ma.Nested"
] | [((364, 387), 'ma.ma.Nested', 'ma.Nested', (['MarketSchema'], {}), '(MarketSchema)\n', (373, 387), False, 'from ma import ma\n'), ((400, 422), 'ma.ma.Nested', 'ma.Nested', (['BrandSchema'], {}), '(BrandSchema)\n', (409, 422), False, 'from ma import ma\n'), ((438, 463), 'ma.ma.Nested', 'ma.Nested', (['CategorySchema'], ... |
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
################################################################################
# CSE 253: Programming Assignment 3
# Winter 2019
# Code author: <NAME> (+ modifications by <NAME>)
#
# Filename: baseline_cnn.py
#
# Description:
#
# This file contains the starter code fo... | [
"torch.nn.BatchNorm2d",
"torch.nn.init.xavier_normal_",
"torch.nn.Conv2d",
"torch.nn.BatchNorm1d",
"torch.nn.MaxPool2d",
"torch.nn.Linear"
] | [((1570, 1625), 'torch.nn.Conv2d', 'nn.Conv2d', ([], {'in_channels': '(1)', 'out_channels': '(4)', 'kernel_size': '(3)'}), '(in_channels=1, out_channels=4, kernel_size=3)\n', (1579, 1625), True, 'import torch.nn as nn\n'), ((1713, 1730), 'torch.nn.BatchNorm2d', 'nn.BatchNorm2d', (['(4)'], {}), '(4)\n', (1727, 1730), Tr... |
import json
import urllib.request
import credentials
from datetime import datetime, timedelta
class NewsAPI:
def __init__(self, nyt_api):
self.nyt_access = nyt_api
def get_nyt_last_week_articles(self, topic, today):
delta = timedelta(weeks = 1)
last_week = today - delta
begin_... | [
"datetime.datetime.now",
"datetime.timedelta"
] | [((1272, 1286), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (1284, 1286), False, 'from datetime import datetime, timedelta\n'), ((251, 269), 'datetime.timedelta', 'timedelta', ([], {'weeks': '(1)'}), '(weeks=1)\n', (260, 269), False, 'from datetime import datetime, timedelta\n')] |
from cadnano.cnproxy import UndoCommand
from cadnano.strand import Strand
from cadnano import getBatch
import cadnano.preferences as prefs
import random
class CreateXoverCommand(UndoCommand):
"""
Creates a Xover from the 3' end of strand5p to the 5' end of strand3p
this needs to
1. preserve the old oli... | [
"cadnano.strand.Strand.setOligo",
"random.choice"
] | [((6327, 6361), 'cadnano.strand.Strand.setOligo', 'Strand.setOligo', (['strand', 'new_olg3p'], {}), '(strand, new_olg3p)\n', (6342, 6361), False, 'from cadnano.strand import Strand\n'), ((7743, 7773), 'cadnano.strand.Strand.setOligo', 'Strand.setOligo', (['strand', 'olg5p'], {}), '(strand, olg5p)\n', (7758, 7773), Fals... |
from w1thermsensor import W1ThermSensor
sensor = W1ThermSensor()
temperature_in_celsius = sensor.get_temperature()
temperature_in_fahrenheit = sensor.get_temperature(W1ThermSensor.DEGREES_F)
temperature_in_all_units = sensor.get_temperatures([W1ThermSensor.DEGREES_C, W1ThermSensor.DEGREES_F, W1ThermSensor.KELVIN])
pri... | [
"w1thermsensor.W1ThermSensor"
] | [((50, 65), 'w1thermsensor.W1ThermSensor', 'W1ThermSensor', ([], {}), '()\n', (63, 65), False, 'from w1thermsensor import W1ThermSensor\n')] |
# Generated by Django 3.1.1 on 2020-09-01 17:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tables', '0003_exposure_category'),
]
operations = [
migrations.AlterField(
model_name='exposure',
name='location',
... | [
"django.db.models.CharField"
] | [((338, 394), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'default': '""""""', 'max_length': '(200)'}), "(blank=True, default='', max_length=200)\n", (354, 394), False, 'from django.db import migrations, models\n')] |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | [
"knack.log.get_logger",
"azure.cli.command_modules.vm._vm_utils.check_existence",
"azure.cli.core.commands.validators.validate_file_or_dict",
"urlparse.urlparse",
"azure.cli.command_modules.vm._vm_utils.get_target_network_api",
"os.path.exists",
"azure.cli.core.util.hash_string",
"knack.prompting.prom... | [((1119, 1139), 'knack.log.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (1129, 1139), False, 'from knack.log import get_logger\n'), ((1620, 1652), 'azure.cli.core.commands.client_factory.get_subscription_id', 'get_subscription_id', (['cmd.cli_ctx'], {}), '(cmd.cli_ctx)\n', (1639, 1652), False, 'from a... |
# Copyright 2020 - 2021 MONAI Consortium
# 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 wri... | [
"parameterized.parameterized.expand",
"monai.networks.eval_mode",
"monai.networks.blocks.SubpixelUpsample",
"unittest.main",
"torch.randn"
] | [((2354, 2394), 'parameterized.parameterized.expand', 'parameterized.expand', (['TEST_CASE_SUBPIXEL'], {}), '(TEST_CASE_SUBPIXEL)\n', (2374, 2394), False, 'from parameterized import parameterized\n'), ((2698, 2713), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2711, 2713), False, 'import unittest\n'), ((2486, 2... |
from __future__ import absolute_import, division, print_function
import os
import json
from glue.core import Subset
DISPATCH = {}
def save_page(page, page_number, label, subset):
""" Convert a tab of a glue session into a D3PO page
:param page: Tuple of data viewers to save
:param label: Tab label
... | [
"os.path.exists",
"astropy.table.Table",
"random.randrange",
"os.path.join",
"webbrowser.open",
"os.chdir",
"glue.config.exporters.add",
"os.path.isdir",
"glue.external.six.moves.socketserver.TCPServer",
"os.unlink",
"os.mkdir",
"threading.Thread",
"json.dump"
] | [((4561, 4591), 'os.path.join', 'os.path.join', (['path', '"""data.csv"""'], {}), "(path, 'data.csv')\n", (4573, 4591), False, 'import os\n'), ((4601, 4689), 'astropy.table.Table', 'Table', (['[data[c] for c in data.components]'], {'names': '[c.label for c in data.components]'}), '([data[c] for c in data.components], n... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# -*- encoding: utf-8 -*-
#
# 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
#
# Un... | [
"datetime.datetime.now",
"datetime.timedelta"
] | [((1838, 1861), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (1859, 1861), False, 'import datetime\n'), ((1864, 1893), 'datetime.timedelta', 'datetime.timedelta', ([], {'minutes': '(5)'}), '(minutes=5)\n', (1882, 1893), False, 'import datetime\n')] |
# -*- coding: utf-8 -*-
"""Proiect.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1TR1Frf0EX4PtFZkLlVdGtMTINqhoQwRw
"""
# Importarea librariilor
import numpy as np
import pandas as pd # pandas pentru citirea fisierelor
from sklearn import prepr... | [
"pandas.read_csv",
"sklearn.preprocessing.StandardScaler",
"sklearn.feature_extraction.text.TfidfVectorizer",
"pandas.DataFrame",
"sklearn.preprocessing.Normalizer",
"sklearn.preprocessing.MinMaxScaler",
"sklearn.svm.SVC"
] | [((602, 673), 'pandas.read_csv', 'pd.read_csv', (['"""train_labels.txt"""'], {'sep': '"""\t"""', 'header': 'None', 'engine': '"""python"""'}), "('train_labels.txt', sep='\\t', header=None, engine='python')\n", (613, 673), True, 'import pandas as pd\n'), ((830, 902), 'pandas.read_csv', 'pd.read_csv', (['"""train_samples... |
from __future__ import annotations
import collections
import inspect
from dataclasses import dataclass
from enum import Enum
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
from flytekit.common import constants as _common_constants
from flytekit.common.exceptions.user import FlyteValidation... | [
"flytekit.core.promise.NodeOutput",
"flytekit.core.context_manager.CompilationState",
"flytekit.core.context_manager.FlyteContext.current_context",
"flytekit.core.context_manager.FlyteEntities.entities.append",
"inspect.signature",
"flytekit.core.promise.create_and_link_node",
"flytekit.core.type_engine... | [((1613, 1730), 'flytekit.core.node.Node', 'Node', ([], {'id': '_common_constants.GLOBAL_INPUT_NODE_ID', 'metadata': 'None', 'bindings': '[]', 'upstream_nodes': '[]', 'flyte_entity': 'None'}), '(id=_common_constants.GLOBAL_INPUT_NODE_ID, metadata=None, bindings=[],\n upstream_nodes=[], flyte_entity=None)\n', (1617, ... |
# Copyright (c) 2021, NVIDIA CORPORATION. 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 required by appli... | [
"torch.manual_seed",
"torch.max",
"torch.Tensor",
"numpy.logaddexp",
"numpy.exp",
"torch.tensor",
"numpy.zeros",
"torch.nn.functional.log_softmax",
"numpy.zeros_like",
"torch.randn"
] | [((2794, 2812), 'torch.max', 'torch.max', (['lengths'], {}), '(lengths)\n', (2803, 2812), False, 'import torch\n'), ((2825, 2849), 'torch.max', 'torch.max', (['label_lengths'], {}), '(label_lengths)\n', (2834, 2849), False, 'import torch\n'), ((3774, 3801), 'numpy.zeros', 'np.zeros', (['(T, U)'], {'dtype': '"""f"""'}),... |
import numpy as np
from sklearn.linear_model import LogisticRegression
from .models import User
from .twitter import vectorize_tweet
def predict_user(user1_name, user2_name, tweet_text):
"""
Determine and return which user is more likely to say a given Tweet.
Example: predict_user('ausen', 'elonmusk'... | [
"numpy.array",
"numpy.vstack",
"sklearn.linear_model.LogisticRegression"
] | [((561, 609), 'numpy.array', 'np.array', (['[tweet.vect for tweet in user1.tweets]'], {}), '([tweet.vect for tweet in user1.tweets])\n', (569, 609), True, 'import numpy as np\n'), ((627, 675), 'numpy.array', 'np.array', (['[tweet.vect for tweet in user2.tweets]'], {}), '([tweet.vect for tweet in user2.tweets])\n', (635... |
# sys
import os
import sys
import numpy as np
import random
import pickle
import json
# torch
import torch
import torch.nn as nn
from torchvision import datasets, transforms
# operation
from . import tools
class Feeder_UCF(torch.utils.data.Dataset):
""" Feeder for skeleton-based action recognition in kinetics-sk... | [
"os.listdir",
"os.path.join",
"numpy.array",
"numpy.zeros",
"json.load"
] | [((2055, 2081), 'os.listdir', 'os.listdir', (['self.data_path'], {}), '(self.data_path)\n', (2065, 2081), False, 'import os\n'), ((2393, 2454), 'numpy.array', 'np.array', (["[label_info[id]['label_index'] for id in sample_id]"], {}), "([label_info[id]['label_index'] for id in sample_id])\n", (2401, 2454), True, 'import... |
import os
import subprocess
import time
import grpc
import tests.rpc.proto.schema_registry_pb2 as pb2
import tests.rpc.proto.schema_registry_pb2_grpc as pb2_grpc
from tests.common.postgres import PostgresConfig
EXE = os.getenv('SCHEMA_REGISTRY_EXE') or 'schema-registry'
class SchemaRegistry:
def __init__(self,
... | [
"tests.rpc.proto.schema_registry_pb2.SchemaType",
"os.getenv",
"tests.rpc.proto.schema_registry_pb2_grpc.SchemaRegistryStub",
"subprocess.Popen",
"grpc.insecure_channel",
"time.sleep"
] | [((219, 251), 'os.getenv', 'os.getenv', (['"""SCHEMA_REGISTRY_EXE"""'], {}), "('SCHEMA_REGISTRY_EXE')\n", (228, 251), False, 'import os\n'), ((1585, 1617), 'subprocess.Popen', 'subprocess.Popen', (['[EXE]'], {'env': 'env'}), '([EXE], env=env)\n', (1601, 1617), False, 'import subprocess\n'), ((1626, 1639), 'time.sleep',... |
"""
When a routing policy is set with an empty condition, it should be loaded correctly and should route all
the requests to a correct backend.
"""
from urllib.parse import urlparse
import pytest
from packaging.version import Version # noqa # pylint: disable=unused-import
from testsuite import TESTED_VERSION, rawobj ... | [
"pytest.fixture",
"testsuite.echoed_request.EchoedRequest.create",
"pytest.mark.issue",
"pytest.mark.skipif"
] | [((565, 595), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (579, 595), False, 'import pytest\n'), ((773, 803), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (787, 803), False, 'import pytest\n'), ((431, 485), 'pytest.mark.skipif'... |
import contextlib
import ctypes
import json
import os
import shutil
import struct
import subprocess
import sys
import tempfile
from datetime import datetime, timedelta, timezone
from enum import Enum, auto
from hashlib import pbkdf2_hmac
from .aes import (
aes_cbc_decrypt_bytes,
aes_gcm_decrypt_and_verify_byte... | [
"enum.auto",
"ctypes.string_at",
"ctypes.create_string_buffer",
"secretstorage.get_default_collection",
"datetime.timedelta",
"os.walk",
"datetime.datetime",
"os.path.expanduser",
"os.access",
"shutil.which",
"os.path.isfile",
"os.path.dirname",
"secretstorage.dbus_init",
"shutil.copy",
... | [((19724, 19785), 'os.path.expanduser', 'os.path.expanduser', (['"""~/Library/Cookies/Cookies.binarycookies"""'], {}), "('~/Library/Cookies/Cookies.binarycookies')\n", (19742, 19785), False, 'import os\n'), ((25866, 25872), 'enum.auto', 'auto', ([], {}), '()\n', (25870, 25872), False, 'from enum import Enum, auto\n'), ... |
import logging
from collections import Counter
from django.core.management.base import BaseCommand
from django.db.models import Q
from TWLight.applications.models import Application
from TWLight.resources.models import Partner
from TWLight.applications.signals import Reminder
from TWLight.users.models import Editor
l... | [
"logging.getLogger",
"django.db.models.Q",
"TWLight.users.models.Editor.objects.get",
"TWLight.applications.signals.Reminder.coordinator_reminder.send"
] | [((328, 355), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (345, 355), False, 'import logging\n'), ((3069, 3106), 'TWLight.users.models.Editor.objects.get', 'Editor.objects.get', ([], {'id': 'coordinator[0]'}), '(id=coordinator[0])\n', (3087, 3106), False, 'from TWLight.users.models imp... |
# pvtrace 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 later version.
#
# pvtrace is distributed in the hope that it will be useful,
# but WITHOUT... | [
"Geometry.Cylinder",
"external.transformations.translation_matrix",
"numpy.sqrt",
"numpy.tan",
"Geometry.FinitePlane",
"numpy.sin",
"Geometry.transform_direction",
"numpy.array",
"numpy.random.randint",
"Geometry.transform_point",
"external.transformations.rotation_matrix",
"numpy.cos",
"num... | [((1353, 1372), 'numpy.array', 'np.array', (['[x, y, z]'], {}), '([x, y, z])\n', (1361, 1372), True, 'import numpy as np\n'), ((1299, 1313), 'numpy.sqrt', 'np.sqrt', (['(1 - s)'], {}), '(1 - s)\n', (1306, 1313), True, 'import numpy as np\n'), ((1971, 1979), 'Trace.Photon', 'Photon', ([], {}), '()\n', (1977, 1979), Fals... |