code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#!/usr/bin/env python
"""test_atom.py: Verify the Atom class functions as it's meant to."""
__author__ = "<NAME>"
__email__ = "<EMAIL>"
import unittest as ut
import numpy as np
from miniapp.system import atom
class TestAtom(ut.TestCase):
"""Unit tests for the Atom class.
"""
def test_1(self... | [
"miniapp.system.atom.Atom",
"numpy.array"
] | [((450, 475), 'numpy.array', 'np.array', (['[1.0, 1.0, 1.0]'], {}), '([1.0, 1.0, 1.0])\n', (458, 475), True, 'import numpy as np\n'), ((497, 534), 'miniapp.system.atom.Atom', 'atom.Atom', (['atom_type', 'position_vector'], {}), '(atom_type, position_vector)\n', (506, 534), False, 'from miniapp.system import atom\n')] |
# main.py
# Author: <NAME>
import app
app.UI().main()
| [
"app.UI"
] | [((40, 48), 'app.UI', 'app.UI', ([], {}), '()\n', (46, 48), False, 'import app\n')] |
from django.shortcuts import (
render,
get_object_or_404,
HttpResponseRedirect,
redirect,
)
# Create your views here.
from .models import Patient
from .forms import PatientForm
def patient_create_view(request):
context = {}
template_name = "patient_form.html"
form = PatientForm(request.PO... | [
"django.shortcuts.render",
"django.shortcuts.get_object_or_404",
"django.shortcuts.redirect",
"django.shortcuts.HttpResponseRedirect"
] | [((448, 487), 'django.shortcuts.render', 'render', (['request', 'template_name', 'context'], {}), '(request, template_name, context)\n', (454, 487), False, 'from django.shortcuts import render, get_object_or_404, HttpResponseRedirect, redirect\n'), ((639, 678), 'django.shortcuts.render', 'render', (['request', 'templat... |
import sys
from youtubesearchpython import VideosSearch as yt_video_search
def search(artist, song):
try:
video_search = yt_video_search(artist + ', ' + song, limit = 1)
return video_search.result()['result']
except: # catch *all* exceptions
e = sys.exc_info()[0]
print( "<p>Erro... | [
"youtubesearchpython.VideosSearch",
"sys.exc_info"
] | [((134, 180), 'youtubesearchpython.VideosSearch', 'yt_video_search', (["(artist + ', ' + song)"], {'limit': '(1)'}), "(artist + ', ' + song, limit=1)\n", (149, 180), True, 'from youtubesearchpython import VideosSearch as yt_video_search\n'), ((279, 293), 'sys.exc_info', 'sys.exc_info', ([], {}), '()\n', (291, 293), Fal... |
# Generated by Django 3.2.8 on 2021-10-18 20:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Task', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='notes',
name='title',
field=mo... | [
"django.db.models.CharField",
"django.db.models.TextField"
] | [((318, 361), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)', 'null': '(True)'}), '(max_length=100, null=True)\n', (334, 361), False, 'from django.db import migrations, models\n'), ((480, 513), 'django.db.models.TextField', 'models.TextField', ([], {'max_length': '(2000)'}), '(max_length=... |
from django.db import models
import django.contrib.postgres.fields as dpg
from django.contrib.auth.models import User
# Create your models here.
class Ticket(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE, null=True)
draw_date = models.DateField(null=True)
| [
"django.db.models.ForeignKey",
"django.db.models.DateField"
] | [((186, 246), 'django.db.models.ForeignKey', 'models.ForeignKey', (['User'], {'on_delete': 'models.CASCADE', 'null': '(True)'}), '(User, on_delete=models.CASCADE, null=True)\n', (203, 246), False, 'from django.db import models\n'), ((263, 290), 'django.db.models.DateField', 'models.DateField', ([], {'null': '(True)'}),... |
from andes.core import (Algeb, ExtAlgeb, ExtParam, ExtService, ExtState,
IdxParam, Model, ModelData, NumParam,)
from andes.core.block import LagAntiWindupRate, PIAWHardLimit
from andes.core.service import PostInitService
class WTPTA1Data(ModelData):
"""
Pitch control model data.
""... | [
"andes.core.ExtAlgeb",
"andes.core.IdxParam",
"andes.core.ExtParam",
"andes.core.service.PostInitService",
"andes.core.Algeb",
"andes.core.NumParam",
"andes.core.block.PIAWHardLimit",
"andes.core.block.LagAntiWindupRate",
"andes.core.ModelData.__init__",
"andes.core.ExtState",
"andes.core.ExtSer... | [((355, 379), 'andes.core.ModelData.__init__', 'ModelData.__init__', (['self'], {}), '(self)\n', (373, 379), False, 'from andes.core import Algeb, ExtAlgeb, ExtParam, ExtService, ExtState, IdxParam, Model, ModelData, NumParam\n'), ((400, 465), 'andes.core.IdxParam', 'IdxParam', ([], {'mandatory': '(True)', 'info': '"""... |
# Copyright 2018 Google LLC. 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 applicable law or a... | [
"httplib2.Http",
"StringIO.StringIO"
] | [((2524, 2590), 'httplib2.Http', 'httplib2.Http', ([], {'timeout': '(60)', 'disable_ssl_certificate_validation': '(True)'}), '(timeout=60, disable_ssl_certificate_validation=True)\n', (2537, 2590), False, 'import httplib2\n'), ((2826, 2852), 'StringIO.StringIO', 'StringIO.StringIO', (['content'], {}), '(content)\n', (2... |
import sys
import teca_py
import numpy as np
class teca_tc_wind_radii_stats(teca_py.teca_python_algorithm):
"""
Computes statistics using track wind radii
"""
def __init__(self):
self.basename = 'stats'
self.dpi = 100
self.interactive = False
self.wind_column = 'surface_... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.figure",
"matplotlib.colors.LogNorm",
"matplotlib.pyplot.gca",
"matplotlib.patches.Patch",
"numpy.max",
"teca_py.as_teca_table",
"matplotlib.pyplot.show",
"matplotlib.pyplot.legend",
"teca_py.teca_tc_saffir_simpson.get_u... | [((1697, 1730), 'teca_py.as_teca_table', 'teca_py.as_teca_table', (['data_in[0]'], {}), '(data_in[0])\n', (1718, 1730), False, 'import teca_py\n'), ((2053, 2099), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(9.25, 6.75)', 'dpi': 'self.dpi'}), '(figsize=(9.25, 6.75), dpi=self.dpi)\n', (2063, 2099), True,... |
"""The tests for the mFi sensor platform."""
import unittest
import unittest.mock as mock
import requests
from homeassistant.bootstrap import setup_component
import homeassistant.components.sensor as sensor
import homeassistant.components.sensor.mfi as mfi
from homeassistant.const import TEMP_CELSIUS
from tests.comm... | [
"homeassistant.bootstrap.setup_component",
"tests.common.get_test_home_assistant",
"unittest.mock.MagicMock",
"unittest.mock.PropertyMock",
"homeassistant.components.sensor.mfi.MfiSensor",
"unittest.mock.patch.dict",
"unittest.mock.patch",
"unittest.mock.call"
] | [((1312, 1342), 'unittest.mock.patch', 'mock.patch', (['"""mficlient.client"""'], {}), "('mficlient.client')\n", (1322, 1342), True, 'import unittest.mock as mock\n'), ((1690, 1720), 'unittest.mock.patch', 'mock.patch', (['"""mficlient.client"""'], {}), "('mficlient.client')\n", (1700, 1720), True, 'import unittest.moc... |
# Copyright (c) 2016, <NAME> <github: philipperemy>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHO... | [
"subprocess.Popen",
"os.remove",
"os.makedirs",
"argparse.ArgumentParser",
"os.path.realpath",
"os.path.exists"
] | [((1199, 1225), 'os.path.exists', 'os.path.exists', (['tmp_folder'], {}), '(tmp_folder)\n', (1213, 1225), False, 'import os\n'), ((1228, 1251), 'os.makedirs', 'os.makedirs', (['tmp_folder'], {}), '(tmp_folder)\n', (1239, 1251), False, 'import os\n'), ((1280, 1324), 'argparse.ArgumentParser', 'ArgumentParser', (['"""Sta... |
import scrape
import os
import json
from datetime import datetime
import hashlib
page_count = 0
book_count = 0
next_page = scrape.base_url
# initialize scraper
max_page = 2 # adjust to scrape fewer or more pages
scrape_images = True # toggle to download or not download image for books
image_folder = "./images"
if not... | [
"os.mkdir",
"scrape.scrape_list",
"os.path.exists",
"scrape.scrape_book",
"json.dumps",
"scrape.download_image"
] | [((321, 349), 'os.path.exists', 'os.path.exists', (['image_folder'], {}), '(image_folder)\n', (335, 349), False, 'import os\n'), ((355, 377), 'os.mkdir', 'os.mkdir', (['image_folder'], {}), '(image_folder)\n', (363, 377), False, 'import os\n'), ((601, 630), 'scrape.scrape_list', 'scrape.scrape_list', (['next_page'], {}... |
# Generated by Django 3.2.8 on 2021-12-27 16:04
import django.core.files.storage
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Param... | [
"django.db.models.TextField",
"django.db.models.OneToOneField",
"django.db.models.CharField",
"django.db.models.FloatField",
"django.db.models.AutoField",
"django.db.models.IntegerField",
"django.db.models.DateTimeField"
] | [((375, 426), 'django.db.models.AutoField', 'models.AutoField', ([], {'primary_key': '(True)', 'serialize': '(False)'}), '(primary_key=True, serialize=False)\n', (391, 426), False, 'from django.db import migrations, models\n'), ((466, 500), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'default': 'Non... |
# -*- coding: utf-8 -*-
import re
import pytest
from mimesis import Hardware
from mimesis.data import (
CPU,
CPU_CODENAMES,
CPU_MODEL_CODES,
GENERATION,
GRAPHICS,
HDD_SSD,
MANUFACTURERS,
PHONE_MODELS,
RAM_SIZES,
RAM_TYPES,
RESOLUTIONS,
SCREEN_SIZES,
)
from . import patt... | [
"mimesis.Hardware"
] | [((410, 420), 'mimesis.Hardware', 'Hardware', ([], {}), '()\n', (418, 420), False, 'from mimesis import Hardware\n'), ((2121, 2140), 'mimesis.Hardware', 'Hardware', ([], {'seed': 'seed'}), '(seed=seed)\n', (2129, 2140), False, 'from mimesis import Hardware\n'), ((2201, 2220), 'mimesis.Hardware', 'Hardware', ([], {'seed... |
import os
import subprocess
from astropy import units as u
from threading import Event
from threading import Timer
from pocs.utils import current_time
from pocs.utils import error
from pocs.utils.images import cr2 as cr2_utils
from pocs.camera import AbstractGPhotoCamera
class Camera(AbstractGPhotoCamera):
def... | [
"subprocess.Popen",
"threading.Timer",
"threading.Event",
"pocs.utils.current_time",
"os.getenv",
"pocs.utils.images.cr2.cr2_to_fits"
] | [((3978, 3985), 'threading.Event', 'Event', ([], {}), '()\n', (3983, 3985), False, 'from threading import Event\n'), ((4897, 4968), 'threading.Timer', 'Timer', (['wait_time', 'self.process_exposure', '(metadata, camera_event, proc)'], {}), '(wait_time, self.process_exposure, (metadata, camera_event, proc))\n', (4902, 4... |
# set the matplotlib backend so figures can be saved in the background
import matplotlib
matplotlib.use("Agg")
# import the necessary packages
from pyimagesearch.convautoencoder import ConvAutoencoder
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.datasets import mnist
import matplotlib.pyplot as p... | [
"matplotlib.pyplot.title",
"pyimagesearch.convautoencoder.ConvAutoencoder.build",
"argparse.ArgumentParser",
"matplotlib.pyplot.plot",
"cv2.imwrite",
"matplotlib.pyplot.legend",
"numpy.expand_dims",
"tensorflow.keras.datasets.mnist.load_data",
"numpy.hstack",
"matplotlib.pyplot.style.use",
"matp... | [((89, 110), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (103, 110), False, 'import matplotlib\n'), ((430, 455), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (453, 455), False, 'import argparse\n'), ((980, 997), 'tensorflow.keras.datasets.mnist.load_data', 'mnist.loa... |
# Copyright 2012-2013 OpenStack Foundation
#
# 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 la... | [
"openstackclient.i18n._",
"osc_lib.exceptions.CommandError",
"osc_lib.utils.wait_for_status",
"importlib.import_module"
] | [((872, 905), 'openstackclient.i18n._', '_', (['"""Create a server backup image"""'], {}), "('Create a server backup image')\n", (873, 905), False, 'from openstackclient.i18n import _\n'), ((3197, 3282), 'osc_lib.utils.wait_for_status', 'utils.wait_for_status', (['image_client.get_image', 'image.id'], {'callback': '_sh... |
# Copyright 2021 Hathor Labs
#
# 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, s... | [
"hathor.api_util.set_cors",
"hathor.conf.HathorSettings",
"json.dumps"
] | [((840, 856), 'hathor.conf.HathorSettings', 'HathorSettings', ([], {}), '()\n', (854, 856), False, 'from hathor.conf import HathorSettings\n'), ((3657, 3681), 'hathor.api_util.set_cors', 'set_cors', (['request', '"""GET"""'], {}), "(request, 'GET')\n", (3665, 3681), False, 'from hathor.api_util import set_cors\n'), ((4... |
from django.urls import path, re_path
from . import views
app_name = "core"
urlpatterns = [
path("", views.home, name="home"),
path("url/<int:pk>", views.modify, name="modify"),
re_path(r"^([a-zA-Z0-9_-]+)/$", views.forward, name="forward"),
]
| [
"django.urls.re_path",
"django.urls.path"
] | [((98, 131), 'django.urls.path', 'path', (['""""""', 'views.home'], {'name': '"""home"""'}), "('', views.home, name='home')\n", (102, 131), False, 'from django.urls import path, re_path\n'), ((137, 186), 'django.urls.path', 'path', (['"""url/<int:pk>"""', 'views.modify'], {'name': '"""modify"""'}), "('url/<int:pk>', vi... |
# Generated by Django 3.0.5 on 2020-05-05 23:02
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('abstracts', '0058_conference_editing_user'),
]
operations = [
migrations.AlterModelOptions(
name='organizer',
options={'orde... | [
"django.db.migrations.AlterModelOptions"
] | [((234, 325), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""organizer"""', 'options': "{'ordering': ['abbreviation']}"}), "(name='organizer', options={'ordering': [\n 'abbreviation']})\n", (262, 325), False, 'from django.db import migrations\n')] |
import dace
import dace.graph.labeling
import sys
import time
print(time.time(), 'loading')
a = dace.SDFG.from_file(sys.argv[1])
print(time.time(), 'propagating')
dace.graph.labeling.propagate_labels_sdfg(a)
print(time.time(), 'drawing')
a.draw_to_file()
exit()
a.apply_strict_transformations()
a.apply_strict_transfo... | [
"dace.SDFG.from_file",
"dace.graph.labeling.propagate_labels_sdfg",
"time.time"
] | [((97, 129), 'dace.SDFG.from_file', 'dace.SDFG.from_file', (['sys.argv[1]'], {}), '(sys.argv[1])\n', (116, 129), False, 'import dace\n'), ((164, 208), 'dace.graph.labeling.propagate_labels_sdfg', 'dace.graph.labeling.propagate_labels_sdfg', (['a'], {}), '(a)\n', (205, 208), False, 'import dace\n'), ((69, 80), 'time.tim... |
from common import db
from discord.ext import commands
from modules.utils import isAdmin
class Notify(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(name="notify")
async def toggle_notify(self, ctx):
if isAdmin(ctx.message.author, ctx.guild.id):
notif... | [
"modules.utils.isAdmin",
"common.db.toggle_notify",
"discord.ext.commands.command"
] | [((177, 208), 'discord.ext.commands.command', 'commands.command', ([], {'name': '"""notify"""'}), "(name='notify')\n", (193, 208), False, 'from discord.ext import commands\n'), ((260, 301), 'modules.utils.isAdmin', 'isAdmin', (['ctx.message.author', 'ctx.guild.id'], {}), '(ctx.message.author, ctx.guild.id)\n', (267, 30... |
import os, sys
import re
def check_url(url):
""" Check if the url available """
ret = 0
code = 404
try:
from urllib2 import urlopen
except:
from urllib.request import urlopen
try:
resp = urlopen(url)
code = resp.getcode()
except:
pass
if code !... | [
"os.makedirs",
"os.path.exists",
"os.system",
"urllib.request.urlopen",
"sys.exit"
] | [((600, 614), 'os.system', 'os.system', (['cmd'], {}), '(cmd)\n', (609, 614), False, 'import os, sys\n'), ((1177, 1190), 'sys.exit', 'sys.exit', (['ret'], {}), '(ret)\n', (1185, 1190), False, 'import os, sys\n'), ((238, 250), 'urllib.request.urlopen', 'urlopen', (['url'], {}), '(url)\n', (245, 250), False, 'from urllib... |
from setuptools import setup
from pip.req import parse_requirements
install_reqs = parse_requirements('requirements.txt', session=False)
setup(
name = "lrs",
version = "0.0.0",
author = "ADL",
packages=['lrs'],
install_requires=[str(ir.req) for ir in install_reqs],
)
| [
"pip.req.parse_requirements"
] | [((84, 137), 'pip.req.parse_requirements', 'parse_requirements', (['"""requirements.txt"""'], {'session': '(False)'}), "('requirements.txt', session=False)\n", (102, 137), False, 'from pip.req import parse_requirements\n')] |
from profiles.models import *
from django.contrib import admin
admin.site.register(FriendGroup)
admin.site.register(UserProfile)
| [
"django.contrib.admin.site.register"
] | [((64, 96), 'django.contrib.admin.site.register', 'admin.site.register', (['FriendGroup'], {}), '(FriendGroup)\n', (83, 96), False, 'from django.contrib import admin\n'), ((97, 129), 'django.contrib.admin.site.register', 'admin.site.register', (['UserProfile'], {}), '(UserProfile)\n', (116, 129), False, 'from django.co... |
from typing import List, Tuple, Type
import numpy as np
from continuum.datasets.base import _ContinuumDataset
from continuum.datasets.pytorch import (CIFAR10, CIFAR100, KMNIST, MNIST, FashionMNIST)
class Fellowship(_ContinuumDataset):
def __init__(
self,
dataset_list: List[Type[_ContinuumDatase... | [
"numpy.unique",
"numpy.concatenate"
] | [((865, 882), 'numpy.concatenate', 'np.concatenate', (['x'], {}), '(x)\n', (879, 882), True, 'import numpy as np\n'), ((895, 912), 'numpy.concatenate', 'np.concatenate', (['y'], {}), '(y)\n', (909, 912), True, 'import numpy as np\n'), ((832, 850), 'numpy.unique', 'np.unique', (['data[1]'], {}), '(data[1])\n', (841, 850... |
from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals
from math import log
from random import randint #, shuffle, sample
from functools import reduce
from operator import __or__
import numpy as np
import pytest
from mmgroup.bitfunctions import bit_mat_mul, bit_ma... | [
"mmgroup.clifford12.bitmatrix64_error_pool",
"random.randint",
"mmgroup.clifford12.bitmatrix64_cap_h",
"mmgroup.bitfunctions.bit_mat_inverse",
"mmgroup.clifford12.bitmatrix64_mul",
"mmgroup.clifford12.bitmatrix64_t",
"numpy.zeros",
"mmgroup.clifford12.bitmatrix64_inv",
"numpy.array",
"mmgroup.bitf... | [((929, 942), 'random.randint', 'randint', (['(0)', 'm'], {}), '(0, m)\n', (936, 942), False, 'from random import randint\n'), ((1575, 1597), 'mmgroup.clifford12.bitmatrix64_t', 'bitmatrix64_t', (['m', 'cols'], {}), '(m, cols)\n', (1588, 1597), False, 'from mmgroup.clifford12 import bitmatrix64_t\n'), ((3304, 3343), 'n... |
from py2neo import Graph
from py2neo.packages.httpstream import http
class Neo4J_Mathcat:
__conn = ''
def __init__(self, url):
http.socket_timeout = 9999
self.__conn = Graph(url)
def __escape(self, string):
return string.replace('\\', '\\\\').replace('"', '\\"').replace("'", "\\'"... | [
"py2neo.Graph"
] | [((194, 204), 'py2neo.Graph', 'Graph', (['url'], {}), '(url)\n', (199, 204), False, 'from py2neo import Graph\n')] |
from sklearn.decomposition import FactorAnalysis
from sklearn.decomposition import FastICA
from sklearn.decomposition import LatentDirichletAllocation
from sklearn.decomposition import TruncatedSVD
from sklearn.decomposition import NMF
from sklearn.manifold import Isomap
from sklearn.manifold import MDS
from sklearn.ma... | [
"keras.layers.Input",
"keras.layers.Dense",
"keras.Model",
"keras.losses.MeanSquaredError"
] | [((853, 889), 'keras.layers.Input', 'keras.layers.Input', ([], {'shape': 'X.shape[1]'}), '(shape=X.shape[1])\n', (871, 889), False, 'import keras\n'), ((1080, 1108), 'keras.Model', 'keras.Model', (['input_', 'decoded'], {}), '(input_, decoded)\n', (1091, 1108), False, 'import keras\n'), ((1131, 1159), 'keras.Model', 'k... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from sklearn import datasets
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import LeaveOneOut
from sklearn.metrics import accuracy_score
def main():
# アイリスデータセットを読み込む
dataset = datasets.load_iris()
# 教師データとラベルデータを取り出す
featu... | [
"sklearn.datasets.load_iris",
"sklearn.metrics.accuracy_score",
"sklearn.tree.DecisionTreeClassifier",
"sklearn.model_selection.LeaveOneOut"
] | [((265, 285), 'sklearn.datasets.load_iris', 'datasets.load_iris', ([], {}), '()\n', (283, 285), False, 'from sklearn import datasets\n'), ((450, 463), 'sklearn.model_selection.LeaveOneOut', 'LeaveOneOut', ([], {}), '()\n', (461, 463), False, 'from sklearn.model_selection import LeaveOneOut\n'), ((880, 921), 'sklearn.me... |
import json
from datetime import timedelta
from django.conf import settings
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from django.utils import timezone
from apps.core.models import Service, Statistic
class Command(BaseCommand):
help = 'Get statistics of user... | [
"json.loads",
"django.utils.timezone.now",
"apps.core.models.Statistic.objects.filter",
"json.dumps",
"datetime.timedelta",
"django.contrib.auth.models.User.objects.exclude",
"apps.core.models.Service.objects.all"
] | [((3938, 3982), 'apps.core.models.Statistic.objects.filter', 'Statistic.objects.filter', ([], {'time__lt': 'two_month'}), '(time__lt=two_month)\n', (3962, 3982), False, 'from apps.core.models import Service, Statistic\n'), ((4332, 4388), 'django.contrib.auth.models.User.objects.exclude', 'User.objects.exclude', ([], {'... |
# IMPORTATION STANDARD
import requests
import logging
from typing import Optional
# IMPORTATION THIRD PARTY
# IMPORTATION INTERNAL
import degiro_connector.core.constants.urls as urls
from degiro_connector.quotecast.models.quotecast_pb2 import (
Quotecast,
)
from degiro_connector.core.abstracts.abstract_action impo... | [
"requests.Request"
] | [((2754, 2805), 'requests.Request', 'requests.Request', ([], {'method': '"""POST"""', 'url': 'url', 'data': 'data'}), "(method='POST', url=url, data=data)\n", (2770, 2805), False, 'import requests\n')] |
import os
import time
from flask import Blueprint, render_template, redirect, url_for, flash, request, abort
from flask_login import current_user, login_required
from flask_ckeditor import upload_success, upload_fail
from approval_system.extensions import db, archives, student_permission
from approval_system.forms im... | [
"approval_system.utils.upload_file",
"approval_system.models.Comment.query.filter_by",
"os.remove",
"flask.flash",
"flask.request.files.get",
"approval_system.forms.FileApplyForm",
"approval_system.extensions.student_permission.require",
"approval_system.utils.flash_errors",
"flask_ckeditor.upload_s... | [((526, 553), 'flask.Blueprint', 'Blueprint', (['"""user"""', '__name__'], {}), "('user', __name__)\n", (535, 553), False, 'from flask import Blueprint, render_template, redirect, url_for, flash, request, abort\n'), ((2598, 2644), 'approval_system.extensions.student_permission.require', 'student_permission.require', ([... |
from math import sqrt
def total(arr):
sum=0
for i in range(2,len(arr)):
if isprime(i):
sum+=arr[i]
return sum
def isprime(num):
for i in range(2,int(sqrt(num))+1):
if num%i==0:
return False
return True | [
"math.sqrt"
] | [((185, 194), 'math.sqrt', 'sqrt', (['num'], {}), '(num)\n', (189, 194), False, 'from math import sqrt\n')] |
import os
from collections.abc import MutableMapping as DictMixin
import re
from unicodedata import normalize
from urllib.parse import unquote as _urlunquote
from functools import partial
from ..common_helpers import touni, HeaderDict, HeaderProperty, cached_property
from .. import errors
urlunquote = partial(_urlun... | [
"functools.partial",
"unicodedata.normalize",
"os.path.join",
"os.path.isdir",
"os.path.exists",
"re.sub",
"re.compile"
] | [((306, 345), 'functools.partial', 'partial', (['_urlunquote'], {'encoding': '"""latin1"""'}), "(_urlunquote, encoding='latin1')\n", (313, 345), False, 'from functools import partial\n'), ((533, 581), 're.compile', 're.compile', (['"""^(.+?)\\\\[\\\\s*([^\\\\[\\\\]]+?)\\\\s*\\\\]$"""'], {}), "('^(.+?)\\\\[\\\\s*([^\\\\... |
#!/usr/bin/env python3
import csv
import numpy as np
import matplotlib.pyplot as plt
import accuBar as accuBar
import groupBar2 as groupBar2
def getLatecnyFromCSV(a):
print(a)
with open(a, 'r') as f:
reader = csv.reader(f)
#reader = [each for each in csv.DictReader(f, delimiter=',')]
res... | [
"accuBar.normalize",
"accuBar.DrawFigure",
"csv.reader"
] | [((1773, 1933), 'accuBar.DrawFigure', 'accuBar.DrawFigure', (["['LL', 'LB', 'BL', 'BB']", '[r1, r2]', "['load+remap', 'write']", '""""""', '"""additional cycles"""', '"""lz4_pipe2_2stage_increased_latency"""', '(True)', '""""""'], {}), "(['LL', 'LB', 'BL', 'BB'], [r1, r2], ['load+remap',\n 'write'], '', 'additional ... |
# Copyright (c) 2018 <NAME>
# This code is available under the "Apache License 2.0"
# Please see the file COPYING in this distribution for license terms.
import tensorflow as tf
import os
import json
from layer import layer
from optimizer import optimizer
from dataset import train_dataset
def read_json(name):
w... | [
"layer.layer",
"optimizer.optimizer",
"dataset.train_dataset",
"os.path.exists",
"tensorflow.keras.Sequential"
] | [((497, 517), 'os.path.exists', 'os.path.exists', (['path'], {}), '(path)\n', (511, 517), False, 'import os\n'), ((683, 704), 'tensorflow.keras.Sequential', 'tf.keras.Sequential', ([], {}), '()\n', (702, 704), True, 'import tensorflow as tf\n'), ((837, 858), 'optimizer.optimizer', 'optimizer', (['model_json'], {}), '(m... |
#!/usr/bin/env python2
# Source:
# https://github.com/zcutlip/bowcaster/blob/master/src/bowcaster/encoders/mips.py
#
# Copyright (c) 2013 <NAME> <<EMAIL>>,
# 2013 Tactical Network Solutions, LLC
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and assoc... | [
"pwnlib.util.fiddling.xor_key"
] | [((5192, 5223), 'pwnlib.util.fiddling.xor_key', 'xor_key', (['raw_bytes'], {'avoid': 'avoid'}), '(raw_bytes, avoid=avoid)\n', (5199, 5223), False, 'from pwnlib.util.fiddling import xor_key\n')] |
import time, requests, os
from bs4 import BeautifulSoup
from storages import Storage
from .base_archiver import Archiver, ArchiveResult
class WaybackArchiver(Archiver):
name = "wayback"
def __init__(self, storage: Storage):
super(WaybackArchiver, self).__init__(storage)
self.seen_urls = {}
... | [
"time.sleep",
"requests.get",
"bs4.BeautifulSoup",
"requests.post",
"os.getenv"
] | [((677, 767), 'requests.post', 'requests.post', (['"""https://web.archive.org/save/"""'], {'headers': 'ia_headers', 'data': "{'url': url}"}), "('https://web.archive.org/save/', headers=ia_headers, data={\n 'url': url})\n", (690, 767), False, 'import time, requests, os\n'), ((1089, 1175), 'requests.get', 'requests.ge... |
##
# .protocol.version
##
"""
PQ version class used by startup messages.
"""
from struct import Struct
version_struct = Struct('!HH')
class Version(tuple):
"""
Version((major, minor)) -> Version
Version serializer and parser.
"""
major = property(fget = lambda s: s[0])
minor = property(fget = lambda s: s[1])
... | [
"struct.Struct"
] | [((120, 133), 'struct.Struct', 'Struct', (['"""!HH"""'], {}), "('!HH')\n", (126, 133), False, 'from struct import Struct\n')] |
import _sk_fail; _sk_fail._("pyclbr")
| [
"_sk_fail._"
] | [((17, 37), '_sk_fail._', '_sk_fail._', (['"""pyclbr"""'], {}), "('pyclbr')\n", (27, 37), False, 'import _sk_fail\n')] |
"""
Compare screenshots taken via the webdriver.
"""
# Copyright (c) 2013 contributors; see AUTHORS.
# Licensed under the Apache License, Version 2.0
# https://www.apache.org/licenses/LICENSE-2.0
import math
import operator
try:
# Pillow
from PIL import Image
from PIL import ImageChops
except ImportError... | [
"gossamer.exc.TestError",
"Image.open",
"ImageChops.difference",
"gossamer.util.log.debug"
] | [((1394, 1450), 'gossamer.util.log.debug', 'util.log.debug', (['"""images_identical: %s, %s"""', 'path1', 'path2'], {}), "('images_identical: %s, %s', path1, path2)\n", (1408, 1450), False, 'from gossamer import util, exc\n'), ((1462, 1479), 'Image.open', 'Image.open', (['path1'], {}), '(path1)\n', (1472, 1479), False,... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
class implementations for real-time 3D feature extraction
"""
from abc import abstractmethod
import pandas as pd
import os
import glob
import numpy as np
from tomo_encoders import Patches
from tomo_encoders import DataFile
import cupy as cp
import h5py
import abc
i... | [
"tomo_encoders.misc.voxel_processing.normalize_volume_gpu",
"tomo_encoders.DataFile",
"time.time"
] | [((1510, 1521), 'time.time', 'time.time', ([], {}), '()\n', (1519, 1521), False, 'import time\n'), ((1664, 1766), 'tomo_encoders.DataFile', 'DataFile', (["dataset['fpath_X']"], {'autodetect_format': '(True)', 'data_tag': "dataset['data_tag_X']", 'VERBOSITY': '(0)'}), "(dataset['fpath_X'], autodetect_format=True, data_t... |
# testing adafruit atecc module
import board
import adafruit_atecc
import busio
import time
_WAKE_CLK_FREQ = 100000 # slower clock speed
i2c = busio.I2C(board.SCL, board.SDA, frequency=_WAKE_CLK_FREQ)
atecc = adafruit_atecc.ATECCx08A(i2c)
print("Found ATECC!")
r = bytearray(1)
while True:
print("Waking up chip... | [
"busio.I2C",
"adafruit_atecc.ATECCx08A",
"time.sleep"
] | [((147, 204), 'busio.I2C', 'busio.I2C', (['board.SCL', 'board.SDA'], {'frequency': '_WAKE_CLK_FREQ'}), '(board.SCL, board.SDA, frequency=_WAKE_CLK_FREQ)\n', (156, 204), False, 'import busio\n'), ((214, 243), 'adafruit_atecc.ATECCx08A', 'adafruit_atecc.ATECCx08A', (['i2c'], {}), '(i2c)\n', (238, 243), False, 'import ada... |
import numpy as np
import colorlover as cl
from multiagent.scenario import BaseScenario
from mdac.utils.entities import Drone, TargetLandmark, SupplyEntity
from mdac.utils.worlds import DroneWorld
class Scenario(BaseScenario):
def make_world(self):
n_lidar_per_agent = 256
world = DroneWorld(n_lida... | [
"numpy.random.uniform",
"numpy.abs",
"numpy.copy",
"numpy.zeros",
"mdac.utils.entities.TargetLandmark",
"colorlover.to_numeric",
"mdac.utils.entities.Drone",
"numpy.linalg.norm",
"mdac.utils.worlds.DroneWorld",
"numpy.concatenate"
] | [((303, 373), 'mdac.utils.worlds.DroneWorld', 'DroneWorld', ([], {'n_lidar_per_agent': 'n_lidar_per_agent', 'mem_frames': '(1)', 'dt': '(0.08)'}), '(n_lidar_per_agent=n_lidar_per_agent, mem_frames=1, dt=0.08)\n', (313, 373), False, 'from mdac.utils.worlds import DroneWorld\n'), ((1458, 1486), 'numpy.random.uniform', 'n... |
import os
print("Enter your folder name to add to documents: ")
newDir = input()
print("Enter the number of chapters + 1 (16 chapters would be 17): ")
ch_Num = input()
ch_Num = int(y)
dirs = range(1, ch_Num)
parent_dir = f"/Documents/{newDir}"
for dir in dirs:
new_dir = ('Chapter' + str(dir))
path = os.path... | [
"os.path.join",
"os.makedirs"
] | [((313, 346), 'os.path.join', 'os.path.join', (['parent_dir', 'new_dir'], {}), '(parent_dir, new_dir)\n', (325, 346), False, 'import os\n'), ((351, 368), 'os.makedirs', 'os.makedirs', (['path'], {}), '(path)\n', (362, 368), False, 'import os\n')] |
# Required for Python to search this directory for module files
# Keep this file free of any code or import statements that could
# cause either an error to occur or a log message to be logged.
# This ensures that calling code can import initialization code from
# webkitpy before any errors or log messages due to code... | [
"webkitpy.benchmark_runner.http_server_driver.http_server_driver_factory.HTTPServerDriverFactory.add",
"os.path.abspath"
] | [((979, 1042), 'webkitpy.benchmark_runner.http_server_driver.http_server_driver_factory.HTTPServerDriverFactory.add', 'HTTPServerDriverFactory.add', (['platform', 'http_server_driver_class'], {}), '(platform, http_server_driver_class)\n', (1006, 1042), False, 'from webkitpy.benchmark_runner.http_server_driver.http_serv... |
# -*- coding: utf-8 -*-
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from sklearn.base import BaseEstimator, TransformerMixin
from karura.core.insight import Insight
from karura.core.dataframe_extension import FType
class DatetimeToCategoricalInsight(Insight):
def __init__(self):
su... | [
"pandas.concat"
] | [((765, 804), 'pandas.concat', 'pd.concat', (['[dfe.df, month, day]'], {'axis': '(1)'}), '([dfe.df, month, day], axis=1)\n', (774, 804), True, 'import pandas as pd\n'), ((1829, 1858), 'pandas.concat', 'pd.concat', (['[X, month]'], {'axis': '(1)'}), '([X, month], axis=1)\n', (1838, 1858), True, 'import pandas as pd\n'),... |
#!/usr/bin/env python
"""Release the package."""
import datetime
import argparse
import os
import subprocess
def parse_arguments():
"""Return the command line arguments."""
bump = subprocess.check_output(("bump2version", "--list", "--dry-run", "--allow-dirty", "part"), text=True)
current_version = [line... | [
"subprocess.run",
"subprocess.check_output",
"datetime.date.today",
"argparse.ArgumentParser"
] | [((192, 296), 'subprocess.check_output', 'subprocess.check_output', (["('bump2version', '--list', '--dry-run', '--allow-dirty', 'part')"], {'text': '(True)'}), "(('bump2version', '--list', '--dry-run',\n '--allow-dirty', 'part'), text=True)\n", (215, 296), False, 'import subprocess\n'), ((419, 527), 'argparse.Argume... |
import z3
from typing import List, NamedTuple, Dict, Optional
CloneExpressionOutput = NamedTuple("CloneExpressionOutput", [
("clones", List[z3.BoolRef]), ("var_map", Dict[z3.ExprRef, List[z3.ExprRef]])
])
def serialize_expression(expression: z3.ExprRef) -> str:
s = z3.Solver()
s.add(expression)
retur... | [
"z3.parse_smt2_string",
"typing.NamedTuple",
"z3.substitute",
"z3.Solver",
"z3.is_const"
] | [((87, 208), 'typing.NamedTuple', 'NamedTuple', (['"""CloneExpressionOutput"""', "[('clones', List[z3.BoolRef]), ('var_map', Dict[z3.ExprRef, List[z3.ExprRef]])]"], {}), "('CloneExpressionOutput', [('clones', List[z3.BoolRef]), (\n 'var_map', Dict[z3.ExprRef, List[z3.ExprRef]])])\n", (97, 208), False, 'from typing i... |
##############################################################################
# Copyright by The HDF Group. #
# All rights reserved. #
# #
# Th... | [
"datanode_lib.check_metadata_obj",
"hsds_logger.info",
"hsds_logger.request",
"datanode_lib.get_obj_id",
"util.idUtil.isValidUuid",
"aiohttp.web.json_response",
"time.time",
"aiohttp.web_exceptions.HTTPInternalServerError",
"aiohttp.web_exceptions.HTTPBadRequest",
"datanode_lib.save_metadata_obj",... | [((1327, 1347), 'hsds_logger.request', 'log.request', (['request'], {}), '(request)\n', (1338, 1347), True, 'import hsds_logger as log\n'), ((1420, 1439), 'datanode_lib.get_obj_id', 'get_obj_id', (['request'], {}), '(request)\n', (1430, 1439), False, 'from datanode_lib import get_obj_id, get_metadata_obj, save_metadata... |
import os
import unittest
class TestCython(unittest.TestCase):
pass
def add_test(name, runner, target):
setattr(TestCython, "test_" + name, lambda s: runner(s, target))
try:
import Cython
import glob
import sys
targets = glob.glob(os.path.join(os.path.dirname(__file__), "cython", "setup_*.py")... | [
"os.getcwd",
"os.path.dirname",
"os.chdir",
"os.path.basename"
] | [((270, 295), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (285, 295), False, 'import os\n'), ((355, 380), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (370, 380), False, 'import os\n'), ((473, 484), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (482, 484), False,... |
#!/usr/bin/env python2
import sys
import os
import random
import msgpack # requires msgpack-python
samples = [
-1,
15441,
99999999999,
"43110",
192168,
['aaaaaaa', 'bbbbbbb', os.urandom(30), 12345678, 11111111111, {123: "4567890"}],
"[sjfdkjsdalfksjdlfsafl]",
"",
0,
1,
["th... | [
"os.urandom",
"random.SystemRandom",
"msgpack.packb"
] | [((2322, 2341), 'msgpack.packb', 'msgpack.packb', (['item'], {}), '(item)\n', (2335, 2341), False, 'import msgpack\n'), ((201, 215), 'os.urandom', 'os.urandom', (['(30)'], {}), '(30)\n', (211, 215), False, 'import os\n'), ((1445, 1459), 'os.urandom', 'os.urandom', (['(64)'], {}), '(64)\n', (1455, 1459), False, 'import ... |
from ze_mailer.app.core.messages import Info
import re
class UtilitiesMixin:
"""A mixin used to extend classes with various definitions on
repetitive tasks on names such as normalizing them etc.
"""
@staticmethod
def check_name_structure(name):
"""Check the structure of a name. Sometimes, ... | [
"re.match",
"ze_mailer.app.core.messages.Info"
] | [((454, 487), 're.match', 're.match', (['"""^(?:\\\\w+\\\\s?)+$"""', 'name'], {}), "('^(?:\\\\w+\\\\s?)+$', name)\n", (462, 487), False, 'import re\n'), ((507, 535), 're.match', 're.match', (['"""^(?:\\\\w+)$"""', 'name'], {}), "('^(?:\\\\w+)$', name)\n", (515, 535), False, 'import re\n'), ((3764, 3843), 'ze_mailer.app... |
"""
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... | [
"subprocess.Popen",
"mpp.lib.PSQL.PSQL.run_sql_command",
"mpp.gpdb.tests.storage.walrepl.lib.polling",
"mpp.gpdb.tests.storage.walrepl.lib.PgControlData",
"gppylib.commands.base.Command"
] | [((1853, 1901), 'mpp.lib.PSQL.PSQL.run_sql_command', 'PSQL.run_sql_command', (['"""DROP TABLE IF EXISTS foo"""'], {}), "('DROP TABLE IF EXISTS foo')\n", (1873, 1901), False, 'from mpp.lib.PSQL import PSQL\n'), ((3089, 3137), 'mpp.lib.PSQL.PSQL.run_sql_command', 'PSQL.run_sql_command', (['"""DROP TABLE IF EXISTS foo"""'... |
from django import template
from django.utils.safestring import mark_safe
from datetime import datetime
import re
from basic.blog.models import Post
import urllib2
register = template.Library()
@register.filter
def order_by(queryset, args):
'''
Orders a queryset
Arguments:
queryset
... | [
"django.template.Library",
"re.split",
"django.core.urlresolvers.reverse",
"random.choice",
"django.utils.safestring.mark_safe",
"re.match",
"datetime.date.today",
"datetime.timedelta",
"datetime.datetime.now",
"re.compile"
] | [((179, 197), 'django.template.Library', 'template.Library', ([], {}), '()\n', (195, 197), False, 'from django import template\n'), ((2630, 2646), 'django.utils.safestring.mark_safe', 'mark_safe', (['value'], {}), '(value)\n', (2639, 2646), False, 'from django.utils.safestring import mark_safe\n'), ((2064, 2113), 're.c... |
import re
import cattr
from django.utils import timezone
from django.utils.http import parse_http_date
from httpsig import HeaderVerifier
from rest_framework.permissions import BasePermission
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import exceptions, au... | [
"rest_framework.exceptions.AuthenticationFailed",
"django.utils.timezone.now",
"sqlalchemy.select",
"cattr.unstructure",
"rest_framework.exceptions.PermissionDenied",
"variants.models.Case.sa.project_id.in_",
"rest_framework.response.Response",
"httpsig.HeaderVerifier",
"variants.helpers.get_engine"... | [((1257, 1288), 're.compile', 're.compile', (['"""signature="(.+?)\\""""'], {}), '(\'signature="(.+?)"\')\n', (1267, 1288), False, 'import re\n'), ((1306, 1352), 're.compile', 're.compile', (['"""headers="([\\\\(\\\\)\\\\sa-z0-9-]+?)\\""""'], {}), '(\'headers="([\\\\(\\\\)\\\\sa-z0-9-]+?)"\')\n', (1316, 1352), False, '... |
##############################################################################
#
# Library: TubeTK
#
# Copyright 2010 Kitware Inc. 28 Corporate Drive,
# Clifton Park, NY, 12065, USA.
#
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in comp... | [
"cv2.cv.CreateImageHeader",
"cv2.cv.Smooth",
"cv2.cv.GetSize",
"cv2.cv.AdaptiveThreshold"
] | [((2401, 2450), 'cv2.cv.CreateImageHeader', 'cv.CreateImageHeader', (['pi.size', 'cv.IPL_DEPTH_8U', '(1)'], {}), '(pi.size, cv.IPL_DEPTH_8U, 1)\n', (2421, 2450), True, 'import cv2.cv as cv\n'), ((2754, 2828), 'cv2.cv.Smooth', 'cv.Smooth', (['inputImage', 'outputImage', 'cv.CV_GAUSSIAN', 'filterSize', 'filterSize'], {})... |
import logging.handlers
from pythonjsonlogger import jsonlogger
import datetime
import socket
class JsonFormatter(jsonlogger.JsonFormatter, object):
def __init__(self,
fmt="%(asctime) %(name) %(processName) %(filename) %(funcName) %(levelname) %(lineno) %(module) %(threadName) %(message)",
... | [
"pythonjsonlogger.jsonlogger.JsonFormatter.__init__",
"datetime.datetime.utcnow"
] | [((445, 532), 'pythonjsonlogger.jsonlogger.JsonFormatter.__init__', 'jsonlogger.JsonFormatter.__init__', (['self', '*args'], {'fmt': 'fmt', 'datefmt': 'datefmt'}), '(self, *args, fmt=fmt, datefmt=datefmt, **\n kwargs)\n', (478, 532), False, 'from pythonjsonlogger import jsonlogger\n'), ((769, 795), 'datetime.datetim... |
"""Code snippets vol-49-snippet-243
Remove all empty folders in a directory.
Download all snippets so far:
https://wp.me/Pa5TU8-1yg
Blog: stevepython.wordpress.com
requirements:None
https://gist.github.com/brentvollebregt/04ea53f3761667b4ff39e6f2caf5a5d9
"""
import errno
import os
# Enter required folder to che... | [
"os.rmdir",
"os.walk",
"os.path.join"
] | [((443, 492), 'os.walk', 'os.walk', (['folder_to_scan_and_delete'], {'topdown': '(False)'}), '(folder_to_scan_and_delete, topdown=False)\n', (450, 492), False, 'import os\n'), ((536, 560), 'os.path.join', 'os.path.join', (['root', 'name'], {}), '(root, name)\n', (548, 560), False, 'import os\n'), ((586, 605), 'os.rmdir... |
# Copyright (c) 2015 - 2021, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and... | [
"os.path.abspath",
"os.path.isfile",
"os.path.join",
"math.sqrt"
] | [((3235, 3296), 'os.path.join', 'os.path.join', (['benchmark_dir', '"""hpl-2.3/bin/Linux_Intel64/xhpl"""'], {}), "(benchmark_dir, 'hpl-2.3/bin/Linux_Intel64/xhpl')\n", (3247, 3296), False, 'import os\n'), ((4261, 4298), 'os.path.join', 'os.path.join', (["(output_dir + '/HPL.dat')"], {}), "(output_dir + '/HPL.dat')\n", ... |
# <NAME>
# CPSC 386 FALL 2016
# Project 5 (Final Project)
# <EMAIL>
# Armada.py is a top-down space shooter game made using Python 3.4 and Pygame 1.9.
import sys, random, time, pygame
from pygame.locals import *
# Colors
WHITE = (255, 255, 255)
BLACK = (0, 0, 0 )
RED = (255, 0, 0 )
GREEN = (0, 255, 0 ... | [
"pygame.mouse.set_visible",
"pygame.event.get",
"pygame.Rect",
"pygame.display.update",
"random.randint",
"pygame.font.SysFont",
"pygame.display.set_mode",
"pygame.mixer.music.play",
"pygame.transform.scale",
"pygame.mixer.Sound",
"pygame.quit",
"pygame.Surface",
"pygame.init",
"pygame.ima... | [((472, 493), 'random.randint', 'random.randint', (['(5)', '(10)'], {}), '(5, 10)\n', (486, 493), False, 'import sys, random, time, pygame\n'), ((1176, 1212), 'pygame.image.load', 'pygame.image.load', (['"""player_ship.png"""'], {}), "('player_ship.png')\n", (1193, 1212), False, 'import sys, random, time, pygame\n'), (... |
import os
import pytest
from nixui.options import parser
SAMPLES_PATH = 'tests/sample'
@pytest.mark.datafiles(SAMPLES_PATH)
def test_get_all_option_values():
assert parser.get_all_option_values(
os.path.abspath(os.path.join(SAMPLES_PATH, 'configuration.nix'))
)
@pytest.mark.datafiles(SAMPLES_PATH)... | [
"nixui.options.parser.get_all_option_values",
"os.path.join",
"pytest.mark.datafiles"
] | [((92, 127), 'pytest.mark.datafiles', 'pytest.mark.datafiles', (['SAMPLES_PATH'], {}), '(SAMPLES_PATH)\n', (113, 127), False, 'import pytest\n'), ((285, 320), 'pytest.mark.datafiles', 'pytest.mark.datafiles', (['SAMPLES_PATH'], {}), '(SAMPLES_PATH)\n', (306, 320), False, 'import pytest\n'), ((408, 455), 'os.path.join',... |
import datetime
import re
from urllib import parse
import requests
from bs4 import BeautifulSoup
URL_CALENDAR = "https://innherredrenovasjon.no/tommeplan/{premise_id}/kalender/"
URL_ADDRESS_SEARCH = "https://innherredrenovasjon.no/wp-json/ir/v1/addresses/{}"
DEFAULT_HEADERS = {
"User-Agent": "Mozilla/5.0 (X11; Ub... | [
"bs4.BeautifulSoup",
"urllib.parse.quote",
"datetime.datetime.strptime",
"datetime.datetime.today"
] | [((795, 841), 'bs4.BeautifulSoup', 'BeautifulSoup', (['response.content', '"""html.parser"""'], {}), "(response.content, 'html.parser')\n", (808, 841), False, 'from bs4 import BeautifulSoup\n'), ((1224, 1299), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (['f"""{year}-{datestr[1]}-{datestr[0]}"""', '"""%... |
from collections import OrderedDict
import pkg_resources
from gitgud.levels.util import BasicChallenge
all_challenges = OrderedDict()
all_challenges['committing'] = BasicChallenge('committing', pkg_resources.resource_filename(__name__, '_committing/'))
all_challenges['branching'] = BasicChallenge('branching', pkg_re... | [
"collections.OrderedDict",
"pkg_resources.resource_filename"
] | [((123, 136), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (134, 136), False, 'from collections import OrderedDict\n'), ((197, 254), 'pkg_resources.resource_filename', 'pkg_resources.resource_filename', (['__name__', '"""_committing/"""'], {}), "(__name__, '_committing/')\n", (228, 254), False, 'import p... |
import re
import types
import logging
from banal import ensure_list
from normality import stringify
from balkhash.utils import safe_fragment
from email.utils import parsedate_to_datetime, getaddresses
from normality import safe_filename, ascii_text
from followthemoney.types import registry
from ingestors.support.html ... | [
"balkhash.utils.safe_fragment",
"followthemoney.types.registry.email.validate",
"normality.stringify",
"normality.ascii_text",
"email.utils.parsedate_to_datetime",
"banal.ensure_list",
"email.utils.getaddresses",
"normality.safe_filename",
"logging.getLogger",
"re.compile"
] | [((446, 473), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (463, 473), False, 'import logging\n'), ((1852, 1875), 're.compile', 're.compile', (['"""<([^>]*)>"""'], {}), "('<([^>]*)>')\n", (1862, 1875), False, 'import re\n'), ((622, 637), 'normality.stringify', 'stringify', (['name'], {}... |
"""useful utility methods"""
import os
import json
import envoy
import shutil
import unittest
from pymongo import MongoClient
from dlkit.runtime import RUNTIME, PROXY_SESSION
from dlkit.runtime.primordium import Id, DataInputStream, Type
from dlkit.runtime.proxy_example import SimpleRequest
from dlkit.records.registr... | [
"pymongo.MongoClient",
"dlkit.runtime.primordium.DataInputStream",
"os.path.abspath",
"json.loads",
"os.makedirs",
"os.path.isdir",
"dlkit.runtime.PROXY_SESSION.get_proxy",
"dlkit.runtime.primordium.Type",
"envoy.run",
"dlkit.runtime.primordium.Id",
"dlkit.runtime.RUNTIME.get_service_manager",
... | [((499, 557), 'dlkit.runtime.primordium.Type', 'Type', ([], {}), "(**ASSESSMENT_RECORD_TYPES['simple-child-sequencing'])\n", (503, 557), False, 'from dlkit.runtime.primordium import Id, DataInputStream, Type\n'), ((706, 752), 'os.path.join', 'os.path.join', (['ABS_PATH', '"""../../test_datastore"""'], {}), "(ABS_PATH, ... |
r"""
Ring `\ZZ/n\ZZ` of integers modulo `n`
EXAMPLES::
sage: R = Integers(97)
sage: a = R(5)
sage: a**100000000000000000000000000000000000000000000000000000000000000
61
This example illustrates the relation between
`\ZZ/p\ZZ` and `\GF{p}`. In
particular, there is a canonical map to `\GF{p}`, but not ... | [
"sage.misc.mrange.cartesian_product_iterator",
"sage.rings.fast_arith.arith_llong",
"sage.categories.finite_enumerated_sets.FiniteEnumeratedSets",
"sage.categories.commutative_rings.CommutativeRings",
"sage.rings.ring.CommutativeRing.random_element",
"sage.rings.integer_ring.IntegerRing",
"sage.rings.ri... | [((8479, 8505), 'sage.rings.integer_ring.IntegerRing', 'integer_ring.IntegerRing', ([], {}), '()\n', (8503, 8505), True, 'import sage.rings.integer_ring as integer_ring\n'), ((49997, 50108), 'sage.misc.persist.register_unpickle_override', 'register_unpickle_override', (['"""sage.rings.integer_mod_ring"""', '"""IntegerM... |
# Copyright 2017 The TensorFlow 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 required by applica... | [
"tensorflow.python.platform.test.main",
"tensorflow.python.frozen_keras.utils.conv_utils.convert_data_format",
"tensorflow.python.frozen_keras.utils.conv_utils.normalize_data_format",
"tensorflow.python.frozen_keras.utils.conv_utils.conv_input_length",
"numpy.zeros",
"numpy.ones",
"absl.testing.paramete... | [((5908, 5946), 'absl.testing.parameterized.parameters', 'parameterized.parameters', (['input_shapes'], {}), '(input_shapes)\n', (5932, 5946), False, 'from absl.testing import parameterized\n'), ((10756, 10767), 'tensorflow.python.platform.test.main', 'test.main', ([], {}), '()\n', (10765, 10767), False, 'from tensorfl... |
import json
from pprint import *
import guiLib
from guiLib import *
class CSGOParser:
"""
A class that parses CS:GO JSON item/loot dumps.
"""
dictionary = None
rarities = None
jitems = None
items = []
verbose = False
def __init__(self, filepath: str, verbose=False):
"""
... | [
"json.load"
] | [((5722, 5737), 'json.load', 'json.load', (['file'], {}), '(file)\n', (5731, 5737), False, 'import json\n')] |
# From ParaView email list. (TODO: Find link.)
# See also
# https://discourse.paraview.org/t/run-paraview-in-pyqt5-widget-python/8243/2
# https://discourse.paraview.org/t/dynamic-paraview-plugins-using-python/1793
# https://public.kitware.com/pipermail/paraview-developers/2012-April/001491.html
# https://markmail.... | [
"vtkmodules.vtkCommonDataModel.vtkPolyData.GetData",
"PyQt5.QtWidgets.QVBoxLayout",
"PyQt5.QtWidgets.QPushButton",
"vtkmodules.vtkCommonDataModel.vtkDataSet.GetData"
] | [((757, 784), 'PyQt5.QtWidgets.QVBoxLayout', 'QtWidgets.QVBoxLayout', (['self'], {}), '(self)\n', (778, 784), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((800, 835), 'PyQt5.QtWidgets.QPushButton', 'QtWidgets.QPushButton', (['"""Quit"""', 'self'], {}), "('Quit', self)\n", (821, 835), False, 'from PyQt5 impo... |
import os
import math
import wandb
import tensorflow as tf
from absl import app, flags, logging
from configs.default import get_default_config
from model import X3D
import dataloader
import utils
flags.DEFINE_string('config', None,
'(Relative) path to config (.yaml) file.')
flags.DEFINE_string('train... | [
"tensorflow.random.set_seed",
"absl.logging.info",
"tensorflow.io.gfile.makedirs",
"tensorflow.train.latest_checkpoint",
"tensorflow.io.gfile.isdir",
"absl.logging.set_verbosity",
"dataloader.InputReader",
"absl.flags.mark_flags_as_required",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
... | [((209, 287), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""config"""', 'None', '"""(Relative) path to config (.yaml) file."""'], {}), "('config', None, '(Relative) path to config (.yaml) file.')\n", (228, 287), False, 'from absl import app, flags, logging\n'), ((294, 437), 'absl.flags.DEFINE_string', 'flags... |
# Modulo VMUI
# Direitos reservados por <NAME> e <NAME>
#
# Programa responsável por mostrar o arquivo gerado pelo compilador, mostrar os valores da pilha e os valores.
#
# Este módulo é responsável por criar a interface da máquina virtual e ler o arquivo gerado pelo compilador.
#
#
# ... | [
"tkinter.filedialog.askopenfilename",
"MaquinaVirtual.Exec.Exec.exec2",
"MaquinaVirtual.Exec.Exec.exec",
"tkinter.ttk.Treeview"
] | [((1032, 1159), 'tkinter.ttk.Treeview', 'ttk.Treeview', (['frametv'], {'columns': "('Linha', 'Instrução', 'Atributo 1', 'Atributo 2', 'Comentário')", 'show': '"""headings"""', 'height': '(20)'}), "(frametv, columns=('Linha', 'Instrução', 'Atributo 1',\n 'Atributo 2', 'Comentário'), show='headings', height=20)\n", (1... |
# Natural Language Toolkit: Semantic Interpretation
#
# Author: <NAME> <<EMAIL>>
#
# Copyright (C) 2001-2022 NLTK Project
# URL: <https://www.nltk.org/>
# For license information, see LICENSE.TXT
from nltk.sem.logic import (
AllExpression,
AndExpression,
ApplicationExpression,
EqualityExpression,
E... | [
"nltk.sem.logic.unique_variable",
"nltk.sem.logic.skolem_function"
] | [((1062, 1100), 'nltk.sem.logic.unique_variable', 'unique_variable', ([], {'ignore': 'used_variables'}), '(ignore=used_variables)\n', (1077, 1100), False, 'from nltk.sem.logic import AllExpression, AndExpression, ApplicationExpression, EqualityExpression, ExistsExpression, IffExpression, ImpExpression, NegatedExpressio... |
import numpy as np
from numpy.testing import *
from supreme.register.radial_sum import radial_sum
def test_basic():
x = np.array([[1, 0, 2],
[0, 5, 0],
[3, 0, 4]], dtype=np.double)
R = radial_sum(x)
pi = np.pi
assert_array_equal(R[[135, 45, 225, 315]], [1, 2, 3, 4])... | [
"supreme.register.radial_sum.radial_sum",
"numpy.array"
] | [((126, 186), 'numpy.array', 'np.array', (['[[1, 0, 2], [0, 5, 0], [3, 0, 4]]'], {'dtype': 'np.double'}), '([[1, 0, 2], [0, 5, 0], [3, 0, 4]], dtype=np.double)\n', (134, 186), True, 'import numpy as np\n'), ((231, 244), 'supreme.register.radial_sum.radial_sum', 'radial_sum', (['x'], {}), '(x)\n', (241, 244), False, 'fr... |
import logging
from typing import List
from dispatch.config import DISPATCH_HELP_EMAIL, INCIDENT_RESPONSE_TEAM_EMAIL
from dispatch.database.core import SessionLocal
from dispatch.messaging.strings import (
INCIDENT_FEEDBACK_DAILY_REPORT,
MessageType,
)
from dispatch.plugin import service as plugin_service
fro... | [
"dispatch.plugin.service.get_active_instance",
"logging.getLogger"
] | [((354, 381), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (371, 381), False, 'import logging\n'), ((645, 751), 'dispatch.plugin.service.get_active_instance', 'plugin_service.get_active_instance', ([], {'db_session': 'db_session', 'project_id': 'project_id', 'plugin_type': '"""email"""'... |
# Insert Location Types and Group Roles into DB
from django.db import migrations
class Migration(migrations.Migration):
# Migration script to insert default metadata dependencies for Projects, Datasets, Files and Folders
dependencies = [
('api', '0018_add_hubzero_locationtype'),
]
operation... | [
"django.db.migrations.RunSQL"
] | [((354, 482), 'django.db.migrations.RunSQL', 'migrations.RunSQL', (['"""UPDATE rdm_research_groups set name = \'Radiam\' where id = \'cb03b55d-873f-4a0e-8208-07f960fa5032\';"""'], {}), '(\n "UPDATE rdm_research_groups set name = \'Radiam\' where id = \'cb03b55d-873f-4a0e-8208-07f960fa5032\';"\n )\n', (371, 482), ... |
# --------------
# import the libraries
import numpy as np
import pandas as pd
import seaborn as sns
from sklearn.model_selection import train_test_split
import warnings
warnings.filterwarnings('ignore')
# Code starts here
df = pd.read_csv(path)
print(df.head())
X = df.drop('insuranceclaim',axis=1)
y = df['insurance... | [
"sklearn.model_selection.GridSearchCV",
"sklearn.metrics.roc_curve",
"warnings.filterwarnings",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.boxplot",
"sklearn.metrics.accuracy_score",
"matplotlib.pyplot.plot",
"sklearn.metrics.roc_auc_score",
"sklearn.linear_m... | [((170, 203), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (193, 203), False, 'import warnings\n'), ((230, 247), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (241, 247), True, 'import pandas as pd\n'), ((361, 414), 'sklearn.model_selection.train_test_spl... |
def num_beats_test(threshold=0.7, voltage_array=None):
"""returns number_beats
This function calculates the number of beats in each strip.
The function requires the peakutils package to determine the indexes
of every peak/beat in the voltage array. The second line in the function
calculates the n... | [
"logging.info",
"peakutils.indexes",
"logging.config.fileConfig"
] | [((650, 728), 'logging.config.fileConfig', 'logging.config.fileConfig', (['"""logger_config.ini"""'], {'disable_existing_loggers': '(False)'}), "('logger_config.ini', disable_existing_loggers=False)\n", (675, 728), False, 'import logging\n'), ((744, 793), 'peakutils.indexes', 'peakutils.indexes', (['voltage_array'], {'... |
from tqdm import tqdm
import json
SYMBOLS = {'(':'#bracket','&':"#amp","%": "#Percnt", "*":"#Ast", ":": "#Colon", "…": "#Period3", ",":"#Comma", "—":"#Dash","/":"#Slash",";":'#Semicolon'}
def load_mrp(mrp):
raw_mrp = json.loads(mrp)
nodes = raw_mrp["nodes"]
if len(nodes) < 3:
return False
dep... | [
"tqdm.tqdm",
"json.loads"
] | [((224, 239), 'json.loads', 'json.loads', (['mrp'], {}), '(mrp)\n', (234, 239), False, 'import json\n'), ((4712, 4727), 'tqdm.tqdm', 'tqdm', (['mrp_lines'], {}), '(mrp_lines)\n', (4716, 4727), False, 'from tqdm import tqdm\n')] |
from pathlib import Path
import base64
with (Path(__file__).parent / 'icon.png').open('rb') as f:
MAINICON = base64.b64encode(f.read()) | [
"pathlib.Path"
] | [((47, 61), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (51, 61), False, 'from pathlib import Path\n')] |
# Generated by Django 3.1.6 on 2021-04-18 00:58
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('groovesweeperapp', '0002_auto_20210417_2331'),
]
operations = [
migrations.AlterModelManagers(
name='songmodel',
managers=[
... | [
"django.db.migrations.AlterModelManagers"
] | [((236, 296), 'django.db.migrations.AlterModelManagers', 'migrations.AlterModelManagers', ([], {'name': '"""songmodel"""', 'managers': '[]'}), "(name='songmodel', managers=[])\n", (265, 296), False, 'from django.db import migrations\n')] |
"""
Django settings for CrossTab project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
i... | [
"os.path.dirname",
"os.path.join"
] | [((2805, 2836), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""media"""'], {}), "(BASE_DIR, 'media')\n", (2817, 2836), False, 'import os\n'), ((356, 381), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (371, 381), False, 'import os\n'), ((2298, 2334), 'os.path.join', 'os.path.join', (['BAS... |
import os
from dotenv import load_dotenv
# Initialize environment variables
load_dotenv('.env')
PATH_TO_ORCA = os.environ.get('PATH_TO_ORCA')
SPREADSHEET_ID = os.environ.get('SPREADSHEET_ID')
LIST_OF_BENCHS = ['geek_bench4', 'sling_shot_extreme', 'antutu7',
'battery_test']
GOOGLE_CREDENTIAL_FILE =... | [
"dotenv.load_dotenv",
"os.environ.get"
] | [((78, 97), 'dotenv.load_dotenv', 'load_dotenv', (['""".env"""'], {}), "('.env')\n", (89, 97), False, 'from dotenv import load_dotenv\n'), ((115, 145), 'os.environ.get', 'os.environ.get', (['"""PATH_TO_ORCA"""'], {}), "('PATH_TO_ORCA')\n", (129, 145), False, 'import os\n'), ((163, 195), 'os.environ.get', 'os.environ.ge... |
#!/usr/bin/env python3
""" Launch and organize servers for the python tests. """
import logging
import os
import shutil
import subprocess
import threading
import queue
import psutil
# ### Private constants
_KIVALOO_TEST_DIR = "/tmp/kivaloo-test/"
# - this is relative to TEST_DIR
# - this may be subjected to rm -rf... | [
"threading.Thread",
"subprocess.Popen",
"psutil.process_iter",
"os.mkdir",
"os.remove",
"psutil.Process",
"os.path.exists",
"logging.info",
"shutil.rmtree",
"os.path.join",
"queue.Queue"
] | [((510, 561), 'os.path.join', 'os.path.join', (['_KIVALOO_TEST_DIR', '"""kivaloo-lbs-sock"""'], {}), "(_KIVALOO_TEST_DIR, 'kivaloo-lbs-sock')\n", (522, 561), False, 'import os\n'), ((575, 628), 'os.path.join', 'os.path.join', (['_KIVALOO_TEST_DIR', '"""kivaloo-kvlds-sock"""'], {}), "(_KIVALOO_TEST_DIR, 'kivaloo-kvlds-s... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-06-12 11:19
from __future__ import unicode_literals
import bluebottle.utils.fields
from decimal import Decimal
from django.db import migrations, models
import django.db.models.deletion
import djmoney.models.fields
class Migration(migrations.Migration):
... | [
"django.db.models.ForeignKey",
"django.db.migrations.AlterModelOptions"
] | [((422, 586), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""reward"""', 'options': "{'ordering': ['-activity__created', 'amount'], 'verbose_name': 'Gift',\n 'verbose_name_plural': 'Gifts'}"}), "(name='reward', options={'ordering': [\n '-activity__created', 'amount'], ... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | [
"msrest.Serializer",
"msrest.Deserializer"
] | [((1054, 1079), 'msrest.Serializer', 'Serializer', (['client_models'], {}), '(client_models)\n', (1064, 1079), False, 'from msrest import Serializer, Deserializer\n'), ((1108, 1135), 'msrest.Deserializer', 'Deserializer', (['client_models'], {}), '(client_models)\n', (1120, 1135), False, 'from msrest import Serializer,... |
from __future__ import print_function, unicode_literals
import errno
import os
import posixpath
import re
import sys
import shutil
from abc import ABCMeta, abstractmethod
try:
from urlparse import urljoin
except ImportError:
from urllib.parse import urljoin
import requests
from flask import safe_join
from .c... | [
"urllib.parse.urljoin",
"os.makedirs",
"flask.safe_join",
"os.path.exists",
"posixpath.join",
"re.findall",
"requests.get",
"posixpath.basename",
"shutil.rmtree",
"os.listdir"
] | [((1411, 1434), 'posixpath.basename', 'posixpath.basename', (['url'], {}), '(url)\n', (1429, 1434), False, 'import posixpath\n'), ((2458, 2489), 'requests.get', 'requests.get', (['STYLE_URLS_SOURCE'], {}), '(STYLE_URLS_SOURCE)\n', (2470, 2489), False, 'import requests\n'), ((1132, 1163), 'os.path.exists', 'os.path.exis... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from botbuilder.core import MessageFactory, TurnContext
from botbuilder.schema import ChannelAccount
from .dialog_bot import DialogBot
class RichCardsBot(DialogBot):
"""
RichCardsBot prompts a user to select a Rich ... | [
"botbuilder.core.MessageFactory.text"
] | [((773, 924), 'botbuilder.core.MessageFactory.text', 'MessageFactory.text', (["('Welcome to CardBot. ' +\n 'This bot will show you different types of Rich Cards. ' +\n 'Please type anything to get started.')"], {}), "('Welcome to CardBot. ' +\n 'This bot will show you different types of Rich Cards. ' +\n 'P... |
"""
xml - utilities for XML parsing
===============================
This module is not intended for end users. It implements the abstract classes
for all XML parsers, :py:class:`XML` and :py:class:`IndexedXML`, and some utility functions.
Dependencies
------------
This module requres :py:mod:`lxml` and :py:mod:`nump... | [
"urllib.request.urlopen",
"lxml.etree.XPath",
"re.match",
"lxml.etree.XMLParser",
"lxml.etree.iterparse",
"collections.namedtuple",
"itertools.islice",
"traceback.format_exc",
"lxml.etree.parse",
"warnings.warn",
"re.sub",
"collections.OrderedDict",
"re.compile"
] | [((6292, 6341), 'collections.namedtuple', 'namedtuple', (['"""XMLParam"""', "('name', 'value', 'type')"], {}), "('XMLParam', ('name', 'value', 'type'))\n", (6302, 6341), False, 'from collections import OrderedDict, namedtuple\n'), ((26140, 26168), 're.compile', 're.compile', (['"""([\\\\w/*]*)(.*)"""'], {}), "('([\\\\w... |
from __future__ import print_function
import torch.nn.init as init
import argparse
import time
import os
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.utils.data
from torch.autograd import Variable
import matplotlib.pyplot ... | [
"matplotlib.pyplot.title",
"numpy.random.seed",
"argparse.ArgumentParser",
"seaborn.kdeplot",
"matplotlib.pyplot.figure",
"torch.nn.BCELoss",
"random.randint",
"matplotlib.pyplot.close",
"torch.load",
"matplotlib.pyplot.yticks",
"torch.FloatTensor",
"torch.nn.init.orthogonal",
"time.clock",
... | [((365, 398), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (388, 398), False, 'import warnings\n'), ((558, 583), 'matplotlib.pyplot.switch_backend', 'plt.switch_backend', (['"""agg"""'], {}), "('agg')\n", (576, 583), True, 'import matplotlib.pyplot as plt\n'), ((594, 619... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import pulumi
import pulumi.runtime
class GetOrganizationResult(object):
"""
A collection of values returned by getOrganizatio... | [
"pulumi.runtime.invoke"
] | [((2633, 2721), 'pulumi.runtime.invoke', 'pulumi.runtime.invoke', (['"""gcp:organizations/getOrganization:getOrganization"""', '__args__'], {}), "('gcp:organizations/getOrganization:getOrganization',\n __args__)\n", (2654, 2721), False, 'import pulumi\n')] |
#
# 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... | [
"airflow.providers.google.cloud.sensors.bigquery.BigQueryTablePartitionExistenceSensor",
"airflow.providers.google.cloud.operators.bigquery.BigQueryCreateEmptyDatasetOperator",
"os.environ.get",
"airflow.utils.dates.days_ago",
"airflow.providers.google.cloud.sensors.bigquery.BigQueryTableExistenceSensor",
... | [((1310, 1361), 'os.environ.get', 'os.environ.get', (['"""GCP_PROJECT_ID"""', '"""example-project"""'], {}), "('GCP_PROJECT_ID', 'example-project')\n", (1324, 1361), False, 'import os\n'), ((1377, 1444), 'os.environ.get', 'os.environ.get', (['"""GCP_BIGQUERY_DATASET_NAME"""', '"""test_sensors_dataset"""'], {}), "('GCP_... |
# Generated by Django 3.1a1 on 2020-07-07 07:56
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import strops.utils.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
('references', '0001_initial'),
migrat... | [
"django.db.migrations.swappable_dependency",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.JSONField",
"django.db.models.AutoField",
"django.db.models.DateTimeField"
] | [((314, 371), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (345, 371), False, 'from django.db import migrations, models\n'), ((505, 601), 'django.db.models.AutoField', 'models.AutoField', ([], {'help_text': '"""Primar... |
import functools
import datetime
def validate_id(func):
@functools.wraps(func)
def wrapper(_, id):
if type(id) != str:
raise TypeError(
f"\n Expecting an id type of string but got {type(id)}\n")
result = func(_, id)
return result
return wrapper
def va... | [
"datetime.datetime.strptime",
"functools.wraps"
] | [((63, 84), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (78, 84), False, 'import functools\n'), ((345, 366), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (360, 366), False, 'import functools\n'), ((981, 1002), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (... |
import os
import click
import tempfile
import shutil
import logging
import stitch_common as sc
@click.command()
@click.argument('root_dir')
def get_video_lengths(root_dir):
for root, subdirs, files in os.walk(root_dir):
logging.info('**** Processing folder: {}'.format(root))
mp4s = [fi for fi in fi... | [
"click.argument",
"logging.basicConfig",
"os.walk",
"click.command",
"logging.info",
"stitch_common.get_video_details"
] | [((97, 112), 'click.command', 'click.command', ([], {}), '()\n', (110, 112), False, 'import click\n'), ((114, 140), 'click.argument', 'click.argument', (['"""root_dir"""'], {}), "('root_dir')\n", (128, 140), False, 'import click\n'), ((206, 223), 'os.walk', 'os.walk', (['root_dir'], {}), '(root_dir)\n', (213, 223), Fal... |
# Copyright (c) 2020-2021, NVIDIA CORPORATION.
# 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... | [
"cudf.DataFrame",
"cugraph.Graph",
"cugraph.tests.utils.read_csv_file",
"time.time",
"cugraph.force_atlas2",
"pathlib.PurePath",
"pytest.mark.parametrize"
] | [((3164, 3218), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""graph_file, score"""', 'DATASETS'], {}), "('graph_file, score', DATASETS)\n", (3187, 3218), False, 'import pytest\n'), ((3220, 3271), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""max_iter"""', 'MAX_ITERATIONS'], {}), "('max_iter'... |
__author__ = 'katharine'
from gevent import monkey; monkey.patch_all()
from gevent import GreenletExit
import struct
import websocket
import STPyV8 as v8
from .exceptions import JSRuntimeException
from . import events
CloseEvent = lambda runtime, *args: v8.JSObject.create(runtime.context.locals.CloseEvent, args)
Mes... | [
"STPyV8.JSObject.create",
"websocket.create_connection",
"gevent.monkey.patch_all",
"struct.unpack_from"
] | [((53, 71), 'gevent.monkey.patch_all', 'monkey.patch_all', ([], {}), '()\n', (69, 71), False, 'from gevent import monkey\n'), ((257, 316), 'STPyV8.JSObject.create', 'v8.JSObject.create', (['runtime.context.locals.CloseEvent', 'args'], {}), '(runtime.context.locals.CloseEvent, args)\n', (275, 316), True, 'import STPyV8 ... |
"""add step_key pipeline_name
Revision ID: 3b1e175a2be3
Revises: 1<PASSWORD>
Create Date: 2020-03-31 11:01:42.609069
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.engine import reflection
# pylint: disable=no-member
# revision identifiers, used by Alembic.
revision = "3b1e175a2be3"
down_revisio... | [
"alembic.op.drop_column",
"sqlalchemy.engine.reflection.Inspector.from_engine",
"sqlalchemy.Column",
"alembic.op.get_context"
] | [((443, 481), 'sqlalchemy.engine.reflection.Inspector.from_engine', 'reflection.Inspector.from_engine', (['bind'], {}), '(bind)\n', (475, 481), False, 'from sqlalchemy.engine import reflection\n'), ((821, 859), 'sqlalchemy.engine.reflection.Inspector.from_engine', 'reflection.Inspector.from_engine', (['bind'], {}), '(b... |
"""
Copyright (c) 2020 Intel Corporation
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 writin... | [
"numpy.exp",
"nncf.registry.Registry",
"nncf.config.NNCFConfig",
"numpy.log"
] | [((772, 802), 'nncf.registry.Registry', 'Registry', (['"""pruning_schedulers"""'], {}), "('pruning_schedulers')\n", (780, 802), False, 'from nncf.registry import Registry\n'), ((997, 1009), 'nncf.config.NNCFConfig', 'NNCFConfig', ([], {}), '()\n', (1007, 1009), False, 'from nncf.config import NNCFConfig\n'), ((3807, 38... |