code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import requests
from tkinter import Checkbutton, Tk, filedialog, Message, Entry, StringVar, Text, Scrollbar, scrolledtext, LEFT, RIGHT, Y, END, W, SUNKEN, OUTSIDE
from tkinter import Button, Frame, IntVar, Radiobutton, Widget, OptionMenu, Scrollbar
from tkinter import messagebox
import json
import re
#from tkscro... | [
"tkinter.StringVar",
"functions.get_json",
"tkinter.Message",
"tkinter.Checkbutton",
"functions.convert_json",
"tkinter.Button",
"tkinter.Entry",
"functions.update_api",
"functions.build_API_config",
"functions.build_API",
"tkinter.IntVar",
"tkinter.messagebox.showerror",
"tkinter.scrolledte... | [((1065, 1076), 'tkinter.StringVar', 'StringVar', ([], {}), '()\n', (1074, 1076), False, 'from tkinter import Checkbutton, Tk, filedialog, Message, Entry, StringVar, Text, Scrollbar, scrolledtext, LEFT, RIGHT, Y, END, W, SUNKEN, OUTSIDE\n'), ((1219, 1266), 'tkinter.Message', 'Message', (['frame1'], {'text': '"""API Obj... |
from scipy.integrate import quad,dblquad
import numpy as np
from scipy.special import gamma
from scipy.special import gammainc
def poisson_integrand(tau, rho, beta, fm=1, K=1, alpha=2):
#lambda = beta*f(m)*rho*tau
L = np.array([(tau*beta*rho*fm)**k/gamma(k+1) for k in range(K)])
return (1-np.exp(-tau*beta*... | [
"matplotlib.pyplot.loglog",
"matplotlib.pyplot.show",
"numpy.sum",
"scipy.integrate.quad",
"numpy.logspace",
"matplotlib.pyplot.legend",
"scipy.special.gammainc",
"numpy.exp",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"scipy.special.gamma"
] | [((2512, 2535), 'numpy.logspace', 'np.logspace', (['(-3)', '(0)', '(100)'], {}), '(-3, 0, 100)\n', (2523, 2535), True, 'import numpy as np\n'), ((2945, 2957), 'matplotlib.pyplot.legend', 'plt.legend', ([], {}), '()\n', (2955, 2957), True, 'import matplotlib.pyplot as plt\n'), ((2962, 2983), 'matplotlib.pyplot.xlabel', ... |
import cherrypy
import GameZero
import os
import resources.infoprovider as infopro
from GameZero import db
from GameZero import search
from GameZero import tasks
from GameZero import update
from GameZero import functions
class site(object):
@cherrypy.expose
def index(self):
... | [
"GameZero.functions.createbutton",
"GameZero.db.insertSearchHistory",
"GameZero.db.getinfo",
"GameZero.db.wantedLIST",
"resources.infoprovider.thegamesdb.getgamelist",
"resources.infoprovider.thegamesdb.getgame",
"os.path.join"
] | [((954, 999), 'GameZero.db.getinfo', 'db.getinfo', (['GameZero.DATABASE_PATH', '"""Systems"""'], {}), "(GameZero.DATABASE_PATH, 'Systems')\n", (964, 999), False, 'from GameZero import db\n'), ((2054, 2093), 'resources.infoprovider.thegamesdb.getgamelist', 'infopro.thegamesdb.getgamelist', (['keyword'], {}), '(keyword)\... |
"""initial migration
Revision ID: d5f5ec8414a8
Revises:
Create Date: 2021-10-25 12:35:00.804329
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd5f5ec8414a8'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto ... | [
"alembic.op.drop_table",
"sqlalchemy.DateTime",
"sqlalchemy.PrimaryKeyConstraint",
"sqlalchemy.String",
"sqlalchemy.Integer"
] | [((1152, 1181), 'alembic.op.drop_table', 'op.drop_table', (['"""appointments"""'], {}), "('appointments')\n", (1165, 1181), False, 'from alembic import op\n'), ((992, 1021), 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""id"""'], {}), "('id')\n", (1015, 1021), True, 'import sqlalchemy as sa\n'), ((... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open("README.rst") as readme_file:
readme = readme_file.read()
with open("HISTORY.rst") as history_file:
history = history_file.read()
requirements = [
"click>=7.0.0",
"fsspec>=0.7... | [
"setuptools.find_packages"
] | [((1241, 1256), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (1254, 1256), False, 'from setuptools import setup, find_packages\n')] |
#!/usr/bin/env python3
import subprocess
import json
import sys
import os
script_dir = os.path.dirname(os.path.realpath(os.path.abspath(__file__)))
is_cxx = "++" in sys.argv[0]
def cc_exec(args):
if os.getenv("GCLANG_PATH"):
cc_name = os.environ["GCLANG_PATH"]
else:
cc_name = "gclang"
if... | [
"json.dump",
"subprocess.run",
"os.path.abspath",
"os.getenv"
] | [((207, 231), 'os.getenv', 'os.getenv', (['"""GCLANG_PATH"""'], {}), "('GCLANG_PATH')\n", (216, 231), False, 'import os\n'), ((531, 551), 'subprocess.run', 'subprocess.run', (['argv'], {}), '(argv)\n', (545, 551), False, 'import subprocess\n'), ((582, 605), 'os.getenv', 'os.getenv', (['"""GETBC_PATH"""'], {}), "('GETBC... |
# -*- coding: utf-8 -*-
# Python 3
# Copia arquivo se a data de modificacao for mais nova ou não existir outro arquivo no lugar.
import os
import sys
import shutil
class File(object):
def __init__(self, path):
self.path = os.path.join(*os.path.splitdrive(path))
self.mtime = os.stat(path).st_mtime... | [
"os.stat",
"shutil.copy2",
"os.path.splitdrive",
"sys.exit"
] | [((478, 489), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (486, 489), False, 'import sys\n'), ((631, 668), 'shutil.copy2', 'shutil.copy2', (['fileNew.path', 'dest.path'], {}), '(fileNew.path, dest.path)\n', (643, 668), False, 'import shutil\n'), ((740, 777), 'shutil.copy2', 'shutil.copy2', (['fileNew.path', 'dest.p... |
from os.path import join
from mayavi import mlab
input_file = join('/home/phil/Data', 'pcd_examples.pcd')
with open(input_file, 'r') as f:
data = f.read()
data1 = data.split('\n')
data = data1[11:] # skip the header
x = []
y = []
z = []
for i in data[:-1]:
temp = i.split(' ')
x.append(float(temp[0])... | [
"mayavi.mlab.show",
"os.path.join",
"mayavi.mlab.points3d"
] | [((65, 108), 'os.path.join', 'join', (['"""/home/phil/Data"""', '"""pcd_examples.pcd"""'], {}), "('/home/phil/Data', 'pcd_examples.pcd')\n", (69, 108), False, 'from os.path import join\n'), ((382, 418), 'mayavi.mlab.points3d', 'mlab.points3d', (['x', 'y', 'z'], {'mode': '"""point"""'}), "(x, y, z, mode='point')\n", (39... |
import base64
import telnetlib
import math
from enum import Enum
import re
import time
class RadioMicrohardpDDL1800:
#---------------------------------------------------------------------------
# Public types
#---------------------------------------------------------------------------
class Chann... | [
"re.findall",
"telnetlib.Telnet",
"time.sleep"
] | [((969, 987), 'telnetlib.Telnet', 'telnetlib.Telnet', ([], {}), '()\n', (985, 987), False, 'import telnetlib\n'), ((2004, 2018), 'time.sleep', 'time.sleep', (['(60)'], {}), '(60)\n', (2014, 2018), False, 'import time\n'), ((5637, 5674), 're.findall', 're.findall', (["'[\\n|\\r](\\\\d+)'", 'response'], {}), "('[\\n|\\r]... |
print(' \033[36;40mExercício Python #056 - Analisador completo\033[m')
print('')
# import
from time import sleep
# Grandezas
maior = 0
nameup = ''
m = 0
f = 0
n = 0
# Repetição
for c in range(1, 5):
print('-' * 5, end='{}ª Pessoa'.format(c))
print('-' * 5)
nome = str(input('Nome: '))
idade = int(input('... | [
"time.sleep"
] | [((670, 678), 'time.sleep', 'sleep', (['(1)'], {}), '(1)\n', (675, 678), False, 'from time import sleep\n'), ((703, 711), 'time.sleep', 'sleep', (['(1)'], {}), '(1)\n', (708, 711), False, 'from time import sleep\n'), ((843, 851), 'time.sleep', 'sleep', (['(1)'], {}), '(1)\n', (848, 851), False, 'from time import sleep\... |
# Generated by Django 3.2.9 on 2021-12-03 11:24
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('project_core', '0174_spi... | [
"django.db.models.ForeignKey",
"django.db.models.DateTimeField",
"django.db.migrations.swappable_dependency"
] | [((227, 284), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (258, 284), False, 'from django.db import migrations, models\n'), ((477, 565), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'blank': '(True... |
from django.views import generic
from django.urls import reverse_lazy
from .models import Textbook, Uhmarketplace, Courses
from django.utils import timezone
from .filters import TextbookFilter, CoursesFilter
from django.contrib.auth.models import User
from django.shortcuts import render, redirect
from django.urls.base ... | [
"django.urls.reverse_lazy",
"django.contrib.auth.models.User.objects.get"
] | [((1229, 1267), 'django.urls.reverse_lazy', 'reverse_lazy', (['"""uhmarketplace:textbook"""'], {}), "('uhmarketplace:textbook')\n", (1241, 1267), False, 'from django.urls import reverse_lazy\n'), ((1576, 1614), 'django.urls.reverse_lazy', 'reverse_lazy', (['"""uhmarketplace:textbook"""'], {}), "('uhmarketplace:textbook... |
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import status
from rest_framework.decorators import action
from rest_framework.generics import ListAPIView
from rest_framework.response import Response
from rest_framework.settings import api_settings
from rest_framework.viewsets import M... | [
"rest_framework.response.Response",
"rest_framework.decorators.action"
] | [((742, 779), 'rest_framework.decorators.action', 'action', ([], {'detail': '(True)', 'methods': "['post']"}), "(detail=True, methods=['post'])\n", (748, 779), False, 'from rest_framework.decorators import action\n'), ((1122, 1147), 'rest_framework.response.Response', 'Response', (['serializer.data'], {}), '(serializer... |
import sys
from datetime import datetime
def init_logging(path="process.log"):
logger = Logger(path=path)
sys.stdout = logger
return logger
class Logger(object):
"""Logger that writes all of stdout and stderr to the file passed in as `path`.
Known limitations:
- Doesn't log stderr in Jupyter... | [
"datetime.datetime.now"
] | [((664, 678), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (676, 678), False, 'from datetime import datetime\n')] |
import cv2
import numpy as np
import random
import argparse
import logging
import glog as log
import os
import sys
from stcgan.shadow6.nets import *
import stcgan.shadow6.module as module
import glob
import mxnet as mx
# import pydevd
# pydevd.settrace('172.17.122.65', port=10203, stdoutToServer=True, stderrToServer=... | [
"os.mkdir",
"numpy.abs",
"argparse.ArgumentParser",
"random.shuffle",
"glob.glob",
"mxnet.metric.CustomMetric",
"os.path.join",
"logging.FileHandler",
"random.randint",
"glog.info",
"cv2.imwrite",
"os.path.exists",
"numpy.transpose",
"mxnet.gpu",
"cv2.resize",
"mxnet.cpu",
"mxnet.nd.... | [((369, 429), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Shadow Removel Params"""'}), "(description='Shadow Removel Params')\n", (392, 429), False, 'import argparse\n'), ((1430, 1449), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (1447, 1449), False, 'import logging\n'... |
from django.contrib import admin
from .models import Setting
class SettingAdmin(admin.ModelAdmin):
list_display = ('site_title', 'last_update')
def has_add_permission(self, request):
count = Setting.objects.all().count()
if count == 0:
return True
return False
admin.site.reg... | [
"django.contrib.admin.site.register"
] | [((306, 348), 'django.contrib.admin.site.register', 'admin.site.register', (['Setting', 'SettingAdmin'], {}), '(Setting, SettingAdmin)\n', (325, 348), False, 'from django.contrib import admin\n')] |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import unittest
if False:
from databp.core.dmo import BluepagesResultMapper
class CreateLanguageDictTest(unittest.TestCase):
tests = [
{
"original": {"OFFICE": "altERNatE"},
"expected": {'office': 'NA'}
... | [
"unittest.main",
"databp.core.dmo.BluepagesResultMapper"
] | [((837, 852), 'unittest.main', 'unittest.main', ([], {}), '()\n', (850, 852), False, 'import unittest\n'), ((687, 726), 'databp.core.dmo.BluepagesResultMapper', 'BluepagesResultMapper', (["test['original']"], {}), "(test['original'])\n", (708, 726), False, 'from databp.core.dmo import BluepagesResultMapper\n')] |
import tensorflow as tf
import tensorflow.keras.backend as K
import unittest
import pytest
from aleatoric_log_loss import AleatoricLogLoss
from aleatoric_reg_loss import AleatoricRegLoss
class LogLossTests(unittest.TestCase):
@pytest.fixture(autouse=True)
def init_params(self):
self.params = {
... | [
"aleatoric_log_loss.AleatoricLogLoss",
"tensorflow.keras.backend.random_normal",
"pytest.fixture",
"aleatoric_reg_loss.AleatoricRegLoss"
] | [((233, 261), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (247, 261), False, 'import pytest\n'), ((1331, 1359), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (1345, 1359), False, 'import pytest\n'), ((490, 532), 'aleatoric_log_loss.Aleatori... |
#!/usr/bin/env python3
import vapoursynth as vs
import audiocutter
from subprocess import call
import shutil
import os
core = vs.core
ts_in = r"F:\Convert\[BDMV][180926][Gundam Build Divers][BD-BOX1]\GUNDAM_BUILD_DIVERS_BDBOX1_D3\BDMV\STREAM\00011.m2ts"
src = core.lsmas.LWLibavSource(ts_in)
ac = audiocutter.AudioCut... | [
"audiocutter.AudioCutter"
] | [((300, 325), 'audiocutter.AudioCutter', 'audiocutter.AudioCutter', ([], {}), '()\n', (323, 325), False, 'import audiocutter\n')] |
from django.core.handlers.wsgi import WSGIRequest
from django.http import JsonResponse
from django.shortcuts import get_object_or_404
from django.urls import reverse
from django.views.generic import DetailView, ListView
from academic_helper.models import Course, floatformat
from academic_helper.utils.logger import log... | [
"academic_helper.models.Course.objects.filter",
"academic_helper.models.Course.objects.all",
"academic_helper.models.floatformat",
"django.http.JsonResponse",
"academic_helper.utils.logger.log.info",
"django.shortcuts.get_object_or_404",
"django.urls.reverse",
"academic_helper.models.Course.find_by"
] | [((1232, 1297), 'academic_helper.models.Course.objects.filter', 'Course.objects.filter', ([], {'course_number': "self.kwargs['course_number']"}), "(course_number=self.kwargs['course_number'])\n", (1253, 1297), False, 'from academic_helper.models import Course, floatformat\n'), ((1313, 1337), 'django.shortcuts.get_objec... |
# Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... | [
"netforce.database.get_connection",
"traceback.print_exc",
"json.loads",
"netforce.database.get_active_db",
"lxml.etree.fromstring",
"netforce.model.get_model",
"netforce.action.get_action",
"netforce.model.clear_cache",
"netforce.utils.set_data_path"
] | [((1975, 1991), 'netforce.database.get_connection', 'get_connection', ([], {}), '()\n', (1989, 1991), False, 'from netforce.database import get_connection, get_active_db\n'), ((1840, 1867), 'netforce.utils.set_data_path', 'set_data_path', (['res', 'path', 'v'], {}), '(res, path, v)\n', (1853, 1867), False, 'from netfor... |
"""Module with various custom loss ops."""
import tensorflow as tf
def smooth_l1_loss(predicted: tf.Tensor, expected: tf.Tensor) -> tf.Tensor:
"""
Calculate piece-wise smooth L1 loss on the given tensors.
Reference: `Fast R-CNN <https://arxiv.org/pdf/1504.08083.pdf>`_
:param predicted: predicted val... | [
"tensorflow.less",
"tensorflow.abs",
"tensorflow.square"
] | [((485, 513), 'tensorflow.abs', 'tf.abs', (['(predicted - expected)'], {}), '(predicted - expected)\n', (491, 513), True, 'import tensorflow as tf\n'), ((534, 554), 'tensorflow.less', 'tf.less', (['abs_diff', '(1)'], {}), '(abs_diff, 1)\n', (541, 554), True, 'import tensorflow as tf\n'), ((562, 581), 'tensorflow.square... |
from setuptools import setup, find_packages
setup(name='segmentation-mibi',
version='0.2.3',
packages=find_packages(),
)
| [
"setuptools.find_packages"
] | [((114, 129), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (127, 129), False, 'from setuptools import setup, find_packages\n')] |
import os
import zlib
import math
import struct
import copy
import chromosome.gene as gene
import chromosome.serializer as serializer
import chromosome.deserializer as deserializer
PNG_SIGNATURE = '\x89\x50\x4e\x47\x0d\x0a\x1a\x0a'
class PNGGene(gene.AbstractGene):
'''
The PNGGene represent a png chunk.... | [
"copy.deepcopy",
"struct.pack",
"zlib.compress",
"os.path.isfile",
"zlib.decompress",
"zlib.crc32"
] | [((1823, 1851), 'struct.pack', 'struct.pack', (['""">I"""', 'self.name'], {}), "('>I', self.name)\n", (1834, 1851), False, 'import struct\n'), ((1907, 1934), 'struct.pack', 'struct.pack', (['""">I"""', 'self.crc'], {}), "('>I', self.crc)\n", (1918, 1934), False, 'import struct\n'), ((3727, 3747), 'copy.deepcopy', 'copy... |
"""
recreating the 'cat' command line
$ cat file.txt ---read the file
$ cat file.txt sometext.txt othertext.txt ---read from all the textfile
$ cat file.txt sometext.txt othertext.txt > newtext.txt ---reads all file and copy to newtext.txt
same as mine:
$ python cat.py file.txt ---read the fil... | [
"argparse.ArgumentParser"
] | [((587, 612), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (610, 612), False, 'import argparse\n')] |
from app import app
import os
if __name__ == "__main__":
app.jinja_env.auto_reload = True
app.config["TEMPLATES_AUTO_RELOAD"] = True
app.run(
debug=True,
port=int(os.environ.get("PORT", "3000")),
host="0.0.0.0"
)
| [
"os.environ.get"
] | [((192, 222), 'os.environ.get', 'os.environ.get', (['"""PORT"""', '"""3000"""'], {}), "('PORT', '3000')\n", (206, 222), False, 'import os\n')] |
import pyzbar.pyzbar as pyzbar
import cv2
import math
global image
class VideoCamera(object):
def __init__(self):
# Using OpenCV to capture from device 0. If you have trouble capturing
# from a webcam, comment the line below out and use a video file
# instead.
self.video ... | [
"cv2.line",
"math.sqrt",
"pyzbar.pyzbar.decode",
"cv2.VideoCapture",
"cv2.imencode"
] | [((322, 341), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(2)'], {}), '(2)\n', (338, 341), False, 'import cv2\n'), ((835, 861), 'cv2.imencode', 'cv2.imencode', (['""".jpg"""', 'imag'], {}), "('.jpg', imag)\n", (847, 861), False, 'import cv2\n'), ((1054, 1071), 'pyzbar.pyzbar.decode', 'pyzbar.decode', (['im'], {}), '(im)... |
# -*- coding: utf-8 -*-
from py4web.core import Fixture, HTTP
from py4web import request, response
from inspect import signature, _empty
import json
import pandas as pd
from io import BytesIO
def unjson(value):
try:
return json.loads(value)
except (json.decoder.JSONDecodeError, TypeError,):
ret... | [
"pandas.DataFrame",
"py4web.request.query.items",
"io.BytesIO",
"json.loads",
"py4web.request.json.items",
"py4web.request.urlparts.netloc.startswith",
"inspect.signature",
"py4web.core.HTTP",
"pandas.ExcelWriter"
] | [((236, 253), 'json.loads', 'json.loads', (['value'], {}), '(value)\n', (246, 253), False, 'import json\n'), ((508, 523), 'inspect.signature', 'signature', (['func'], {}), '(func)\n', (517, 523), False, 'from inspect import signature, _empty\n'), ((5923, 5932), 'io.BytesIO', 'BytesIO', ([], {}), '()\n', (5930, 5932), F... |
'''
SSD1619A EPD IC Framebuf-derived Display Driver for MicroPython
Written by <NAME> - github.com/T-Wilko
'''
from micropython import const
from machine import SPI, Pin
from time import sleep_ms
import ustruct, framebuf
DRIVER_CTRL = const(0x01)
GATE_SCAN_START = const(0x0F)
DATA_ENTRY_MODE ... | [
"time.sleep_ms",
"micropython.const",
"machine.Pin"
] | [((251, 259), 'micropython.const', 'const', (['(1)'], {}), '(1)\n', (256, 259), False, 'from micropython import const\n'), ((288, 297), 'micropython.const', 'const', (['(15)'], {}), '(15)\n', (293, 297), False, 'from micropython import const\n'), ((325, 334), 'micropython.const', 'const', (['(17)'], {}), '(17)\n', (330... |
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Position(models.Model):
"""
Model representing the position of player (e.g. Science Fiction, Non Fiction).
"""
name = models.CharField(max_length=200, help_text="Enter the position of player (e.g.... | [
"django.db.models.CharField",
"django.db.models.ForeignKey"
] | [((242, 375), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)', 'help_text': '"""Enter the position of player (e.g. Central Midfielder, Centarl Defender etc.)"""'}), "(max_length=200, help_text=\n 'Enter the position of player (e.g. Central Midfielder, Centarl Defender etc.)'\n )\n", ... |
from random import randint
from shutil import rmtree
from django.core.files.storage import default_storage
from .reference import ReferenceModel as rm
from .factories import SuperUserFactory, ProfileFactory, PostFactory, PostCommentsFactory
def make_objects(factor=1):
rm.COMMENT.objects.all().delete()
prin... | [
"django.core.files.storage.default_storage.path",
"django.core.files.storage.default_storage.listdir"
] | [((1666, 1699), 'django.core.files.storage.default_storage.listdir', 'default_storage.listdir', (['location'], {}), '(location)\n', (1689, 1699), False, 'from django.core.files.storage import default_storage\n'), ((1750, 1775), 'django.core.files.storage.default_storage.path', 'default_storage.path', (['dir'], {}), '(d... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-04-12 14:03
from __future__ import unicode_literals
from builtins import next
from builtins import str
import json
import logging
import os
import shutil
import tempfile
import zipfile
import fiona
from django.contrib.gis.geos import GEOSGeometry, MultiPol... | [
"django.db.migrations.RunPython",
"zipfile.ZipFile",
"fiona.open",
"json.dumps",
"builtins.next",
"tempfile.mkdtemp",
"django.contrib.gis.geos.MultiPolygon",
"shutil.rmtree",
"builtins.str",
"os.path.join",
"os.listdir",
"logging.getLogger"
] | [((369, 396), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (386, 396), False, 'import logging\n'), ((910, 928), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (926, 928), False, 'import tempfile\n'), ((953, 993), 'os.path.join', 'os.path.join', (['tmpdir', '"""neighborhood.zi... |
import sys,os,time,csv,getopt,cv2,argparse
import numpy, ctypes, array
import numpy as np
#import matplotlib as plt
from datetime import datetime
from ctypes import cdll, c_char_p
from skimage.transform import resize
from numpy.ctypeslib import ndpointer
from lime import lime_image
from skimage.segmentation import mark... | [
"skimage.segmentation.mark_boundaries",
"numpy.ctypeslib.ndpointer",
"argparse.ArgumentParser",
"ntpath.basename",
"numpy.frombuffer",
"numpy.empty",
"numpy.ascontiguousarray",
"ctypes.cdll.LoadLibrary",
"lime.lime_image.LimeImageExplainer",
"cv2.imread",
"skimage.transform.resize",
"ctypes.c_... | [((406, 482), 'ctypes.cdll.LoadLibrary', 'ctypes.cdll.LoadLibrary', (['"""/home/rajy/work/inceptionv4/build/libannmodule.so"""'], {}), "('/home/rajy/work/inceptionv4/build/libannmodule.so')\n", (429, 482), False, 'import numpy, ctypes, array\n'), ((609, 656), 'numpy.ctypeslib.ndpointer', 'ndpointer', (['ctypes.c_float'... |
from core.models import User
from django.db.models.functions import TruncDate
from django.db.models import Count
from reports.queries.registry import register_report
from security.constants import SECURITY_GROUPS_PUBLIC
def users_by_date():
"""
User registration count broken by date
"""
users = (
... | [
"django.db.models.Count",
"core.models.User.objects.filter",
"django.db.models.functions.TruncDate",
"reports.queries.registry.register_report"
] | [((1185, 1215), 'reports.queries.registry.register_report', 'register_report', (['users_by_date'], {}), '(users_by_date)\n', (1200, 1215), False, 'from reports.queries.registry import register_report\n'), ((1216, 1251), 'reports.queries.registry.register_report', 'register_report', (['total_public_users'], {}), '(total... |
from source.file import File
from source.udp import Udp
def open(url):
url = url.split('://', 1)
if len(url) == 1:
return File(url[0])
proto, src = url
if proto == 'file':
return File(src)
if proto == 'udp':
return Udp(src)
raise ValueError("Unsupported protocol or URL... | [
"source.file.File",
"source.udp.Udp"
] | [((141, 153), 'source.file.File', 'File', (['url[0]'], {}), '(url[0])\n', (145, 153), False, 'from source.file import File\n'), ((214, 223), 'source.file.File', 'File', (['src'], {}), '(src)\n', (218, 223), False, 'from source.file import File\n'), ((262, 270), 'source.udp.Udp', 'Udp', (['src'], {}), '(src)\n', (265, 2... |
# Lint as: python3
"""Request handler classes for the extensions."""
import base64
import json
import re
import tornado.gen as gen
import os
from collections import namedtuple
from notebook.base.handlers import APIHandler, app_log
from google.cloud import storage # used for connecting to GCS
from io import BytesIO, ... | [
"io.BytesIO",
"os.remove",
"os.makedirs",
"os.path.dirname",
"os.path.exists",
"re.match",
"base64.b64decode",
"json.dumps",
"google.cloud.storage.Client",
"os.path.normpath",
"re.sub"
] | [((640, 673), 're.sub', 're.sub', (["('^' + path)", '""""""', 'blob.name'], {}), "('^' + path, '', blob.name)\n", (646, 673), False, 'import re\n'), ((790, 817), 're.match', 're.match', (['""".*/$"""', 'blob.name'], {}), "('.*/$', blob.name)\n", (798, 817), False, 'import re\n'), ((1782, 1804), 're.match', 're.match', ... |
import logging
from os.path import dirname, abspath
from os import chdir
moduleDir = dirname(abspath(__file__)) + '/'
chdir(moduleDir)
if __name__ == '__main__':
from .config import logging_format
from .hp_server import serve_forever
logging.basicConfig(format=logging_format, level=logging.DEBUG)
... | [
"os.path.abspath",
"logging.debug",
"os.chdir",
"logging.basicConfig"
] | [((119, 135), 'os.chdir', 'chdir', (['moduleDir'], {}), '(moduleDir)\n', (124, 135), False, 'from os import chdir\n'), ((253, 316), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': 'logging_format', 'level': 'logging.DEBUG'}), '(format=logging_format, level=logging.DEBUG)\n', (272, 316), False, 'import log... |
# Generated by Django 3.1.7 on 2021-04-01 06:22
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('app', '0005_auto_20210401_0121'),
]
operations =... | [
"django.db.migrations.swappable_dependency",
"django.db.models.ManyToManyField"
] | [((194, 251), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (225, 251), False, 'from django.db import migrations, models\n'), ((443, 552), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'blank': '(... |
# -*- coding: utf-8 -*-
### ATENÇÃO ###
# Antes de executar instale o pyfirmata:
# pip install pyfirmata --user
# E compile no arduino o código do ArduinoIDE encontrado em:
# Arquivo -> Exemplos -> Firmata -> StandardFirmata
### IMPORTANTE ###
# O valor da frequencia fica aproximado
# imports
import pyfirmata
imp... | [
"pandas.DataFrame",
"matplotlib.pyplot.show",
"matplotlib.pyplot.suptitle",
"pyfirmata.util.Iterator",
"loguru.logger.warning",
"numpy.zeros",
"numpy.ones",
"time.sleep",
"time.time",
"loguru.logger.info",
"pyfirmata.Arduino",
"matplotlib.pyplot.subplots_adjust",
"loguru.logger.debug",
"ma... | [((4782, 4800), 'numpy.zeros', 'np.zeros', (['sizeStep'], {}), '(sizeStep)\n', (4790, 4800), True, 'import numpy as np\n'), ((11161, 11214), 'loguru.logger.info', 'logger.info', (['f"""Configurando conexão com o arduino..."""'], {}), "(f'Configurando conexão com o arduino...')\n", (11172, 11214), False, 'from loguru im... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Download and install Go on Linux, list all available versions on the
Go website, select version to install and pass it as an argument.
- Go is an open source programming language:
https://golang.org/doc/copyright.html
- Linux is a family of open-source Unix-like ope... | [
"httplib2.Http",
"functools.partial",
"argparse.ArgumentParser",
"pathlib.Path.home",
"os.path.exists",
"os.system",
"time.perf_counter",
"subprocess.call",
"bs4.SoupStrainer",
"requests.get"
] | [((2869, 2884), 'httplib2.Http', 'httplib2.Http', ([], {}), '()\n', (2882, 2884), False, 'import httplib2\n'), ((3643, 3658), 'httplib2.Http', 'httplib2.Http', ([], {}), '()\n', (3656, 3658), False, 'import httplib2\n'), ((4394, 4409), 'httplib2.Http', 'httplib2.Http', ([], {}), '()\n', (4407, 4409), False, 'import htt... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from .views import FriendViewSet, FriendshipRequestViewSet
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register(r'friends', FriendViewSet, base_name='friends')
router.register(r'friendrequests', FriendshipRequestVi... | [
"rest_framework.routers.DefaultRouter"
] | [((186, 201), 'rest_framework.routers.DefaultRouter', 'DefaultRouter', ([], {}), '()\n', (199, 201), False, 'from rest_framework.routers import DefaultRouter\n')] |
from collections import defaultdict
from typing import Any
from django.db.models import Model
from rest_framework.exceptions import APIException, ValidationError
from rest_framework.fields import DateTimeField, IntegerField
from rest_framework.serializers import ModelSerializer, ListSerializer
class NestedModelSeria... | [
"rest_framework.fields.IntegerField",
"collections.defaultdict",
"rest_framework.fields.DateTimeField",
"rest_framework.exceptions.ValidationError",
"rest_framework.exceptions.APIException"
] | [((4586, 4632), 'rest_framework.fields.DateTimeField', 'DateTimeField', ([], {'required': '(False)', 'allow_null': '(True)'}), '(required=False, allow_null=True)\n', (4599, 4632), False, 'from rest_framework.fields import DateTimeField, IntegerField\n'), ((4746, 4775), 'rest_framework.fields.DateTimeField', 'DateTimeFi... |
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
import time
class Worker(QRunnable):
'''
Worker thread
'''
@pyqtSlot()
def run(self):
'''
Your code goes in this function
'''
print("Thread start")
time.sleep(5)
prin... | [
"time.sleep"
] | [((294, 307), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (304, 307), False, 'import time\n')] |
import os, sys
import time
import torch
import numpy as np
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from vis_utils import get_vis_depth, get_vis_mask, get_vis_normal
import copy
import cv2
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from PIL impo... | [
"vis_utils.get_vis_depth",
"pickle.dump",
"numpy.abs",
"torch.cat",
"os.path.abspath",
"matplotlib.colors.Normalize",
"cv2.cvtColor",
"matplotlib.cm.ScalarMappable",
"cv2.imwrite",
"matplotlib.pyplot.close",
"vis_utils.get_vis_mask",
"matplotlib.pyplot.subplots",
"matplotlib.use",
"matplot... | [((233, 247), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (240, 247), True, 'import matplotlib as mpl\n'), ((91, 116), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (106, 116), False, 'import os, sys\n'), ((3133, 3153), 'pickle.dump', 'pickle.dump', (['data', 'f'], {}), '(... |
import importlib
# Task Factories know about all types of tasks that can be created and creates the appropriate instance when called
# Abstracts the creation logic, and all of the library importing away from the user
###################################################################################################
#... | [
"importlib.import_module"
] | [((2347, 2383), 'importlib.import_module', 'importlib.import_module', (['module_name'], {}), '(module_name)\n', (2370, 2383), False, 'import importlib\n')] |
import logging
from confluent_kafka import Producer
log = logging.getLogger(__name__)
def _log_delivery_report(error, message):
if error is None:
log.info(f"Delivered to topic: {message.topic()} ({message.partition()})")
else:
log.error(f"Failed to deliver message: {error}")
class KafkaEve... | [
"confluent_kafka.Producer",
"logging.getLogger"
] | [((60, 87), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (77, 87), False, 'import logging\n'), ((425, 441), 'confluent_kafka.Producer', 'Producer', (['config'], {}), '(config)\n', (433, 441), False, 'from confluent_kafka import Producer\n')] |
from setuptools import setup
from setuptools import find_packages
setup(name = 'elink',
version = '0.1pre',
description = 'parallella elink',
license = 'TBD',
packages = find_packages(),
) | [
"setuptools.find_packages"
] | [((197, 212), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (210, 212), False, 'from setuptools import find_packages\n')] |
from pymtl import *
from lizard.util.rtl.interface import Interface, UseInterface
from lizard.util.rtl.method import MethodSpec
from lizard.util.rtl.register import Register, RegisterInterface
from lizard.util.rtl.thermometer_mask import ThermometerMask, ThermometerMaskInterface
from lizard.bitutil import clog2
class... | [
"lizard.util.rtl.thermometer_mask.ThermometerMaskInterface",
"lizard.util.rtl.interface.UseInterface"
] | [((816, 842), 'lizard.util.rtl.interface.UseInterface', 'UseInterface', (['s', 'interface'], {}), '(s, interface)\n', (828, 842), False, 'from lizard.util.rtl.interface import Interface, UseInterface\n'), ((1394, 1420), 'lizard.util.rtl.interface.UseInterface', 'UseInterface', (['s', 'interface'], {}), '(s, interface)\... |
import unittest
from factom_keys.fct import FactoidPrivateKey, FactoidAddress, generate_key_pair
class TestFactoidKeys(unittest.TestCase):
def test_generate_key_pair(self):
private_key, public_key = generate_key_pair()
assert isinstance(private_key, FactoidPrivateKey)
assert isinstance(p... | [
"unittest.main",
"factom_keys.fct.FactoidPrivateKey",
"factom_keys.fct.FactoidAddress.is_valid",
"factom_keys.fct.generate_key_pair",
"factom_keys.fct.FactoidPrivateKey.is_valid",
"factom_keys.fct.FactoidAddress"
] | [((2162, 2177), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2175, 2177), False, 'import unittest\n'), ((215, 234), 'factom_keys.fct.generate_key_pair', 'generate_key_pair', ([], {}), '()\n', (232, 234), False, 'from factom_keys.fct import FactoidPrivateKey, FactoidAddress, generate_key_pair\n'), ((507, 542), '... |
import os
import time
import numpy as np
import torch
from torch import nn
from butterfly_factor import butterfly_factor_mult_intermediate
# from butterfly import Block2x2DiagProduct
# from test_factor_multiply import twiddle_list_concat
exps = np.arange(6, 14)
sizes = 1 << exps
batch_size = 256
ntrials = [100000... | [
"torch.cuda.synchronize",
"pickle.dump",
"torch.randn_like",
"butterfly_factor.butterfly_factor_mult_intermediate",
"torch.autograd.grad",
"numpy.zeros",
"time.perf_counter",
"torch.randn",
"numpy.arange",
"torch.rfft",
"torch.nn.Linear"
] | [((249, 265), 'numpy.arange', 'np.arange', (['(6)', '(14)'], {}), '(6, 14)\n', (258, 265), True, 'import numpy as np\n'), ((387, 406), 'numpy.zeros', 'np.zeros', (['exps.size'], {}), '(exps.size)\n', (395, 406), True, 'import numpy as np\n'), ((419, 438), 'numpy.zeros', 'np.zeros', (['exps.size'], {}), '(exps.size)\n',... |
from __future__ import annotations
import csv
import io
import json
import tarfile
import tempfile
from dataclasses import dataclass
from datetime import datetime
from http import HTTPStatus
from pprint import pprint
from typing import Iterator, Dict, Any
from dcp.data_format import Records
from dcp.utils.common impo... | [
"io.BytesIO",
"snapflow.datafunction",
"csv.DictReader",
"io.TextIOWrapper",
"tarfile.open",
"snapflow.helpers.connectors.connection.HttpApiConnection"
] | [((875, 1005), 'snapflow.datafunction', 'datafunction', (['"""bulk_import"""'], {'namespace': '"""crunchbase"""', 'display_name': '"""Import Crunchbase data"""', 'required_storage_classes': "['file']"}), "('bulk_import', namespace='crunchbase', display_name=\n 'Import Crunchbase data', required_storage_classes=['fil... |
"""@package config
Contains all config files necessary for simulator
Rignumber body configuration data
"""
from kinematics import Kinematics
import threading
from inc import *
from gui import Gui
from communication import ComminucationModule
from rigid_body_system_parser import RigidBodySystemParser
class Simulator:... | [
"rigid_body_system_parser.RigidBodySystemParser"
] | [((506, 551), 'rigid_body_system_parser.RigidBodySystemParser', 'RigidBodySystemParser', (['self.rigid_body_system'], {}), '(self.rigid_body_system)\n', (527, 551), False, 'from rigid_body_system_parser import RigidBodySystemParser\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Filters to provide an Experiment instance to pare down the amount of data
to look at.
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals)
import six
from six.moves import (zip, filter, map, reduce, input, range)
import math... | [
"six.moves.zip",
"six.next",
"math.sqrt"
] | [((1477, 1494), 'six.next', 'six.next', (['ipoints'], {}), '(ipoints)\n', (1485, 1494), False, 'import six\n'), ((1546, 1596), 'math.sqrt', 'math.sqrt', (['((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2)'], {}), '((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2)\n', (1555, 1596), False, 'import math\n'), ((1929, 1951), 'six.moves.zi... |
from pandas import Series
from sklearn.metrics import roc_curve, auc
from sklearn.model_selection import StratifiedKFold, ShuffleSplit
import numpy as np
from scipy import interp
import matplotlib.pyplot as plt
from sklearn import metrics
from sklearn.preprocessing import LabelEncoder
def transform_labels(y) -> Seri... | [
"matplotlib.pyplot.title",
"numpy.maximum",
"numpy.mean",
"matplotlib.pyplot.fill_between",
"numpy.std",
"sklearn.preprocessing.LabelEncoder",
"numpy.linspace",
"numpy.minimum",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.legend",
"pandas.Series",
"matplotlib.pyplo... | [((444, 453), 'pandas.Series', 'Series', (['y'], {}), '(y)\n', (450, 453), False, 'from pandas import Series\n'), ((720, 754), 'sklearn.model_selection.StratifiedKFold', 'StratifiedKFold', ([], {'n_splits': 'n_splits'}), '(n_splits=n_splits)\n', (735, 754), False, 'from sklearn.model_selection import StratifiedKFold, S... |
from random import randint
class Product():
def __init__(self, name, price=10, weight=20, flammability=0.5, identifier=randint(1000000, 9999999)):
self.name = name
self.price = price
self.weight = weight
self.flammability = flammability
self.identifier = identifier
de... | [
"random.randint"
] | [((126, 151), 'random.randint', 'randint', (['(1000000)', '(9999999)'], {}), '(1000000, 9999999)\n', (133, 151), False, 'from random import randint\n'), ((1018, 1043), 'random.randint', 'randint', (['(1000000)', '(9999999)'], {}), '(1000000, 9999999)\n', (1025, 1043), False, 'from random import randint\n')] |
from multiprocessing import Process
from json import loads
from json.decoder import JSONDecodeError
from time import sleep
class ProcessReceive(Process):
def __init__(self, queue, socket, client_status):
self.queue = queue
self.socket = socket
self.client_status = client_status
su... | [
"json.loads"
] | [((856, 866), 'json.loads', 'loads', (['aux'], {}), '(aux)\n', (861, 866), False, 'from json import loads\n')] |
import os
async def get_extension_models():
l = []
list_of_files = [x for x in os.listdir("/code/external_modules/") if x not in ['__init__.py', '__pycache__']]
for m in list_of_files:
# Check if model not empty
extension_model_files = [
x for x in os.listdir(f"/code/external_m... | [
"os.listdir"
] | [((89, 126), 'os.listdir', 'os.listdir', (['"""/code/external_modules/"""'], {}), "('/code/external_modules/')\n", (99, 126), False, 'import os\n'), ((291, 339), 'os.listdir', 'os.listdir', (['f"""/code/external_modules/{m}/models"""'], {}), "(f'/code/external_modules/{m}/models')\n", (301, 339), False, 'import os\n')] |
"""!Tokenizer for the produtil.testing.parser module."""
import re
import produtil.testing.utilities
__all__=[ 'Token', 'end_of_line_type', 'end_of_text_type', 'Tokenizer',
'TokenizeFile' ]
class Token(object):
"""!Represents one token in the tokenized version of a file."""
##@var token_type
#... | [
"re.compile"
] | [((3259, 5331), 're.compile', 're.compile', (['"""(?xs)\n (\n (?P<comment> \\\\# [^\\\\r\\\\n]+ (?: \\\\r | \\\\n )+ )\n | (?P<commentend> \\\\# [^\\\\r\\\\n]+ | \\\\# ) $\n | (?P<varname> [A-Za-z_] [A-Za-z_0-9.@]*\n (?: % [A-Za-z... |
import machine
from machine import Pin
import pycom
from utime import sleep
# Config pin:
configPin = Pin('P21', Pin.IN, Pin.PULL_UP)
pycom.heartbeat(False)
if machine.reset_cause() == machine.DEEPSLEEP_RESET:
print('Woke from a deep sleep')
else:
print('Power on or hard reset')
# Check for config mode:
con... | [
"machine.deepsleep",
"utime.sleep",
"machine.reset_cause",
"pycom.heartbeat",
"pycom.rgbled",
"machine.Pin"
] | [((103, 134), 'machine.Pin', 'Pin', (['"""P21"""', 'Pin.IN', 'Pin.PULL_UP'], {}), "('P21', Pin.IN, Pin.PULL_UP)\n", (106, 134), False, 'from machine import Pin\n'), ((136, 158), 'pycom.heartbeat', 'pycom.heartbeat', (['(False)'], {}), '(False)\n', (151, 158), False, 'import pycom\n'), ((163, 184), 'machine.reset_cause'... |
import datetime
from dateutil.parser import parse
from dateutil.relativedelta import MO, SU, relativedelta
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.utils import timezone
from django.views.generic.base import Templ... | [
"dateutil.relativedelta.MO",
"dateutil.parser.parse",
"homeschool.students.models.Coursework.objects.filter",
"django.utils.timezone.now",
"homeschool.students.models.Coursework",
"datetime.date",
"django.urls.reverse",
"homeschool.schools.models.SchoolYear.objects.filter",
"datetime.timedelta",
"... | [((8549, 8582), 'django.http.HttpResponseRedirect', 'HttpResponseRedirect', (['success_url'], {}), '(success_url)\n', (8569, 8582), False, 'from django.http import HttpResponseRedirect\n'), ((4665, 4696), 'datetime.date', 'datetime.date', (['year', 'month', 'day'], {}), '(year, month, day)\n', (4678, 4696), False, 'imp... |
########################################################################################################################
# Module: tests/test_core.py
# Description: Tests for core and Sampler
#
# Web: https://github.com/SamDuffield/mocat
##################################################################################... | [
"unittest.main",
"numpy.testing.assert_array_equal",
"numpy.testing.assert_equal",
"jax.numpy.ones",
"jax.numpy.zeros"
] | [((3308, 3323), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3321, 3323), False, 'import unittest\n'), ((851, 895), 'numpy.testing.assert_equal', 'npt.assert_equal', (['self.cdict.test_float', '(3.0)'], {}), '(self.cdict.test_float, 3.0)\n', (867, 895), True, 'import numpy.testing as npt\n'), ((1209, 1249), 'nu... |
from itertools import product
import pytest
from openbrewerydb_api_tests import configuration as CONF
TEST_DATA = {
'endpoints': [
# city endpoints
'breweries?by_city=portland',
'breweries?by_city=san%20diego',
'breweries?by_city=san_diego',
# name endpoints
'brewe... | [
"itertools.product"
] | [((1420, 1492), 'itertools.product', 'product', (["TEST_DATA['endpoints']", "TEST_DATA['signs']", "TEST_DATA['fields']"], {}), "(TEST_DATA['endpoints'], TEST_DATA['signs'], TEST_DATA['fields'])\n", (1427, 1492), False, 'from itertools import product\n')] |
import logging
from collections import defaultdict
from django.contrib.auth.models import User
from django.core.exceptions import EmptyResultSet
from django.db import connection
from django.db.models.query_utils import Q
from annotation.models.damage_enums import PathogenicityImpact
from classification.enums import C... | [
"logging.error",
"logging.warning",
"django.db.models.query_utils.Q",
"django.db.connection.cursor",
"collections.defaultdict",
"library.database_utils.dictfetchall",
"classification.models.Classification.get_variant_q",
"library.database_utils.get_queryset_select_from_where_parts"
] | [((2041, 2081), 'django.db.models.query_utils.Q', 'Q', ([], {'clinvar__highest_pathogenicity__gte': '(4)'}), '(clinvar__highest_pathogenicity__gte=4)\n', (2042, 2081), False, 'from django.db.models.query_utils import Q\n'), ((4999, 5039), 'library.database_utils.get_queryset_select_from_where_parts', 'get_queryset_sele... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
""" Copyright 2013 <NAME>
Copyright 2017 The Graphite Project
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... | [
"os.getloadavg",
"socket.socket",
"time.time",
"time.sleep",
"sys.stderr.write",
"carbon.carbon_pb2.Payload",
"sys.exit"
] | [((2110, 2125), 'socket.socket', 'socket.socket', ([], {}), '()\n', (2123, 2125), False, 'import socket\n'), ((1127, 1136), 'carbon.carbon_pb2.Payload', 'Payload', ([], {}), '()\n', (1134, 1136), False, 'from carbon.carbon_pb2 import Payload\n'), ((1760, 1777), 'time.sleep', 'time.sleep', (['delay'], {}), '(delay)\n', ... |
import numpy as np
import diversipy
def test_distance_to_boundary():
points = np.array([[0.1, 0.2], [0.3, 0.9]])
np.testing.assert_almost_equal(
diversipy.distance.distance_to_boundary(points), np.array([0.1, 0.1])
)
np.testing.assert_almost_equal(
diversipy.distance.distance_to_bounda... | [
"diversipy.distance.distance_to_boundary",
"numpy.array",
"diversipy.distance.distance_matrix"
] | [((84, 118), 'numpy.array', 'np.array', (['[[0.1, 0.2], [0.3, 0.9]]'], {}), '([[0.1, 0.2], [0.3, 0.9]])\n', (92, 118), True, 'import numpy as np\n'), ((439, 485), 'numpy.array', 'np.array', (['[[0.1, 0.2], [0.3, 0.9], [0.6, 0.1]]'], {}), '([[0.1, 0.2], [0.3, 0.9], [0.6, 0.1]])\n', (447, 485), True, 'import numpy as np\... |
import numpy as np
import os
import configparser
import tensorflow as tf
from pkg_resources import resource_filename
from pyniel.python_tools.path_tools import make_dir_if_not_exists
import crowd_sim # adds CrowdSim-v0 to gym # noqa
from crowd_sim.envs.crowd_sim import CrowdSim # reference to env code # noqa
from ... | [
"pkg_resources.resource_filename",
"numpy.clip",
"numpy.sin",
"crowd_sim.envs.utils.action.ActionRot",
"os.path.join",
"pyniel.python_tools.path_tools.make_dir_if_not_exists",
"configparser.RawConfigParser",
"navrep.envs.ianenv.IANEnv",
"crowd_nav.policy.network_om.SDOADRL",
"crowd_sim.envs.utils.... | [((6596, 6615), 'navrep.tools.commonargs.parse_common_args', 'parse_common_args', ([], {}), '()\n', (6613, 6615), False, 'from navrep.tools.commonargs import parse_common_args\n'), ((6827, 6898), 'navrep.scripts.cross_test_navreptrain_in_ianenv.run_test_episodes', 'run_test_episodes', (['env', 'policy'], {'render': 'ar... |
import json, requests, sys
URL='https://api.groupme.com/v3'
# Attempt to load the config file
try:
config_file = open('config.json')
except IOError:
print("Cannot open config file, exiting")
sys.exit(1)
CONFIG = json.loads(config_file.read())
config_file.close()
if not 'token' in CONFIG:
print("Inva... | [
"requests.get",
"json.loads",
"sys.exit",
"json.dumps"
] | [((354, 365), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (362, 365), False, 'import json, requests, sys\n'), ((840, 889), 'requests.get', 'requests.get', (["(URL + '/' + endpoint)"], {'params': 'params'}), "(URL + '/' + endpoint, params=params)\n", (852, 889), False, 'import json, requests, sys\n'), ((205, 216), '... |
from thetis import *
import time as time_mod
from model_config import *
# Setup solver
solver_obj, start_time, update_forcings = construct_solver(
output_directory="outputs_spinup",
spinup=True,
start_date=datetime.datetime(2022, 1, 1, tzinfo=sim_tz),
end_date=datetime.datetime(2022, 1, 15, tzinfo=sim... | [
"time.perf_counter"
] | [((601, 624), 'time.perf_counter', 'time_mod.perf_counter', ([], {}), '()\n', (622, 624), True, 'import time as time_mod\n'), ((683, 706), 'time.perf_counter', 'time_mod.perf_counter', ([], {}), '()\n', (704, 706), True, 'import time as time_mod\n')] |
from django.conf.urls import patterns, url
def get_sitegate_urls():
"""Returns sitegate urlpatterns, that can be attached
to urlpatterns of a project:
# Example from urls.py.
from sitegate.toolbox import get_sitegate_urls
urlpatterns = patterns('',
...
url(r'... | [
"django.conf.urls.url"
] | [((475, 569), 'django.conf.urls.url', 'url', (['"""^verify_email/(?P<code>\\\\S+)/$"""', '"""sitegate.views.verify_email"""'], {'name': '"""verify_email"""'}), "('^verify_email/(?P<code>\\\\S+)/$', 'sitegate.views.verify_email', name=\n 'verify_email')\n", (478, 569), False, 'from django.conf.urls import patterns, u... |
import asyncio
from aiodag import task
@task
async def processA():
await asyncio.sleep(1)
print('Done processA')
async def processB():
await asyncio.sleep(5)
print('Done processB')
@task
async def processC():
await asyncio.sleep(1)
print('Done processC')
@task
async def processD(f):
awa... | [
"asyncio.gather",
"asyncio.sleep",
"aiodag.task",
"asyncio.new_event_loop"
] | [((1041, 1065), 'asyncio.new_event_loop', 'asyncio.new_event_loop', ([], {}), '()\n', (1063, 1065), False, 'import asyncio\n'), ((79, 95), 'asyncio.sleep', 'asyncio.sleep', (['(1)'], {}), '(1)\n', (92, 95), False, 'import asyncio\n'), ((156, 172), 'asyncio.sleep', 'asyncio.sleep', (['(5)'], {}), '(5)\n', (169, 172), Fa... |
from collections import OrderedDict
import matplotlib.pyplot as plt
import seaborn as sns
import torch
import torch.nn as nn
from seaborn.palettes import color_palette
import numpy as np
# import seaborn as sns
import torch
import os
from BatchTransNorm import BatchTransNorm2d
from datasets import (Chest_few_shot, ... | [
"seaborn.kdeplot",
"torch.utils.data.DataLoader",
"matplotlib.pyplot.figure",
"torch.nn.BatchNorm2d",
"torch.cuda.is_available",
"numpy.array",
"BatchTransNorm.BatchTransNorm2d",
"torch.device",
"torch.no_grad"
] | [((1082, 1107), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (1105, 1107), False, 'import torch\n'), ((1159, 1176), 'torch.device', 'torch.device', (['dev'], {}), '(dev)\n', (1171, 1176), False, 'import torch\n'), ((2159, 2191), 'BatchTransNorm.BatchTransNorm2d', 'BatchTransNorm2d', ([], {'nu... |
# encoding:utf-8
import lxml
"""
lxml.etree.HTML() 处理文本字符串
lxml.etree.parse() 处理的是文件内容
"""
import lxml.etree
html = lxml.etree.parse("1.html") # 处理文件
print(html)
print(type(html))
print(lxml.etree.tostring(html))
"""
报错:
lxml.etree.XMLSyntaxError: Opening and ending tag mismatch: meta line 4 and head, line 6... | [
"lxml.etree.parse",
"lxml.etree.tostring"
] | [((125, 151), 'lxml.etree.parse', 'lxml.etree.parse', (['"""1.html"""'], {}), "('1.html')\n", (141, 151), False, 'import lxml\n'), ((196, 221), 'lxml.etree.tostring', 'lxml.etree.tostring', (['html'], {}), '(html)\n', (215, 221), False, 'import lxml\n')] |
import networkx as nx
import random as rnd
import math
def writeNodes(basename, number, caps, lista, f):
for i in range(number):
name = basename + str(i)
node = "node(" + name +"," + caps +").\n"
lista.append(name)
f.write(node)
def printLinks(list1, list2, qos, f):
for n1 in l... | [
"networkx.generators.complete_graph",
"random.random",
"math.log2",
"random.choice"
] | [((2818, 2830), 'random.random', 'rnd.random', ([], {}), '()\n', (2828, 2830), True, 'import random as rnd\n'), ((3019, 3031), 'random.random', 'rnd.random', ([], {}), '()\n', (3029, 3031), True, 'import random as rnd\n'), ((3279, 3291), 'random.random', 'rnd.random', ([], {}), '()\n', (3289, 3291), True, 'import rando... |
# Copyright (c) 2019. Partners HealthCare and other members of
# Forome Association
#
# Developed by <NAME> based on contributions by <NAME>,
# <NAME>, <NAME> and other members of Division of
# Genetics, Brigham and Women's Hospital
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may no... | [
"json.parse",
"json.loads",
"app.eval.dtree_mod.modifyDTreeCode",
"app.config.solutions.completeDsModes",
"json.dumps",
"app.eval.condition.ConditionMaker.condAll",
"app.config.a_config.AnfisaConfig.configOption",
"app.view.asp_set.AspectSetH.load",
"app.config.view_tune.tuneAspects",
"datetime.da... | [((1816, 1853), 'app.config.a_config.AnfisaConfig.configOption', 'AnfisaConfig.configOption', (['"""tm.coeff"""'], {}), "('tm.coeff')\n", (1841, 1853), False, 'from app.config.a_config import AnfisaConfig\n'), ((1874, 1918), 'app.config.a_config.AnfisaConfig.configOption', 'AnfisaConfig.configOption', (['"""max.tab.rq.... |
import os
from os.path import join, isfile, isdir
import errno
import PIL
from PIL import ImageFont
from PIL import Image
from PIL import ImageDraw
import random
random.seed(5)
class Options:
light, dark, none = range(3)
def get_random_font():
allowed_fonts = [
'dejavu',
'freefont',
]
... | [
"PIL.Image.new",
"random.randint",
"os.makedirs",
"random.seed",
"PIL.ImageDraw.Draw",
"os.path.join",
"os.listdir"
] | [((163, 177), 'random.seed', 'random.seed', (['(5)'], {}), '(5)\n', (174, 177), False, 'import random\n'), ((1932, 1974), 'PIL.Image.new', 'Image.new', (['"""RGBA"""', '(200, 200)', 'back_colour'], {}), "('RGBA', (200, 200), back_colour)\n", (1941, 1974), False, 'from PIL import Image\n'), ((1985, 2004), 'PIL.ImageDraw... |
import json
import logging
from collections import OrderedDict
from pathlib import Path
from sira.modelling.component import Component, ConnectionValues
from sira.modelling.infrastructure import InfrastructureFactory
from sira.tools.convert_excel_files_to_json import (read_excel_to_json,
... | [
"json.load",
"sira.tools.convert_excel_files_to_json.read_excel_to_json",
"sira.modelling.component.Component",
"logging.getLogger",
"sira.modelling.infrastructure.InfrastructureFactory.create_model",
"pathlib.Path",
"sira.tools.convert_excel_files_to_json.update_json_structure",
"sira.modelling.compo... | [((379, 406), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (396, 406), False, 'import logging\n'), ((5101, 5170), 'sira.modelling.infrastructure.InfrastructureFactory.create_model', 'InfrastructureFactory.create_model', (['infrastructure_system_constructor'], {}), '(infrastructure_syste... |
import sys
import pdb
pdb.set_trace();
print("\n Enter the numbers:");
a=input();
b=input();
c=int(a)+int(b);
print("\n the first number:");
print(a);
print("\n the second number:");
print(b);
print("\n The addition of two numbers:");
print(c);
| [
"pdb.set_trace"
] | [((22, 37), 'pdb.set_trace', 'pdb.set_trace', ([], {}), '()\n', (35, 37), False, 'import pdb\n')] |
# Generated by Django 2.2.2 on 2019-06-15 21:28
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('myfiles', '0010_auto_20190615_2244'),
]
operations = [
migrations.RenameField(
model_name='folder',
old_name='owner_id',
... | [
"django.db.migrations.RenameField"
] | [((227, 314), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""folder"""', 'old_name': '"""owner_id"""', 'new_name': '"""owner"""'}), "(model_name='folder', old_name='owner_id', new_name=\n 'owner')\n", (249, 314), False, 'from django.db import migrations\n'), ((366, 468), 'djang... |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2019, 2020.
#
# 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.
#... | [
"numpy.iinfo",
"numpy.imag",
"numpy.mean",
"numpy.arange",
"numpy.real",
"warnings.warn",
"numpy.unique"
] | [((5144, 5312), 'warnings.warn', 'warn', (["('Warning: qubit_lo_freq was not specified in PulseQobj or in PulseSystemModel, '\n + 'so it is beign automatically determined from the drift Hamiltonian.')"], {}), "(\n 'Warning: qubit_lo_freq was not specified in PulseQobj or in PulseSystemModel, '\n + 'so it is ... |
import os
def get_subfolder_names(path):
return [f.name for f in os.scandir(path) if f.is_dir()]
| [
"os.scandir"
] | [((71, 87), 'os.scandir', 'os.scandir', (['path'], {}), '(path)\n', (81, 87), False, 'import os\n')] |
import datetime
import math
from collections import defaultdict
import dateutil.parser
from elasticmagic.types import instantiate
from elasticmagic.types import Type
from elasticmagic.compat import force_unicode
from elasticmagic.compat import int_types
TIME_ATTRS = {'hour', 'minute', 'second', 'microsecond', 'tzin... | [
"elasticmagic.types.instantiate",
"math.isnan",
"math.isinf",
"collections.defaultdict",
"elasticmagic.compat.force_unicode"
] | [((597, 617), 'elasticmagic.compat.force_unicode', 'force_unicode', (['value'], {}), '(value)\n', (610, 617), False, 'from elasticmagic.compat import force_unicode\n'), ((677, 697), 'elasticmagic.compat.force_unicode', 'force_unicode', (['value'], {}), '(value)\n', (690, 697), False, 'from elasticmagic.compat import fo... |
import uuid
from datetime import datetime
from flask import current_app
from sqlalchemy.orm.exc import NoResultFound
from app.models import ServiceSmsSender, Service
from tests.app.db import create_service, create_service_sms_sender, create_inbound_number, \
create_service_with_inbound_number
def test_add_servi... | [
"uuid.uuid4",
"tests.app.db.create_service_sms_sender",
"tests.app.db.create_service_with_inbound_number",
"app.models.Service",
"tests.app.db.create_service",
"datetime.datetime.utcnow",
"tests.app.db.create_inbound_number",
"sqlalchemy.orm.exc.NoResultFound"
] | [((643, 655), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (653, 655), False, 'import uuid\n'), ((2662, 2678), 'tests.app.db.create_service', 'create_service', ([], {}), '()\n', (2676, 2678), False, 'from tests.app.db import create_service, create_service_sms_sender, create_inbound_number, create_service_with_inbound_... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
atmospheres.py includes functions to calculate atmospheric quantities.
Created on Tue Nov 29 11:45:15 2016
@author: tr1010 (<NAME>)
"""
import sys
sys.path.append('atmosphere_models/Python-NRLMSISE-00-master')
from nrlmsise_00_header import *
from nrlmsise_00 impor... | [
"sys.path.append",
"numpy.divide",
"numpy.sum",
"numpy.multiply",
"numpy.zeros",
"numpy.array",
"numpy.exp",
"numpy.float64",
"numpy.sqrt"
] | [((202, 264), 'sys.path.append', 'sys.path.append', (['"""atmosphere_models/Python-NRLMSISE-00-master"""'], {}), "('atmosphere_models/Python-NRLMSISE-00-master')\n", (217, 264), False, 'import sys\n'), ((4385, 4396), 'numpy.zeros', 'np.zeros', (['(8)'], {}), '(8)\n', (4393, 4396), True, 'import numpy as np\n'), ((4770,... |
import numpy as np
import matplotlib.pyplot as plt
from nt_toolbox.signal import imageplot
def plot_levelset(Z, level=0, f=[]):
"""
f is supposed to be of the same shape as Z
"""
if len(f) == 0:
f = np.copy(Z)
n,p = np.shape(Z)
X,Y = np.meshgrid(np.arange(0,n),np.arange(0,p... | [
"numpy.copy",
"nt_toolbox.signal.imageplot",
"numpy.shape",
"matplotlib.pyplot.contour",
"numpy.arange"
] | [((258, 269), 'numpy.shape', 'np.shape', (['Z'], {}), '(Z)\n', (266, 269), True, 'import numpy as np\n'), ((327, 384), 'matplotlib.pyplot.contour', 'plt.contour', (['X', 'Y', 'Z', '[level]'], {'linewidths': '(2)', 'colors': '"""red"""'}), "(X, Y, Z, [level], linewidths=2, colors='red')\n", (338, 384), True, 'import mat... |
import sys
from pathlib import Path
def document_glossary(outfile: str) -> None:
path_to_qcdb = Path("../qcdb").resolve().parent
sys.path.append(str(path_to_qcdb))
import qcdb
from qcdb.qcvars.glossary import qcvardefs
rst = []
rst.append(".. _`apdx:qcvariables_alpha`:")
rst.append("")
... | [
"pathlib.Path",
"qcdb.qcvars.glossary.qcvardefs.items"
] | [((446, 463), 'qcdb.qcvars.glossary.qcvardefs.items', 'qcvardefs.items', ([], {}), '()\n', (461, 463), False, 'from qcdb.qcvars.glossary import qcvardefs\n'), ((102, 117), 'pathlib.Path', 'Path', (['"""../qcdb"""'], {}), "('../qcdb')\n", (106, 117), False, 'from pathlib import Path\n')] |
# python3
#
# Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | [
"PIL.Image.fromarray",
"numpy.argpartition",
"tflite_runtime.interpreter.Interpreter"
] | [((2208, 2239), 'numpy.argpartition', 'np.argpartition', (['(-output)', 'top_k'], {}), '(-output, top_k)\n', (2223, 2239), True, 'import numpy as np\n'), ((3261, 3279), 'tflite_runtime.interpreter.Interpreter', 'Interpreter', (['model'], {}), '(model)\n', (3272, 3279), False, 'from tflite_runtime.interpreter import Int... |
"""
用于减少编码中的多个简单条件if分支,
实现类似 java spring 中通过 application context 生命周期回调实现的工厂路由
实例见下方test
"""
import functools
def router(func):
"""
入口方法装饰器
:param func: 入口方法
:return: 装饰后的方法
"""
# 路由表
route_table = {}
@functools.wraps(func)
def wrapper(arg0, *args, **kwargs):
"""获取分支方法,... | [
"functools.wraps"
] | [((240, 261), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (255, 261), False, 'import functools\n')] |
import json
import traceback
from datetime import datetime, timedelta
from typing import List
from parse import parse
from anubis.models import db, Submission, Assignment, Course
from anubis.utils.data import with_context
from anubis.utils.lms.autograde import bulk_autograde
from anubis.utils.lms.submissions import i... | [
"anubis.utils.services.github.fix_github_broken_repos",
"anubis.utils.lms.submissions.init_submission",
"anubis.models.Submission.query.filter",
"json.dumps",
"anubis.utils.services.logger.logger.info",
"anubis.utils.services.rpc.enqueue_autograde_pipeline",
"anubis.utils.services.rpc.enqueue_ide_reap_s... | [((1232, 1251), 'anubis.models.db.session.commit', 'db.session.commit', ([], {}), '()\n', (1249, 1251), False, 'from anubis.models import db, Submission, Assignment, Course\n'), ((2619, 2637), 'anubis.models.Course.query.all', 'Course.query.all', ([], {}), '()\n', (2635, 2637), False, 'from anubis.models import db, Sub... |
import glob
import itertools
import os
import pickle # For saving the vocabulary.
import re # For regex.
from collections import Counter
from functools import partial
from nltk.tokenize import TweetTokenizer
# Local imports.
from twitter_analysis_tools.text import ngrams, stopwords
from twitter_analysis_tools.twitt... | [
"functools.partial",
"pickle.dump",
"twitter_analysis_tools.twitter.file_mgmt.year_month_from_date_hour",
"os.path.join",
"twitter_analysis_tools.twitter.file_mgmt.extract_date_hour",
"collections.Counter",
"nltk.tokenize.TweetTokenizer",
"glob.glob",
"twitter_analysis_tools.twitter.common_pipelines... | [((1993, 2066), 'twitter_analysis_tools.twitter.common_pipelines.get_tweet_text_pipeline', 'common_pipelines.get_tweet_text_pipeline', (['filepath', 'self.include_retweets'], {}), '(filepath, self.include_retweets)\n', (2033, 2066), False, 'from twitter_analysis_tools.twitter import common_pipelines, file_mgmt\n'), ((2... |
"""
Context class for the pushing task as used in the paper
"How to Train Your Differentiable Filter".
"""
# this code only works with tensorflow 1
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import tensorflow_probability as tfp
import numpy as np
import os
import csv
from matplotlib.patches import Ell... | [
"tensorflow.compat.v1.zeros",
"numpy.arctan2",
"numpy.ones",
"tensorflow.compat.v1.summary.histogram",
"matplotlib.patches.Polygon",
"numpy.arange",
"differentiable_filters.utils.push_utils.physical_model",
"tensorflow.compat.v1.name_scope",
"os.path.dirname",
"tensorflow.compat.v1.constant_initia... | [((183, 207), 'tensorflow.compat.v1.disable_v2_behavior', 'tf.disable_v2_behavior', ([], {}), '()\n', (205, 207), True, 'import tensorflow.compat.v1 as tf\n'), ((1337, 1386), 'differentiable_filters.contexts.paper_base_context.PaperBaseContext.__init__', 'base.PaperBaseContext.__init__', (['self', 'param', 'mode'], {})... |
from s3_encryption_sdk import EncryptedBucket
def test_object_get(materials_provider, bucket):
crypto_bucket = EncryptedBucket(
bucket=bucket,
materials_provider=materials_provider,
)
body = "foo bar 4711"
crypto_bucket.put_object(
Key="object",
Body=body,
)
... | [
"s3_encryption_sdk.EncryptedBucket"
] | [((117, 186), 's3_encryption_sdk.EncryptedBucket', 'EncryptedBucket', ([], {'bucket': 'bucket', 'materials_provider': 'materials_provider'}), '(bucket=bucket, materials_provider=materials_provider)\n', (132, 186), False, 'from s3_encryption_sdk import EncryptedBucket\n')] |
from django.contrib import admin
from tworaven_apps.solver_interfaces.models import StatisticalModel
class StatisticalModelAdmin(admin.ModelAdmin):
list_display = ('model_id',
'created_on',
'user')
save_on_top = True
admin.site.register(StatisticalModel, StatisticalM... | [
"django.contrib.admin.site.register"
] | [((270, 330), 'django.contrib.admin.site.register', 'admin.site.register', (['StatisticalModel', 'StatisticalModelAdmin'], {}), '(StatisticalModel, StatisticalModelAdmin)\n', (289, 330), False, 'from django.contrib import admin\n')] |
from selenium import webdriver
import time
import json
import shutil
import re
import os
#Need firefox/chrome driver for selenium
#Get path to firefox driver
firefox_path = r"PATH/To/Gecko/Driver"
#This never changes unless you change campaigns
#Path to the journal containing the JSON of the players
path_t... | [
"time.sleep",
"re.search",
"json.loads",
"selenium.webdriver.Firefox"
] | [((410, 429), 'selenium.webdriver.Firefox', 'webdriver.Firefox', ([], {}), '()\n', (427, 429), False, 'from selenium import webdriver\n'), ((6684, 6697), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (6694, 6697), False, 'import time\n'), ((4823, 4881), 're.search', 're.search', (['"""Roll20: Online virtual table... |
import numpy as np
from scipy.optimize import leastsq
import matplotlib
matplotlib.use('TkAgg')
import pylab as plt
from math import sqrt, atan, cos
from process_data import *
guess_mean = np.mean(y1)/2
guess_std = 3*np.std(y1)/(2**0.5)
guess_phase = 0
guess_stretch = 0.3
data_first_guess = guess_std*np.sin(np.sin(g... | [
"pylab.show",
"numpy.std",
"pylab.ylabel",
"scipy.optimize.leastsq",
"matplotlib.use",
"pylab.figure",
"numpy.mean",
"pylab.xlabel",
"numpy.sin",
"pylab.xlim",
"pylab.legend",
"pylab.plot"
] | [((72, 95), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (86, 95), False, 'import matplotlib\n'), ((533, 571), 'pylab.figure', 'plt.figure', (['(1)'], {'figsize': '(9, 5)', 'dpi': '(150)'}), '(1, figsize=(9, 5), dpi=150)\n', (543, 571), True, 'import pylab as plt\n'), ((741, 804), 'pylab.pl... |
import pygame as pg
from collections import defaultdict
cl_hellbraun = (254, 206, 158); cl_dunkelbraun = (209, 139, 71); cl_grün = (0, 50, 0)
cl_weiss = (255, 255, 255); cl_schwarz = (0, 0, 0); cl_dunkelblau = (0, 0, 100)
cl_hellblau = (0, 0, 255); cl_rot = (255, 0, 0)
def bewertung():
return sum([stein for stein ... | [
"pygame.quit",
"pygame.mouse.get_pressed",
"pygame.event.get",
"pygame.display.set_mode",
"pygame.init",
"pygame.display.flip",
"collections.defaultdict",
"pygame.font.Font",
"pygame.mouse.get_pos",
"pygame.time.Clock"
] | [((6468, 6477), 'pygame.init', 'pg.init', ([], {}), '()\n', (6475, 6477), True, 'import pygame as pg\n'), ((6487, 6530), 'pygame.display.set_mode', 'pg.display.set_mode', (['[AUFLÖSUNG, AUFLÖSUNG]'], {}), '([AUFLÖSUNG, AUFLÖSUNG])\n', (6506, 6530), True, 'import pygame as pg\n'), ((6559, 6574), 'pygame.time.Clock', 'pg... |
# SPDX-FileCopyrightText: (c) 2021 <NAME> <github.com/rtmigo>
# SPDX-License-Identifier: MIT
import unittest
from framefile import hash_extract_number, pct_extract_number, \
PatternMismatchError
class TestHashExtractNumber(unittest.TestCase):
def test_match(self):
self.assertEqual(hash_extract_numbe... | [
"framefile.hash_extract_number",
"framefile.pct_extract_number"
] | [((302, 355), 'framefile.hash_extract_number', 'hash_extract_number', (['"""file_####.jpg"""', '"""file_1234.jpg"""'], {}), "('file_####.jpg', 'file_1234.jpg')\n", (321, 355), False, 'from framefile import hash_extract_number, pct_extract_number, PatternMismatchError\n'), ((413, 466), 'framefile.hash_extract_number', '... |
# <NAME>, Github: falfat
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 22 18:07:11 2019
@author: falol
"""
import matplotlib.pyplot as plt
square_t =[0.67874999999999996, 0.90500000000000003, 1.1312500000000001, 1.3574999999999999,1.5837500000000002, 1.8100000000000001, 2.0362499999999999, 2.2625000000000002, 2.4887... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig"
] | [((2650, 2676), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(8, 6)'}), '(figsize=(8, 6))\n', (2660, 2676), True, 'import matplotlib.pyplot as plt\n'), ((2968, 3003), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""dimensionless density"""'], {}), "('dimensionless density')\n", (2978, 3003), True, 'impor... |
from cursor import device
from cursor import path
from cursor import filter
import json
import random
from alive_progress import alive_bar
def file_to_paths(pc, file, pen):
# pc = path.PathCollection()
counter = 0
contours = len(file)
with alive_bar(contours) as bar:
for d in file:
... | [
"cursor.path.TimedPosition",
"random.randint",
"random.uniform",
"cursor.path.Path",
"cursor.filter.EntropyMinFilter",
"alive_progress.alive_bar",
"cursor.filter.MaxPointCountFilter",
"cursor.device.SimpleExportWrapper",
"cursor.path.PathCollection",
"cursor.filter.MinPointCountFilter"
] | [((1880, 1901), 'cursor.path.PathCollection', 'path.PathCollection', ([], {}), '()\n', (1899, 1901), False, 'from cursor import path\n'), ((2267, 2300), 'cursor.filter.EntropyMinFilter', 'filter.EntropyMinFilter', (['(1.5)', '(1.5)'], {}), '(1.5, 1.5)\n', (2290, 2300), False, 'from cursor import filter\n'), ((2321, 235... |
import requests
from bs4 import BeautifulSoup
import pandas
import matplotlib.pyplot as plt
addresses = []
prices = []
numBeds = []
for i in range(0, 5):
try:
url = 'https://www.century21.com/real-estate/carmel-in/LCINCARMEL/?s={}'.format(i*20)
page = requests.get(url)
soup = ... | [
"pandas.DataFrame",
"matplotlib.pyplot.show",
"requests.get",
"bs4.BeautifulSoup"
] | [((1318, 1392), 'pandas.DataFrame', 'pandas.DataFrame', (["{'Address': addresses, 'Price': prices, 'Beds': numBeds}"], {}), "({'Address': addresses, 'Price': prices, 'Beds': numBeds})\n", (1334, 1392), False, 'import pandas\n'), ((1630, 1640), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1638, 1640), True, ... |
from argparse import ArgumentParser
import pytorch_lightning as pl
from torchvision import transforms
from repalette.constants import DEFAULT_IMAGE_SIZE, DEFAULT_PRETRAIN_BATCH_SIZE
from repalette.datasets import GANDataset, PreTrainDataset
from repalette.datasets.utils import ShuffleDataLoader
class PreTrainDataMo... | [
"argparse.ArgumentParser",
"torchvision.transforms.RandomHorizontalFlip",
"repalette.datasets.utils.ShuffleDataLoader",
"torchvision.transforms.RandomVerticalFlip",
"repalette.datasets.PreTrainDataset",
"repalette.datasets.GANDataset",
"torchvision.transforms.Resize"
] | [((1658, 1754), 'repalette.datasets.PreTrainDataset', 'PreTrainDataset', ([], {'multiplier': 'self.multiplier', 'shuffle': 'self.shuffle', 'transform': 'self.transform'}), '(multiplier=self.multiplier, shuffle=self.shuffle, transform\n =self.transform)\n', (1673, 1754), False, 'from repalette.datasets import GANData... |