code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from setuptools import setup, find_packages
setup(
name = 'engine',
version = '1.0.0-p3',
packages = find_packages(),
install_requires = [
"utils"
],
url = 'http://jisc.ac.uk/',
author = '<NAME>',
author_email = '<EMAIL>',
description = 'Package to provide different engines ... | [
"setuptools.find_packages"
] | [((114, 129), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (127, 129), False, 'from setuptools import setup, find_packages\n')] |
"""
Grading Context
"""
from collections import OrderedDict
from openedx.core.djangoapps.content.block_structure.api import get_course_in_cache
from .course_grade import CourseGrade
from .scores import possibly_scored
def grading_context_for_course(course):
"""
Same as grading_context, but takes in a cour... | [
"collections.OrderedDict",
"openedx.core.djangoapps.content.block_structure.api.get_course_in_cache"
] | [((359, 389), 'openedx.core.djangoapps.content.block_structure.api.get_course_in_cache', 'get_course_in_cache', (['course.id'], {}), '(course.id)\n', (378, 389), False, 'from openedx.core.djangoapps.content.block_structure.api import get_course_in_cache\n'), ((1928, 1941), 'collections.OrderedDict', 'OrderedDict', ([],... |
"""The basic reactor module.
This has 'input' cells and compute cells, which are string names that are
(nominally) mapped to the context module.
The idea is that the compute cells take a context object, but also have
predicates that are evalutated in an "or" fashion until either all of them are
false, or one of them ... | [
"traceback.format_exc",
"collections.OrderedDict",
"collections.namedtuple",
"enum.Enum",
"charms.declarative.core.utils.maybe_format_key"
] | [((1313, 1338), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (1336, 1338), False, 'import collections\n'), ((1641, 1720), 'collections.namedtuple', 'collections.namedtuple', (['"""ReactorItem"""', '"""type_, key, name, variants, dependents"""'], {}), "('ReactorItem', 'type_, key, name, varian... |
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 8 23:53:36 2020
@author: <NAME>
"""
import os
import numpy as np
import matplotlib.pyplot as plt
from numpy import trapz
#https://matplotlib.org/3.1.0/tutorials/colors/colormaps.html
os.getcwd()
#q = variable de posición, dq0 = \dot{q}(0) = valor inicial de la derivada... | [
"numpy.log10",
"numpy.array",
"numpy.arange",
"matplotlib.pyplot.plot",
"numpy.diff",
"numpy.max",
"numpy.linspace",
"numpy.empty",
"matplotlib.pyplot.ylim",
"numpy.abs",
"numpy.trapz",
"numpy.around",
"matplotlib.pyplot.xlim",
"numpy.int",
"matplotlib.pyplot.get_cmap",
"numpy.insert",... | [((233, 244), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (242, 244), False, 'import os\n'), ((1878, 1907), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(12, 5)'}), '(figsize=(12, 5))\n', (1890, 1907), True, 'import matplotlib.pyplot as plt\n'), ((1907, 1926), 'matplotlib.pyplot.ylim', 'plt.ylim', ([... |
import argparse
from pypinyin import lazy_pinyin
from pychai import Schema
import re
import time
import sys
import timeit
import profile
# 定义参数
# parser = argparse.ArgumentParser(description='manual to this script')
# parser.add_argument('--words', type=str, default='')
# parser.add_argument('--org', type=str, default... | [
"pychai.Schema",
"time.time",
"re.finditer",
"pypinyin.lazy_pinyin"
] | [((660, 671), 'time.time', 'time.time', ([], {}), '()\n', (669, 671), False, 'import time\n'), ((693, 709), 'pychai.Schema', 'Schema', (['"""wubi98"""'], {}), "('wubi98')\n", (699, 709), False, 'from pychai import Schema\n'), ((2711, 2722), 'time.time', 'time.time', ([], {}), '()\n', (2720, 2722), False, 'import time\n... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'AppMainWindow.ui'
#
# Created by: PyQt5 UI code generator 5.15.6
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore... | [
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtWidgets.QMainWindow",
"PyQt5.QtWidgets.QSpinBox",
"PyQt5.QtGui.QFont",
"PyQt5.QtWidgets.QSizePolicy",
"PyQt5.QtWidgets.QSpacerItem",
"PyQt5.QtCore.QMetaObject.connectSlotsByName",
"PyQt5.QtCore.QRect",
"PyQt5.QtWidgets.QGridLayout",
"PyQt5.QtWidgets.QStatusBar",... | [((7590, 7622), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (7612, 7622), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((7640, 7663), 'PyQt5.QtWidgets.QMainWindow', 'QtWidgets.QMainWindow', ([], {}), '()\n', (7661, 7663), False, 'from PyQt5 import QtCore, QtG... |
#import director
from director import cameraview
from director import transformUtils
from director import visualization as vis
from director import objectmodel as om
from director.ikparameters import IkParameters
from director.ikplanner import ConstraintSet
from director import polarisplatformplanner
from director imp... | [
"director.visualization.updateFrame",
"director.getDRCBaseDir",
"numpy.array",
"director.visualization.FrameSync",
"director.visualization.showPolyData",
"vtkAll.vtkTransform"
] | [((1181, 1242), 'director.visualization.showPolyData', 'vis.showPolyData', (['self.pointcloud', '"""coursemodel"""'], {'parent': 'None'}), "(self.pointcloud, 'coursemodel', parent=None)\n", (1197, 1242), True, 'from director import visualization as vis\n'), ((1641, 1728), 'director.visualization.updateFrame', 'vis.upda... |
from __future__ import absolute_import
from django.apps import apps
from django.core.management.base import BaseCommand, CommandError
import sys
from djipsum import __VERSION__
from djipsum.fields import DjipsumFields
class Command(BaseCommand):
help = 'To generate awesome lorem ipsum for your model!'
def ... | [
"django.core.management.base.CommandError",
"djipsum.fields.DjipsumFields",
"django.apps.apps.get_model",
"sys.exit"
] | [((2234, 2281), 'django.apps.apps.get_model', 'apps.get_model', ([], {'app_label': 'app', 'model_name': 'model'}), '(app_label=app, model_name=model)\n', (2248, 2281), False, 'from django.apps import apps\n'), ((1960, 1970), 'sys.exit', 'sys.exit', ([], {}), '()\n', (1968, 1970), False, 'import sys\n'), ((2331, 2346), ... |
from rest_framework import serializers
from rest_framework.serializers import Serializer, SerializerMethodField
class SearchSerializer(Serializer):
id = SerializerMethodField()
topic_source_id = serializers.CharField()
topic_issuer_id = serializers.IntegerField()
topic_type_id = serializers.IntegerFie... | [
"rest_framework.serializers.IntegerField",
"rest_framework.serializers.CharField",
"rest_framework.serializers.SerializerMethodField",
"rest_framework.serializers.BooleanField"
] | [((159, 182), 'rest_framework.serializers.SerializerMethodField', 'SerializerMethodField', ([], {}), '()\n', (180, 182), False, 'from rest_framework.serializers import Serializer, SerializerMethodField\n'), ((205, 228), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {}), '()\n', (226, 228), False... |
import abc
from typing import Dict, List, Deque
import datetime
import numpy
from agnes.algos.base import _BaseAlgo
from agnes.common import logger
from agnes.common.schedules import Saver
from agnes.nns.initializer import _BaseChooser
from agnes.common.envs_prep import DummyVecEnv
class BaseRunner(abc.ABC):
lo... | [
"agnes.common.schedules.Saver",
"numpy.asarray",
"agnes.common.logger.safemean",
"agnes.common.logger.ListLogger"
] | [((327, 346), 'agnes.common.logger.ListLogger', 'logger.ListLogger', ([], {}), '()\n', (344, 346), False, 'from agnes.common import logger\n'), ((366, 373), 'agnes.common.schedules.Saver', 'Saver', ([], {}), '()\n', (371, 373), False, 'from agnes.common.schedules import Saver\n'), ((1269, 1293), 'agnes.common.logger.Li... |
import math
import torch
from torch import nn
class WingLoss(nn.Module):
def __init__(self, omega=10, epsilon=2):
super(WingLoss, self).__init__()
self.omega = omega
self.epsilon = epsilon
def forward(self, pred, target):
y = target
y_hat = pred
delta_y = (y - ... | [
"torch.log",
"math.log"
] | [((461, 499), 'torch.log', 'torch.log', (['(1 + delta_y1 / self.epsilon)'], {}), '(1 + delta_y1 / self.epsilon)\n', (470, 499), False, 'import torch\n'), ((538, 577), 'math.log', 'math.log', (['(1 + self.omega / self.epsilon)'], {}), '(1 + self.omega / self.epsilon)\n', (546, 577), False, 'import math\n')] |
#!/usr/bin/env python3
from collections import defaultdict
def conway_cubes(points, validator, cycles=6):
# prime the default dict with the next iterations values
for point in list(points.keys()):
tmp = [ points[p] for p in validator(*point) ]
del tmp
# run
activate_stack, deactivate_... | [
"collections.defaultdict"
] | [((1059, 1076), 'collections.defaultdict', 'defaultdict', (['bool'], {}), '(bool)\n', (1070, 1076), False, 'from collections import defaultdict\n')] |
from django.contrib import admin
from .models import Actor
# Register your models here.
@admin.register(Actor)
class ActorAdmin(admin.ModelAdmin):
pass
| [
"django.contrib.admin.register"
] | [((91, 112), 'django.contrib.admin.register', 'admin.register', (['Actor'], {}), '(Actor)\n', (105, 112), False, 'from django.contrib import admin\n')] |
from sklearn.preprocessing import OneHotEncoder
import numpy as np
fuel = ['Diesel', 'Petrol', 'LPG', 'CNG']
seller_type = ['Individual', 'Dealer', 'Trustmark Dealer']
transmission = ['Manual', 'Automatic']
owner = ['First Owner', 'Second Owner', 'Third Owner', 'Fourth & Above Owner', 'Test Drive Car']
enc1 = OneHo... | [
"numpy.append",
"sklearn.preprocessing.OneHotEncoder",
"numpy.array"
] | [((315, 353), 'sklearn.preprocessing.OneHotEncoder', 'OneHotEncoder', ([], {'handle_unknown': '"""ignore"""'}), "(handle_unknown='ignore')\n", (328, 353), False, 'from sklearn.preprocessing import OneHotEncoder\n'), ((401, 439), 'sklearn.preprocessing.OneHotEncoder', 'OneHotEncoder', ([], {'handle_unknown': '"""ignore"... |
import unittest
from unittest.mock import Mock
from pyats.topology import Device
from genie.metaparser.util.exceptions import SchemaEmptyParserError
from genie.libs.parser.iosxr.show_dampening import (ShowImDampening,
ShowImDampeningIntf)
class TestShowImDampeni... | [
"genie.libs.parser.iosxr.show_dampening.ShowImDampening",
"unittest.mock.Mock",
"genie.libs.parser.iosxr.show_dampening.ShowImDampeningIntf",
"pyats.topology.Device",
"unittest.main"
] | [((356, 378), 'pyats.topology.Device', 'Device', ([], {'name': '"""aDevice"""'}), "(name='aDevice')\n", (362, 378), False, 'from pyats.topology import Device\n'), ((2755, 2777), 'pyats.topology.Device', 'Device', ([], {'name': '"""aDevice"""'}), "(name='aDevice')\n", (2761, 2777), False, 'from pyats.topology import Dev... |
# Based On:
# https://github.com/kuangliu/pytorch-cifar/blob/master/models/preact_resnet.py
'''Pre-activation ResNet in PyTorch.
Reference:
[1] <NAME>, <NAME>, <NAME>, <NAME>
Identity Mappings in Deep Residual Networks. arXiv:1603.05027
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
class ... | [
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Sequential",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.Linear",
"torch.nn.AdaptiveAvgPool2d",
"torch.flatten"
] | [((531, 556), 'torch.nn.BatchNorm2d', 'nn.BatchNorm2d', (['in_planes'], {}), '(in_planes)\n', (545, 556), True, 'import torch.nn as nn\n'), ((578, 664), 'torch.nn.Conv2d', 'nn.Conv2d', (['in_planes', 'planes'], {'kernel_size': '(3)', 'stride': 'stride', 'padding': '(1)', 'bias': '(False)'}), '(in_planes, planes, kernel... |
from typing import Generic, List, Optional, Tuple, Type, TypeVar
import structlog
from fastapi.encoders import jsonable_encoder
from more_itertools import one
from pydantic import BaseModel
from sqlalchemy import String, cast, or_
from sqlalchemy.inspection import inspect as sa_inspect
from sqlalchemy.orm import Sessi... | [
"structlog.getLogger",
"sqlalchemy.or_",
"sqlalchemy.inspection.inspect",
"sqlalchemy.sql.expression.asc",
"server.db.db.session.query",
"server.db.db.session.delete",
"more_itertools.one",
"sqlalchemy.sql.expression.desc",
"server.db.db.session.refresh",
"sqlalchemy.cast",
"server.db.db.session... | [((483, 504), 'structlog.getLogger', 'structlog.getLogger', ([], {}), '()\n', (502, 504), False, 'import structlog\n'), ((518, 555), 'typing.TypeVar', 'TypeVar', (['"""ModelType"""'], {'bound': 'BaseModel'}), "('ModelType', bound=BaseModel)\n", (525, 555), False, 'from typing import Generic, List, Optional, Tuple, Type... |
import numpy as np
from matplotlib import pyplot as plt
def plot_interval(X,Y,ratio=1):
m = int(len(X) * ratio)
X = X[0:m]
Y = Y[0:m]
c = list()
for idx in range(m):
if Y[idx]==1:
c.append('r')
else:
c.append('b')
fig = plt.figure()
plt.scatter(X,Y,c=... | [
"matplotlib.pyplot.Circle",
"matplotlib.pyplot.savefig",
"numpy.where",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.axis"
] | [((285, 297), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (295, 297), True, 'from matplotlib import pyplot as plt\n'), ((302, 324), 'matplotlib.pyplot.scatter', 'plt.scatter', (['X', 'Y'], {'c': 'c'}), '(X, Y, c=c)\n', (313, 324), True, 'from matplotlib import pyplot as plt\n'), ((327, 360), 'matplotlib... |
"""
Example to introduce how to read a IP camera
"""
# Import the required packages
import cv2
import argparse
# We first create the ArgumentParser object
# The created object 'parser' will have the necessary information
# to parse the command-line arguments into data types.
parser = argparse.ArgumentParser()
# We a... | [
"argparse.ArgumentParser",
"cv2.imshow",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"cv2.cvtColor",
"cv2.waitKey"
] | [((287, 312), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (310, 312), False, 'import argparse\n'), ((650, 679), 'cv2.VideoCapture', 'cv2.VideoCapture', (['args.ip_url'], {}), '(args.ip_url)\n', (666, 679), False, 'import cv2\n'), ((1545, 1568), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows... |
from django.utils import timezone
from django.test import TestCase
from django.contrib.auth.models import Group, Permission, AnonymousUser
from articles.models import Article
from organisations.models import Organisation
from user_managements.models import IUser
class ArticleTests (TestCase):
def setUp(self):
... | [
"user_managements.models.IUser.objects.create_user",
"user_managements.models.IUser.objects.get",
"django.contrib.auth.models.Permission.objects.get",
"django.contrib.auth.models.Group.objects.get",
"django.contrib.auth.models.AnonymousUser",
"django.contrib.auth.models.Group.objects.get_or_create",
"or... | [((529, 575), 'user_managements.models.IUser.objects.create_user', 'IUser.objects.create_user', ([], {'username': '"""norus111"""'}), "(username='norus111')\n", (554, 575), False, 'from user_managements.models import IUser\n'), ((640, 714), 'user_managements.models.IUser.objects.create_superuser', 'IUser.objects.create... |
# Generated by Django 3.1.5 on 2021-02-02 10:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cars', '0008_auto_20210202_1221'),
]
operations = [
migrations.RemoveField(
model_name='car',
name='coupe',
... | [
"django.db.migrations.RemoveField",
"django.db.models.CharField"
] | [((232, 286), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""car"""', 'name': '"""coupe"""'}), "(model_name='car', name='coupe')\n", (254, 286), False, 'from django.db import migrations, models\n'), ((431, 633), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[... |
"""Defines the neural network, losss function and metrics"""
import warnings
from sklearn.metrics import accuracy_score
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models as models
class MultiOutputMobileNetModel(nn.Module):
def __init__(self, params):
... | [
"torch.nn.Dropout",
"warnings.catch_warnings",
"torchvision.models.mobilenet_v2",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.functional.cross_entropy",
"warnings.simplefilter",
"torch.nn.Linear",
"torch.flatten"
] | [((2161, 2219), 'torch.nn.functional.cross_entropy', 'F.cross_entropy', (["outputs['insect']", "labels['insect_label']"], {}), "(outputs['insect'], labels['insect_label'])\n", (2176, 2219), True, 'import torch.nn.functional as F\n'), ((2236, 2290), 'torch.nn.functional.cross_entropy', 'F.cross_entropy', (["outputs['bir... |
#!/usr/bin/env python3
# --------------------( LICENSE )--------------------
# Copyright (c) 2014-2021 Beartype authors.
# See "LICENSE" for further details.
'''
Project-wide **Python interpreter** utilities.
This private submodule is *not* intended for importation by downstream callers.
'''... | [
"platform.python_implementation"
] | [((876, 899), 'platform.python_implementation', 'python_implementation', ([], {}), '()\n', (897, 899), False, 'from platform import python_implementation\n')] |
from Helpers.FileHelpers import read_lines, read_2D_array
from sys import maxsize
from typing import List, Set, Tuple
FILEPATH = "2021/Input/day11.txt"
FLASH_THRESHOLD = 9
def flash_adjacent_cells(octopi: List[List[int]], row: int, col: int) -> None:
delta = range(-1, 2, 1)
row_bound, col_bound = len(octopi) - ... | [
"Helpers.FileHelpers.read_2D_array"
] | [((1645, 1673), 'Helpers.FileHelpers.read_2D_array', 'read_2D_array', (['FILEPATH', 'int'], {}), '(FILEPATH, int)\n', (1658, 1673), False, 'from Helpers.FileHelpers import read_lines, read_2D_array\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from editfrontmatter import EditFrontMatter
import os
import glob
def main():
template_str = "".join(open(os.path.abspath("docs/template.j2"), "r").readlines())
md_files = glob.glob("./docs/**/*.md", recursive=True)
for path in md_files:
github_base_... | [
"os.path.abspath",
"editfrontmatter.EditFrontMatter",
"glob.glob"
] | [((230, 273), 'glob.glob', 'glob.glob', (['"""./docs/**/*.md"""'], {'recursive': '(True)'}), "('./docs/**/*.md', recursive=True)\n", (239, 273), False, 'import glob\n'), ((596, 654), 'editfrontmatter.EditFrontMatter', 'EditFrontMatter', ([], {'file_path': 'path', 'template_str': 'template_str'}), '(file_path=path, temp... |
import numpy as np
from math import pi
from os.path import join
import matplotlib.pyplot as plt
from src import MLEnergy, list_tl_files
plt.ion()
source_depth = 'shallow'
#source_depth = 'deep'
def one_freq(fc):
tl_list = list_tl_files(fc, source_depth=source_depth)
x_s = []
e_ri = []
e_ri_0 = []
... | [
"numpy.savez",
"src.MLEnergy",
"numpy.array",
"matplotlib.pyplot.ion",
"src.list_tl_files"
] | [((138, 147), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (145, 147), True, 'import matplotlib.pyplot as plt\n'), ((1245, 1319), 'numpy.savez', 'np.savez', (["('data/processed/bg_ri_eng_' + source_depth + '.npz')"], {}), "('data/processed/bg_ri_eng_' + source_depth + '.npz', **save_dict)\n", (1253, 1319), Tru... |
from pydantic import BaseModel, Field
NUMBER = 123
class A(BaseModel):
a: int = Field(int(123))
b = Field(123)
c = Field(default=int(123))
d: int = Field(...)
e: int = Field(NUMBER)
f: int = Field(default=NUMBER)
g = Field(NUMBER)
h: int = Field(NUMBER)
i: int = Field(default=NUM... | [
"pydantic.Field"
] | [((112, 122), 'pydantic.Field', 'Field', (['(123)'], {}), '(123)\n', (117, 122), False, 'from pydantic import BaseModel, Field\n'), ((168, 178), 'pydantic.Field', 'Field', (['...'], {}), '(...)\n', (173, 178), False, 'from pydantic import BaseModel, Field\n'), ((192, 205), 'pydantic.Field', 'Field', (['NUMBER'], {}), '... |
# vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# Python camera library for the Rasperry-Pi camera module
# Copyright (c) 2013-2017 <NAME> <<EMAIL>>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributio... | [
"fractions.Fraction",
"picamera.color.Color.from_yuv",
"time.sleep",
"pytest.raises",
"picamera.color.Color",
"verify.isclose",
"decimal.Decimal"
] | [((4191, 4205), 'picamera.color.Color', 'Color', (['"""black"""'], {}), "('black')\n", (4196, 4205), False, 'from picamera.color import Color\n'), ((4243, 4257), 'picamera.color.Color', 'Color', (['"""white"""'], {}), "('white')\n", (4248, 4257), False, 'from picamera.color import Color\n'), ((4295, 4320), 'picamera.co... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
"logging.getLogger",
"tvm.auto_scheduler.get_shape_from_rewritten_layout",
"tvm.te.max",
"tvm.auto_scheduler.remove_index_check",
"tvm.auto_scheduler.rewrite_compute_body",
"tvm.tir.expr.SizeVar",
"tvm.te.compute",
"tvm.auto_scheduler.rewrite_tensor_shape",
"tvm.te.reduce_axis"
] | [((959, 984), 'logging.getLogger', 'logging.getLogger', (['"""topi"""'], {}), "('topi')\n", (976, 984), False, 'import logging\n'), ((3483, 3516), 'tvm.te.reduce_axis', 'te.reduce_axis', (['(0, XK)'], {'name': '"""k"""'}), "((0, XK), name='k')\n", (3497, 3516), False, 'from tvm import auto_scheduler, te\n'), ((5394, 55... |
"""
File: anagram.py
Name: <NAME> 曾迺芩
----------------------------------
This program recursively finds all the anagram(s)
for the word input by user and terminates when the
input string matches the EXIT constant defined
at line 19
If you correctly implement this program, you should see the
number of anagrams for each... | [
"time.time"
] | [((935, 946), 'time.time', 'time.time', ([], {}), '()\n', (944, 946), False, 'import time\n'), ((1281, 1292), 'time.time', 'time.time', ([], {}), '()\n', (1290, 1292), False, 'import time\n')] |
from collections import OrderedDict
expected = OrderedDict(
[("type", "section"), ("id", u"s1"), ("title", u"Introduction <i>section</i>")]
)
| [
"collections.OrderedDict"
] | [((48, 144), 'collections.OrderedDict', 'OrderedDict', (["[('type', 'section'), ('id', u's1'), ('title', u'Introduction <i>section</i>')]"], {}), "([('type', 'section'), ('id', u's1'), ('title',\n u'Introduction <i>section</i>')])\n", (59, 144), False, 'from collections import OrderedDict\n')] |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (c) 2014-2019, <NAME> <EMAIL>
from os.path import join, dirname
from vunit import VUnit, read_json,... | [
"os.path.dirname",
"vunit.encode_json",
"os.path.join",
"vunit.VUnit.from_argv"
] | [((343, 360), 'os.path.dirname', 'dirname', (['__file__'], {}), '(__file__)\n', (350, 360), False, 'from os.path import join, dirname\n'), ((369, 386), 'vunit.VUnit.from_argv', 'VUnit.from_argv', ([], {}), '()\n', (384, 386), False, 'from vunit import VUnit, read_json, encode_json\n'), ((463, 491), 'os.path.join', 'joi... |
import jax.numpy as jnp
from jax import jit, random, grad
from jax.experimental import stax
from jax.experimental.stax import (AvgPool, BatchNorm, Conv, Dense, FanInSum,
FanOut, Flatten, GeneralConv, Identity,
MaxPool, Relu, LogSoftmax)
def convBloc... | [
"jax.experimental.stax.Conv",
"jax.experimental.stax.FanOut",
"jax.experimental.stax.BatchNorm",
"jax.experimental.stax.Dense",
"jax.experimental.stax.parallel",
"jax.experimental.stax.shape_dependent",
"jax.experimental.stax.AvgPool",
"jax.experimental.stax.GeneralConv",
"jax.experimental.stax.MaxP... | [((805, 834), 'jax.experimental.stax.parallel', 'stax.parallel', (['Main', 'Shortcut'], {}), '(Main, Shortcut)\n', (818, 834), False, 'from jax.experimental import stax\n'), ((1347, 1383), 'jax.experimental.stax.shape_dependent', 'stax.shape_dependent', (['construct_main'], {}), '(construct_main)\n', (1367, 1383), Fals... |
import cx_Freeze
import glob
import os
executables = [cx_Freeze.Executable("Deacons.py")]
includes = [
"Cache",
"Common",
"Config",
"w_Causes",
"w_CausesForYear",
"w_Deposits",
"w_Donators",
"w_DonatorsForYear",
"w_Elders",
"w_TaxReceipts... | [
"cx_Freeze.Executable",
"os.path.basename",
"glob.glob"
] | [((485, 513), 'glob.glob', 'glob.glob', (['"""/usr/lib/libwx*"""'], {}), "('/usr/lib/libwx*')\n", (494, 513), False, 'import glob\n'), ((55, 89), 'cx_Freeze.Executable', 'cx_Freeze.Executable', (['"""Deacons.py"""'], {}), "('Deacons.py')\n", (75, 89), False, 'import cx_Freeze\n'), ((527, 549), 'os.path.basename', 'os.p... |
#!/usr/bin/env python
import sys
import rospy
from std_msgs.msg import Int32MultiArray
rospy.init_node('lightsensors')
pub = rospy.Publisher('lightsensors', Int32MultiArray, queue_size=2)
rate = rospy.Rate(10)
while not rospy.is_shutdown():
with open('/dev/rtlightsensor0','r') as f:
data = f.readline().sp... | [
"rospy.is_shutdown",
"std_msgs.msg.Int32MultiArray",
"rospy.init_node",
"rospy.Rate",
"rospy.Publisher"
] | [((88, 119), 'rospy.init_node', 'rospy.init_node', (['"""lightsensors"""'], {}), "('lightsensors')\n", (103, 119), False, 'import rospy\n'), ((126, 188), 'rospy.Publisher', 'rospy.Publisher', (['"""lightsensors"""', 'Int32MultiArray'], {'queue_size': '(2)'}), "('lightsensors', Int32MultiArray, queue_size=2)\n", (141, 1... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
See <https://stackoverflow.com/a/55007852/1698443>
"""
import pipdeptree # type: ignore # pylint: disable=E0401
import json
#import sys
pkgs = pipdeptree.get_installed_distributions()
tree = pipdeptree.PackageDAG.from_pkgs(pkgs)
print(pipdeptree.render_json_tree(tr... | [
"pipdeptree.get_installed_distributions",
"pipdeptree.render_json_tree",
"pipdeptree.PackageDAG.from_pkgs"
] | [((197, 237), 'pipdeptree.get_installed_distributions', 'pipdeptree.get_installed_distributions', ([], {}), '()\n', (235, 237), False, 'import pipdeptree\n'), ((246, 283), 'pipdeptree.PackageDAG.from_pkgs', 'pipdeptree.PackageDAG.from_pkgs', (['pkgs'], {}), '(pkgs)\n', (277, 283), False, 'import pipdeptree\n'), ((290, ... |
from typing import Any, Callable
from plum import dispatch
from jax.experimental import loops
import numpy as np
import jax
import jax.numpy as jnp
from jax.experimental import host_callback as hcb
from ode4jax.base import init, postamble
from .problem import ODEProblem
from .integrator import ODEIntegrator
from ... | [
"jax.numpy.logical_not",
"ode4jax.base.init",
"jax.numpy.abs",
"ode4jax.base.postamble",
"jax.lax.while_loop",
"jax.numpy.asarray",
"jax.numpy.maximum",
"jax.numpy.isnan",
"jax.numpy.finfo",
"jax.jit",
"jax.numpy.all",
"jax.numpy.minimum",
"jax.numpy.logical_or",
"jax.lax.cond"
] | [((1945, 1959), 'jax.jit', 'jax.jit', (['_step'], {}), '(_step)\n', (1952, 1959), False, 'import jax\n'), ((480, 515), 'ode4jax.base.init', 'init', (['problem', 'alg', '*args'], {}), '(problem, alg, *args, **kwargs)\n', (484, 515), False, 'from ode4jax.base import init, postamble\n'), ((1200, 1251), 'jax.lax.while_loop... |
"""
Explain complex things in simple terms
"""
from concurrent.futures import thread
import inspect
import os
import re
import sys
import threading
import time
import feynman.server
ispath = re.compile(r".*[/\\]")
ispyfile = re.compile(r".*\.py$")
file2mod = re.compile(r".*python[23].[0-9]*[/\\](.*)")
path2mod = re.... | [
"inspect.getargs",
"re.compile",
"sys.setprofile",
"inspect.currentframe",
"os.path.join",
"re.match",
"time.sleep",
"os.path.dirname",
"threading.setprofile",
"os._exit",
"re.sub",
"time.time"
] | [((194, 217), 're.compile', 're.compile', (['""".*[/\\\\\\\\]"""'], {}), "('.*[/\\\\\\\\]')\n", (204, 217), False, 'import re\n'), ((228, 250), 're.compile', 're.compile', (['""".*\\\\.py$"""'], {}), "('.*\\\\.py$')\n", (238, 250), False, 'import re\n'), ((262, 306), 're.compile', 're.compile', (['""".*python[23].[0-9]... |
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
import numpy as np
import cntk as C
import pytest
def test_slice_stride():
c... | [
"cntk.internal.sanitize_value",
"numpy.ones",
"cntk.constant",
"cntk.parameter"
] | [((438, 457), 'cntk.constant', 'C.constant', ([], {'value': '(2)'}), '(value=2)\n', (448, 457), True, 'import cntk as C\n'), ((677, 720), 'cntk.internal.sanitize_value', 'sanitize_value', (['(2, 3)', '(1)', 'np.float32', 'None'], {}), '((2, 3), 1, np.float32, None)\n', (691, 720), False, 'from cntk.internal import sani... |
import distutils.cmd
from setuptools import setup, find_packages
import setuptools.command.build_py
import ib_tws_server.codegen.main
import os.path
class CodegenCommand(distutils.cmd.Command):
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
dir ... | [
"setuptools.setup"
] | [((698, 934), 'setuptools.setup', 'setup', ([], {'name': '"""ib_tws_server"""', 'version': '"""0.0"""', 'description': '"""Interactive Brokers TWS Server"""', 'author': '"""<NAME>"""', 'url': '"""https://github.com/ncpenke/py_ib_tws_server"""', 'cmdclass': "{'codegen': CodegenCommand, 'build_py': BuildPyCommand}"}), "(... |
"""
Tests for FeaturizedSamples class
"""
import os
import unittest
import tempfile
import shutil
import deepchem as dc
def test_unlabelled():
current_dir = os.path.dirname(os.path.abspath(__file__))
input_file = os.path.join(current_dir, "../../data/tests/no_labels.csv")
featurizer = dc.feat.CircularFingerpri... | [
"deepchem.splits.RandomSplitter",
"deepchem.data.CSVLoader",
"shutil.move",
"os.path.join",
"os.path.realpath",
"deepchem.splits.ScaffoldSplitter",
"tempfile.mkdtemp",
"deepchem.feat.CircularFingerprint",
"os.path.abspath",
"deepchem.data.DiskDataset"
] | [((220, 279), 'os.path.join', 'os.path.join', (['current_dir', '"""../../data/tests/no_labels.csv"""'], {}), "(current_dir, '../../data/tests/no_labels.csv')\n", (232, 279), False, 'import os\n'), ((295, 333), 'deepchem.feat.CircularFingerprint', 'dc.feat.CircularFingerprint', ([], {'size': '(1024)'}), '(size=1024)\n',... |
import copy
import logging
from pathlib import Path
from typing import List, Tuple
from callable_journal import journal, journal_init, DROP_RESULT
logger = logging.getLogger()
def motivation(a: int, b: List[int]) -> Tuple[int, List[int]]:
multiplied = [a * b_item for b_item in b]
return sum(multiplied), mul... | [
"logging.getLogger",
"pathlib.Path",
"callable_journal.journal",
"copy.deepcopy"
] | [((158, 177), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (175, 177), False, 'import logging\n'), ((1501, 1557), 'callable_journal.journal', 'journal', ([], {'result_names': "['total_sum', 'multiplied_values']"}), "(result_names=['total_sum', 'multiplied_values'])\n", (1508, 1557), False, 'from callable... |
import batchOpenMPI
batchOpenMPI.begin_MPI_loop()
print('Basic test to see if mpirun hangs is no end_MPI_loop is called on the master')
| [
"batchOpenMPI.begin_MPI_loop"
] | [((21, 50), 'batchOpenMPI.begin_MPI_loop', 'batchOpenMPI.begin_MPI_loop', ([], {}), '()\n', (48, 50), False, 'import batchOpenMPI\n')] |
from iotbot.decorators import equal_content
from iotbot.sugar import Text
# 下面三个函数名不能改,否则不会调用
# 但是都是可选项,建议把不需要用到的函数删除,节约资源
@equal_content('middleware')
def receive_group_msg(ctx):
print('------------------')
print(dir(ctx))
if hasattr(ctx, 'master'):
print(ctx.master)
print(type(ctx))
... | [
"iotbot.decorators.equal_content",
"iotbot.sugar.Text"
] | [((127, 154), 'iotbot.decorators.equal_content', 'equal_content', (['"""middleware"""'], {}), "('middleware')\n", (140, 154), False, 'from iotbot.decorators import equal_content\n'), ((325, 341), 'iotbot.sugar.Text', 'Text', (['ctx.master'], {}), '(ctx.master)\n', (329, 341), False, 'from iotbot.sugar import Text\n')] |
# 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.model.fields.Many2One",
"netforce.model.get_model",
"netforce.access.check_permission_other",
"netforce.model.fields.One2Many",
"netforce.model.fields.Many2Many",
"netforce.model.fields.Selection",
"netforce.model.fields.Char",
"netforce.access.get_active_user"
] | [((1411, 1504), 'netforce.model.fields.Many2One', 'fields.Many2One', (['"""stock.location"""', '"""From Location"""'], {'condition': "[['type', '=', 'internal']]"}), "('stock.location', 'From Location', condition=[['type', '=',\n 'internal']])\n", (1426, 1504), False, 'from netforce.model import Model, fields, get_m... |
# -*- coding: utf-8 -*-
import unittest
import io
import numpy as np
from itertools import islice
from xnmt.input import PlainTextReader
from xnmt.embedder import PretrainedSimpleWordEmbedder
from xnmt.model_context import ModelContext, PersistentParamCollection
import xnmt.events
class PretrainedSimpleWordEmbedde... | [
"xnmt.embedder.PretrainedSimpleWordEmbedder",
"itertools.islice",
"xnmt.model_context.PersistentParamCollection",
"io.open",
"numpy.array",
"xnmt.input.PlainTextReader",
"xnmt.model_context.ModelContext"
] | [((419, 436), 'xnmt.input.PlainTextReader', 'PlainTextReader', ([], {}), '()\n', (434, 436), False, 'from xnmt.input import PlainTextReader\n'), ((551, 565), 'xnmt.model_context.ModelContext', 'ModelContext', ([], {}), '()\n', (563, 565), False, 'from xnmt.model_context import ModelContext, PersistentParamCollection\n'... |
import argparse
import logging
import random
import shutil
import typing as t
from pathlib import Path
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(description="Preprocess dataset.")
# fmt: off
parser.add_argument("--preprocessed_dset", "-d", type=Path, required=True, help="Pr... | [
"logging.basicConfig",
"random.shuffle",
"argparse.ArgumentParser",
"shutil.copy",
"logging.info"
] | [((158, 216), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Preprocess dataset."""'}), "(description='Preprocess dataset.')\n", (181, 216), False, 'import argparse\n'), ((758, 785), 'random.shuffle', 'random.shuffle', (['dset_images'], {}), '(dset_images)\n', (772, 785), False, 'import ... |
from setuptools import setup
name = "nn_logger"
pkgs = [name]
setup(name=name,
version="0.1",
description='Tool for logging for deep learning training process',
author='<NAME>',
author_email='<EMAIL>',
license='MIT',
packages=pkgs,
py_modules=['__init__'],
zip_safe=False... | [
"setuptools.setup"
] | [((63, 287), 'setuptools.setup', 'setup', ([], {'name': 'name', 'version': '"""0.1"""', 'description': '"""Tool for logging for deep learning training process"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'license': '"""MIT"""', 'packages': 'pkgs', 'py_modules': "['__init__']", 'zip_safe': '(False)'})... |
#!/usr/bin/env python3
# Copyright 2019 ZTE corporation. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import re
import os
import subprocess
def _get_source_files(root_path):
file_name_regex = re.compile(r'(.*\.)?(BUILD|WORKSPACE)|.*\.(bzl|bazel)')
for path, dirs, file_names in os.walk(root_pa... | [
"re.compile",
"subprocess.run",
"os.path.join",
"os.getcwd",
"os.walk"
] | [((214, 270), 're.compile', 're.compile', (['"""(.*\\\\.)?(BUILD|WORKSPACE)|.*\\\\.(bzl|bazel)"""'], {}), "('(.*\\\\.)?(BUILD|WORKSPACE)|.*\\\\.(bzl|bazel)')\n", (224, 270), False, 'import re\n'), ((305, 323), 'os.walk', 'os.walk', (['root_path'], {}), '(root_path)\n', (312, 323), False, 'import os\n'), ((595, 606), 'o... |
# Generated by Django 3.1 on 2020-09-17 07:25
import django.contrib.postgres.fields
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Cre... | [
"django.db.models.FloatField",
"django.db.models.TextField",
"django.db.models.TimeField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.PositiveIntegerField",
"django.db.models.ImageField",
"django.db.models.CharField"
] | [((4579, 4695), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'django.db.models.deletion.CASCADE', 'related_name': '"""menu"""', 'to': '"""restaurants.menugroup"""'}), "(on_delete=django.db.models.deletion.CASCADE, related_name\n ='menu', to='restaurants.menugroup')\n", (4596, 4695), False, ... |
#!/usr/bin/python
from socket import *
import threading
import sys
from time import sleep
import cPickle as pickle
class Network:
running = True
def __init__(self, broadcast_addr = "<broadcast>", port = 9988):
self.port = port
self.broadcast_addr = broadcast_addr
#configure send soc... | [
"threading.Thread",
"cPickle.loads",
"cPickle.dumps"
] | [((742, 782), 'threading.Thread', 'threading.Thread', ([], {'target': 'self.rcvMessage'}), '(target=self.rcvMessage)\n', (758, 782), False, 'import threading\n'), ((1356, 1381), 'cPickle.dumps', 'pickle.dumps', (['message', '(-1)'], {}), '(message, -1)\n', (1368, 1381), True, 'import cPickle as pickle\n'), ((1094, 1122... |
import click
import pytest
from click_extensions import decorators
class ErrorA(Exception):
pass
class ErrorB(Exception):
pass
@click.command()
@decorators.catch_exception(ErrorA)
def throw_A():
raise ErrorA
@click.command()
@decorators.catch_exception(ErrorA)
def throw_B():
raise ErrorB
@cli... | [
"pytest.mark.parametrize",
"click.command",
"click_extensions.decorators.catch_exception"
] | [((143, 158), 'click.command', 'click.command', ([], {}), '()\n', (156, 158), False, 'import click\n'), ((160, 194), 'click_extensions.decorators.catch_exception', 'decorators.catch_exception', (['ErrorA'], {}), '(ErrorA)\n', (186, 194), False, 'from click_extensions import decorators\n'), ((230, 245), 'click.command',... |
# /Disk1/XR/XR Color Consistency/第一帧/虚实融合.png
import cv2
import numpy as np
case=4
if case==1:
target = '/Disk1/XR/XR Color Consistency/第一帧/虚拟场景.png'
src = '/Disk1/XR/XR Color Consistency/第一帧/虚实融合.png'
mask = '/Disk1/XR/XR Color Consistency/第一帧/mask.png'
elif case == 2:
target = '/Disk1/Projects/Blend/... | [
"cv2.seamlessClone",
"cv2.imwrite",
"cv2.imread"
] | [((808, 826), 'cv2.imread', 'cv2.imread', (['src', '(1)'], {}), '(src, 1)\n', (818, 826), False, 'import cv2\n'), ((837, 858), 'cv2.imread', 'cv2.imread', (['target', '(1)'], {}), '(target, 1)\n', (847, 858), False, 'import cv2\n'), ((870, 908), 'cv2.imread', 'cv2.imread', (['mask', 'cv2.IMREAD_GRAYSCALE'], {}), '(mask... |
import pandas as pd
import numpy as np
target_file = '../anna-0530/data/target.csv'
key1='source_id'
#selected_file = '../anna-0530/data/selected2.csv'
selected_file = '../anna-0530/data/target.csv'
#key2='gaiaID'
key2='source_id'
result_file = 'result.csv'
df1=pd.read_csv(target_file, sep=',')
#df2=pd.read_csv(sele... | [
"pandas.concat",
"pandas.read_csv"
] | [((265, 298), 'pandas.read_csv', 'pd.read_csv', (['target_file'], {'sep': '""","""'}), "(target_file, sep=',')\n", (276, 298), True, 'import pandas as pd\n'), ((362, 397), 'pandas.read_csv', 'pd.read_csv', (['selected_file'], {'sep': '""","""'}), "(selected_file, sep=',')\n", (373, 397), True, 'import pandas as pd\n'),... |
import os
from newsapi import NewsApiClient
import datetime
# Init
api_key = os.environ.get('api_key')
newsapi = NewsApiClient(api_key=api_key)
#sources
sources = 'abc-news, al-jazeera-english,ars-technica,bbc-news,bbc-sport,bleacher-report,bloomberg,business-insider,buzzfeed,cnn,crypto-coins-news, entertainment-week... | [
"datetime.timedelta",
"datetime.date.today",
"os.environ.get",
"newsapi.NewsApiClient"
] | [((78, 103), 'os.environ.get', 'os.environ.get', (['"""api_key"""'], {}), "('api_key')\n", (92, 103), False, 'import os\n'), ((114, 144), 'newsapi.NewsApiClient', 'NewsApiClient', ([], {'api_key': 'api_key'}), '(api_key=api_key)\n', (127, 144), False, 'from newsapi import NewsApiClient\n'), ((622, 643), 'datetime.date.... |
"""Command 2."""
import click
@click.command()
@click.option('--count', default=1, help='Loop count.')
@click.option('--name', prompt='Your name', help='The person to greet.')
def main(count, name):
"""Run sample command.
This is a sample command.
"""
for x in range(count):
click.echo(f"Hell... | [
"click.option",
"click.echo",
"click.command"
] | [((34, 49), 'click.command', 'click.command', ([], {}), '()\n', (47, 49), False, 'import click\n'), ((51, 105), 'click.option', 'click.option', (['"""--count"""'], {'default': '(1)', 'help': '"""Loop count."""'}), "('--count', default=1, help='Loop count.')\n", (63, 105), False, 'import click\n'), ((107, 178), 'click.o... |
# external imports
import os
import errno
from jinja2 import Template
def render_template(template, out_dir='.', context=None):
'''
This function renders the template desginated by the argument to the
designated directory using the given context.
Args:
template (string) : the s... | [
"os.path.exists",
"os.makedirs",
"os.path.join",
"jinja2.Template",
"os.path.dirname",
"os.path.isdir",
"os.path.abspath",
"os.walk",
"os.path.relpath"
] | [((922, 949), 'os.walk', 'os.walk', (['template_directory'], {}), '(template_directory)\n', (929, 949), False, 'import os\n'), ((595, 620), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (610, 620), False, 'import os\n'), ((1847, 1895), 'os.path.relpath', 'os.path.relpath', (['source_file', '... |
import pytest
from dataclasses import dataclass
from ansys.grantami.bomanalytics import queries
from .inputs import sample_bom
class MockRecordDefinition:
@dataclass
class Definition:
reference_type: str
reference_value: str
def __init__(self, reference_type: str, reference_value: str):
... | [
"ansys.grantami.bomanalytics.queries._BomQueryDataManager",
"pytest.mark.parametrize",
"pytest.raises",
"ansys.grantami.bomanalytics.queries._RecordQueryDataManager"
] | [((1743, 1807), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""reference_type"""', "['test_string', None]"], {}), "('reference_type', ['test_string', None])\n", (1766, 1807), False, 'import pytest\n'), ((1813, 1878), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""reference_value"""', "['test_s... |
from rdflib import RDF, RDFS, Namespace as RDFNamespace
# Namespace identifiers
OWL = RDFNamespace("http://www.w3.org/2002/07/owl#")
SCTF = RDFNamespace("http://snomed.info/field/")
SCT = RDFNamespace("http://snomed.info/id/")
SCTM = RDFNamespace("http://snomed.info/sct/")
SCTID = int
required_namespaces = {"owl": ... | [
"rdflib.Namespace"
] | [((88, 134), 'rdflib.Namespace', 'RDFNamespace', (['"""http://www.w3.org/2002/07/owl#"""'], {}), "('http://www.w3.org/2002/07/owl#')\n", (100, 134), True, 'from rdflib import RDF, RDFS, Namespace as RDFNamespace\n'), ((142, 183), 'rdflib.Namespace', 'RDFNamespace', (['"""http://snomed.info/field/"""'], {}), "('http://s... |
from datetime import datetime
from hacker_news.ops.download_items import build_comments, build_stories, download_items
from hacker_news.ops.id_range_for_time import id_range_for_time
from hacker_news.resources import RESOURCES_LOCAL, RESOURCES_PROD, RESOURCES_STAGING
from hacker_news.resources.hn_resource import hn_ap... | [
"datetime.datetime",
"hacker_news.ops.id_range_for_time.id_range_for_time",
"hacker_news.resources.hn_resource.hn_api_subsample_client.configured",
"hacker_news.ops.download_items.build_stories",
"hacker_news.ops.download_items.build_comments"
] | [((1073, 1094), 'hacker_news.ops.download_items.build_comments', 'build_comments', (['items'], {}), '(items)\n', (1087, 1094), False, 'from hacker_news.ops.download_items import build_comments, build_stories, download_items\n'), ((1099, 1119), 'hacker_news.ops.download_items.build_stories', 'build_stories', (['items'],... |
import unittest
import sys
sys.path.append('LeetCode/_0051_0100')
from _052_NQueens2 import Solution
class Test_052_NQueens2(unittest.TestCase):
def test_totalNQueens_1(self):
solution = Solution()
result = solution.totalNQueens(1)
self.assertEqual(1, result)
def test_totalNQueens_2(... | [
"_052_NQueens2.Solution",
"sys.path.append"
] | [((28, 66), 'sys.path.append', 'sys.path.append', (['"""LeetCode/_0051_0100"""'], {}), "('LeetCode/_0051_0100')\n", (43, 66), False, 'import sys\n'), ((202, 212), '_052_NQueens2.Solution', 'Solution', ([], {}), '()\n', (210, 212), False, 'from _052_NQueens2 import Solution\n'), ((346, 356), '_052_NQueens2.Solution', 'S... |
"""Hierarchical clustering of the data"""
from functools import partial
import logging
import os
import pickle
from typing import Callable, Dict, NamedTuple, NewType
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy.cluster.hierarchy as hcl
import scipy.io as sio
from skimage.io impor... | [
"pickle.dump",
"spdivik._scripting.initialize",
"spdivik.visualize.visualize",
"scipy.cluster.hierarchy.to_mlab_linkage",
"typing.NewType",
"numpy.max",
"spdivik.kmeans._scripting.parsers.assert_configured",
"matplotlib.pyplot.close",
"scipy.cluster.hierarchy.fcluster",
"functools.partial",
"log... | [((503, 539), 'typing.NewType', 'NewType', (['"""LinkageMatrix"""', 'np.ndarray'], {}), "('LinkageMatrix', np.ndarray)\n", (510, 539), False, 'from typing import Callable, Dict, NamedTuple, NewType\n'), ((605, 632), 'typing.NewType', 'NewType', (['"""Dendrogram"""', 'Dict'], {}), "('Dendrogram', Dict)\n", (612, 632), F... |
"""OpenAQ Air Quality Dashboard with Flask."""
from flask import Flask
APP = Flask(__name__)
@APP.route('/')
def root():
"""Base view."""
return 'TODO - part 2 and beyond!'
| [
"flask.Flask"
] | [((78, 93), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (83, 93), False, 'from flask import Flask\n')] |
from needle.cases import NeedleTestCase
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as ec
class TestLogo(NeedleTestCase):
def test_logo(self):
self.driver.get('http://www.bbc.co.uk/news/')
... | [
"selenium.webdriver.support.ui.WebDriverWait",
"selenium.webdriver.support.expected_conditions.presence_of_element_located"
] | [((406, 459), 'selenium.webdriver.support.expected_conditions.presence_of_element_located', 'ec.presence_of_element_located', (["(By.ID, 'idcta-link')"], {}), "((By.ID, 'idcta-link'))\n", (436, 459), True, 'from selenium.webdriver.support import expected_conditions as ec\n'), ((348, 378), 'selenium.webdriver.support.ui... |
import os
import numpy as np
from sklearn.utils import shuffle
from keras.utils import to_categorical
__author__ = '<NAME>'
def get_risk_group(x_trn, c_trn, s_trn, high_risk_th, low_risk_th):
hg = []
lg = []
for n,os in enumerate(s_trn):
if os <= high_risk_th and c_trn[n] == 0:
hg.appe... | [
"sklearn.utils.shuffle",
"numpy.asarray",
"numpy.concatenate",
"keras.utils.to_categorical"
] | [((498, 522), 'numpy.concatenate', 'np.concatenate', (['[hg, lg]'], {}), '([hg, lg])\n', (512, 522), True, 'import numpy as np\n'), ((592, 620), 'numpy.concatenate', 'np.concatenate', (['[hg_y, lg_y]'], {}), '([hg_y, lg_y])\n', (606, 620), True, 'import numpy as np\n'), ((727, 767), 'sklearn.utils.shuffle', 'shuffle', ... |
from pavo_cristatus.interactions.pavo_cristatus_result import PavoCristatusResult
from pavo_cristatus.interactions.pavo_cristatus_status import PavoCristatusStatus
from pavo_cristatus.project_loader.project_loader import load_non_annotated_project
__all__ = ["interact"]
def interact(project_root_path):
"""
... | [
"pavo_cristatus.interactions.pavo_cristatus_result.PavoCristatusResult",
"pavo_cristatus.project_loader.project_loader.load_non_annotated_project"
] | [((584, 629), 'pavo_cristatus.project_loader.project_loader.load_non_annotated_project', 'load_non_annotated_project', (['project_root_path'], {}), '(project_root_path)\n', (610, 629), False, 'from pavo_cristatus.project_loader.project_loader import load_non_annotated_project\n'), ((703, 769), 'pavo_cristatus.interacti... |
#!/usr/bin/env python3
# Copyright 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""Full DrQA pipeline."""
import heapq
import logging
import math
import time
from multiprocessing import Pool... | [
"logging.getLogger",
"numpy.mean",
"heapq.heappushpop",
"numpy.std",
"regex.split",
"numpy.array",
"heapq.heappop",
"multiprocessing.Pool",
"torch.utils.data.DataLoader",
"multiprocessing.util.Finalize",
"heapq.heappush",
"time.time"
] | [((603, 630), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (620, 630), False, 'import logging\n'), ((1087, 1148), 'multiprocessing.util.Finalize', 'Finalize', (['PROCESS_TOK', 'PROCESS_TOK.shutdown'], {'exitpriority': '(100)'}), '(PROCESS_TOK, PROCESS_TOK.shutdown, exitpriority=100)\n',... |
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
import time
import os
BASE_DIR = os.path.dirname(os.path.realpath(__file__))
html_location = os.path.join(BASE_DIR, 'html')
for i in range(21,30):
driver = webdriver.Chrome(ChromeDriverManager().install())
url = f"https://... | [
"os.path.realpath",
"webdriver_manager.chrome.ChromeDriverManager",
"os.path.join",
"time.sleep"
] | [((182, 212), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""html"""'], {}), "(BASE_DIR, 'html')\n", (194, 212), False, 'import os\n'), ((138, 164), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (154, 164), False, 'import os\n'), ((657, 670), 'time.sleep', 'time.sleep', (['(5)'], {}), '... |
#!/usr/bin/env python
"""robotModePublisher.py: Publishes the robot mode according to the received command messages from joystick and navigation stack."""
__author__ = "<NAME>"
__copyright__ = "Copyright 2021, Fraunhofer FKIE"
__license__ = "MIT"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
import rospy
import geo... | [
"rospy.Subscriber",
"rospy.init_node",
"rospy.get_param",
"rospy.get_time",
"rospy.spin",
"rospy.Duration",
"rospy.Publisher"
] | [((471, 525), 'rospy.init_node', 'rospy.init_node', (['"""rosbotModePublisher"""'], {'anonymous': '(True)'}), "('rosbotModePublisher', anonymous=True)\n", (486, 525), False, 'import rospy\n'), ((558, 598), 'rospy.get_param', 'rospy.get_param', (['"""~joy_cmd_timeout"""', '(0.5)'], {}), "('~joy_cmd_timeout', 0.5)\n", (5... |
# -*- coding: utf-8 -*-
from __future__ import print_function
from operator import itemgetter
import re
from .parsers.ssh_config_parser import ConfigParser
from .defaults import get_default
__version__ = '0.6.5'
ERRORS = {
"already_in": "{0} is already in your sshconfig. use storm edit or storm update to modi... | [
"operator.itemgetter"
] | [((2904, 2922), 'operator.itemgetter', 'itemgetter', (['"""host"""'], {}), "('host')\n", (2914, 2922), False, 'from operator import itemgetter\n')] |
from tkinter import *
import datetime
import threading
import feed
import pcap
import string
import crypto
import event
import os
global username
class Chat(Frame):
def save(self, contend):
feed._appendIt(self.username, 'append', contend)
def add(self, username, contend, event=None):
self.t... | [
"datetime.datetime.now",
"pcap.dumpIt",
"feed._appendIt"
] | [((206, 254), 'feed._appendIt', 'feed._appendIt', (['self.username', '"""append"""', 'contend'], {}), "(self.username, 'append', contend)\n", (220, 254), False, 'import feed\n'), ((326, 349), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (347, 349), False, 'import datetime\n'), ((4098, 4121), 'dat... |
import marshmallow as ma
from marshmallow_sqlalchemy import field_for
from marshmallow_toplevel import TopLevelSchema
from api.extensions.api import Schema, AutoSchema
from common.models.drives import Drive
class DriveSchema(AutoSchema):
serial_number = field_for(Drive, "serial_number")
class Meta(AutoSchema... | [
"marshmallow_sqlalchemy.field_for",
"marshmallow.fields.Nested",
"marshmallow.fields.Str"
] | [((260, 293), 'marshmallow_sqlalchemy.field_for', 'field_for', (['Drive', '"""serial_number"""'], {}), "(Drive, 'serial_number')\n", (269, 293), False, 'from marshmallow_sqlalchemy import field_for\n'), ((418, 433), 'marshmallow.fields.Str', 'ma.fields.Str', ([], {}), '()\n', (431, 433), True, 'import marshmallow as ma... |
"""blog URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vi... | [
"django.conf.urls.static.static",
"django.urls.path"
] | [((1468, 1529), 'django.conf.urls.static.static', 'static', (['settings.MEDIA_URL'], {'document_root': 'settings.MEDIA_ROOT'}), '(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)\n', (1474, 1529), False, 'from django.conf.urls.static import static\n'), ((809, 840), 'django.urls.path', 'path', (['"""admin/"""', 'a... |
from typing import Any
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String
Base: Any = declarative_base()
class Example(Base):
__tablename__ = 'Example'
id = Column(Integer, primary_key=True)
name = Column(String)
| [
"sqlalchemy.Column",
"sqlalchemy.ext.declarative.declarative_base"
] | [((141, 159), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', ([], {}), '()\n', (157, 159), False, 'from sqlalchemy.ext.declarative import declarative_base\n'), ((223, 256), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)'}), '(Integer, primary_key=True)\n', (229, 256), False, 'f... |
import pytest
from dynamo.entities import Year, itemToYear # pylint: disable=wrong-import-position
def test_init():
year = Year(
'/', '<NAME>', '2020', 10, 0.1, 0.25,
{ 'www': 0.5, '/blog': 0.25, '/resume': 0.25 },
{ 'www': 0.25, '/blog': 0.5, '/resume': 0.25 }
)
assert year.slug == '/'
assert year... | [
"dynamo.entities.itemToYear",
"dynamo.entities.Year",
"pytest.raises"
] | [((126, 264), 'dynamo.entities.Year', 'Year', (['"""/"""', '"""<NAME>"""', '"""2020"""', '(10)', '(0.1)', '(0.25)', "{'www': 0.5, '/blog': 0.25, '/resume': 0.25}", "{'www': 0.25, '/blog': 0.5, '/resume': 0.25}"], {}), "('/', '<NAME>', '2020', 10, 0.1, 0.25, {'www': 0.5, '/blog': 0.25,\n '/resume': 0.25}, {'www': 0.2... |
import os
import sys
import csv
import json
import math
import enum
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import colors
from os import listdir
from os.path import isfile, join
from skimage import measure
from skimage import filters
from scipy import ndimage
class OutputShapeType(enum.Enum... | [
"matplotlib.pyplot.hist",
"numpy.array",
"numpy.arctan2",
"matplotlib.pyplot.imshow",
"os.listdir",
"matplotlib.colors.ListedColormap",
"numpy.exp",
"numpy.dot",
"matplotlib.pyplot.axis",
"numpy.hypot",
"scipy.ndimage.filters.convolve",
"matplotlib.colors.Normalize",
"matplotlib.pyplot.show"... | [((16786, 16824), 'matplotlib.pyplot.hist', 'plt.hist', (['densities'], {'bins': 'density_bins'}), '(densities, bins=density_bins)\n', (16794, 16824), True, 'import matplotlib.pyplot as plt\n'), ((16827, 16837), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (16835, 16837), True, 'import matplotlib.pyplot as p... |
import gi
import os
import sys
gi.require_version("Notify", "0.7")
sys.path.append(os.path.realpath(os.path.curdir))
from gi.repository import Notify
from .battery_charge_notifier import BatteryChargeNotifier
def load_config():
file = open(
os.path.realpath(os.curdir) + os.sep + "battery_charge_notifier"... | [
"os.path.realpath",
"gi.repository.Notify.init",
"gi.require_version"
] | [((32, 67), 'gi.require_version', 'gi.require_version', (['"""Notify"""', '"""0.7"""'], {}), "('Notify', '0.7')\n", (50, 67), False, 'import gi\n'), ((1287, 1325), 'gi.repository.Notify.init', 'Notify.init', (['"""Battery Charge Notifier"""'], {}), "('Battery Charge Notifier')\n", (1298, 1325), False, 'from gi.reposito... |
import os
import glob
def get_latest_model_file(folder):
"""
returns the location of the newest file in the provided foler path
note: folder path NEEDS to end on a /
returns None if no files were found in given location
"""
files = glob.glob(folder + 'model*.pt')
if files == [... | [
"glob.glob"
] | [((268, 299), 'glob.glob', 'glob.glob', (["(folder + 'model*.pt')"], {}), "(folder + 'model*.pt')\n", (277, 299), False, 'import glob\n')] |
from matplotlib import pyplot as plt
from typing import List
import datetime as dt
import grpc_server.util.codeforces_api as cf
from .graph_common import get_current_figure_as_file, plot_rating_bg, StrWrap
def _plot_rating(resp, mark='o', labels: List[str] = None):
labels = [''] * len(resp) if labels is None else... | [
"datetime.datetime.fromtimestamp",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.plot",
"grpc_server.util.codeforces_api.user.rating",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.legend"
] | [((1411, 1420), 'matplotlib.pyplot.clf', 'plt.clf', ([], {}), '()\n', (1418, 1420), True, 'from matplotlib import pyplot as plt\n'), ((1660, 1696), 'matplotlib.pyplot.legend', 'plt.legend', (['labels'], {'loc': '"""upper left"""'}), "(labels, loc='upper left')\n", (1670, 1696), True, 'from matplotlib import pyplot as p... |
import warnings
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pyDeltaRCM
# filter out the warning raised about no netcdf being found
warnings.filterwarnings("ignore", category=UserWarning)
n = 10
cm = matplotlib.cm.get_cmap('tab10')
# init delta model
with pyDeltaRCM.shared_tools._... | [
"warnings.filterwarnings",
"pyDeltaRCM.DeltaModel",
"matplotlib.cm.get_cmap",
"pyDeltaRCM.debug_tools.plot_domain",
"pyDeltaRCM.shared_tools.custom_unravel",
"numpy.random.randint",
"pyDeltaRCM.shared_tools._docs_temp_directory",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.subplots",
"mat... | [((167, 222), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'UserWarning'}), "('ignore', category=UserWarning)\n", (190, 222), False, 'import warnings\n'), ((237, 268), 'matplotlib.cm.get_cmap', 'matplotlib.cm.get_cmap', (['"""tab10"""'], {}), "('tab10')\n", (259, 268), False, 'i... |
import datetime
from unittest import mock
from cterasdk.core.enum import FileAccessMode
from cterasdk.common import Object
from tests.ut import base_core_services
class BaseCoreServicesFilesPublicLink(base_core_services.BaseCoreServicesTest):
def setUp(self):
super().setUp()
self._path = 'My Fil... | [
"datetime.timedelta",
"datetime.date.today",
"cterasdk.common.Object"
] | [((1084, 1092), 'cterasdk.common.Object', 'Object', ([], {}), '()\n', (1090, 1092), False, 'from cterasdk.common import Object\n'), ((1247, 1255), 'cterasdk.common.Object', 'Object', ([], {}), '()\n', (1253, 1255), False, 'from cterasdk.common import Object\n'), ((1436, 1444), 'cterasdk.common.Object', 'Object', ([], {... |
import subprocess
import time
total_time = 0
def test_FEN(FEN_string):
t0 = time.perf_counter()
output = subprocess.run("./chess", capture_output=True, text=True, input=FEN_string)
t1 = time.perf_counter()
print(output.stdout)
print("Time:", t1-t0, "s")
global total_time
total_time += t1 -... | [
"subprocess.run",
"time.perf_counter"
] | [((82, 101), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (99, 101), False, 'import time\n'), ((115, 190), 'subprocess.run', 'subprocess.run', (['"""./chess"""'], {'capture_output': '(True)', 'text': '(True)', 'input': 'FEN_string'}), "('./chess', capture_output=True, text=True, input=FEN_string)\n", (12... |
import json
hiragana = json.load(open('Vocabularies/hiragana.json'))
katakana = json.load(open('Vocabularies/katakana.json'))
class Instance:
def __init__(self, target, translation, frequency, correct, incorrect):
self.target = target
self.translation = translation
self.frequency = frequen... | [
"json.dumps"
] | [((620, 643), 'json.dumps', 'json.dumps', (['l'], {'indent': '(4)'}), '(l, indent=4)\n', (630, 643), False, 'import json\n')] |
"""Delaunay triangulation with boundary"""
import compas_rhino
from compas.datastructures import Mesh
from compas.topology import delaunay_from_points
from compas_rhino.helpers import MeshArtist
__author__ = ['<NAME>', '<NAME>']
__copyright__ = 'Copyright 2017, BRG - ETH Zurich',
__license__ = 'MIT'
__emai... | [
"compas_rhino.helpers.MeshArtist",
"compas.topology.delaunay_from_points",
"compas_rhino.get_polyline_coordinates",
"compas_rhino.select_polyline",
"compas_rhino.select_polylines",
"compas.datastructures.Mesh.from_vertices_and_faces",
"compas_rhino.get_point_coordinates",
"compas_rhino.select_points"
... | [((414, 458), 'compas_rhino.select_points', 'compas_rhino.select_points', (['"""Select points."""'], {}), "('Select points.')\n", (440, 458), False, 'import compas_rhino\n'), ((468, 509), 'compas_rhino.get_point_coordinates', 'compas_rhino.get_point_coordinates', (['guids'], {}), '(guids)\n', (502, 509), False, 'import... |
from django.db import models
from django.contrib.auth.models import User
def upload_to(instance, filename):
return 'images/users/{0}/{1}'.format(instance.user_id, filename)
class Picture(models.Model):
title = models.CharField(max_length=256)
uploaded = models.DateTimeField(auto_now_add=True)
image_p... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.ImageField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((221, 253), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(256)'}), '(max_length=256)\n', (237, 253), False, 'from django.db import models\n'), ((269, 308), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)'}), '(auto_now_add=True)\n', (289, 308), False, ... |
from contextlib import contextmanager
from typing import Iterator
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import Session, sessionmaker
from products_api.environment import DB
Base = declarative_base()
_SQLALCHEMY_DATABASE_URL = f"postgresql://... | [
"sqlalchemy.orm.sessionmaker",
"sqlalchemy.create_engine",
"sqlalchemy.ext.declarative.declarative_base"
] | [((258, 276), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', ([], {}), '()\n', (274, 276), False, 'from sqlalchemy.ext.declarative import declarative_base\n'), ((385, 424), 'sqlalchemy.create_engine', 'create_engine', (['_SQLALCHEMY_DATABASE_URL'], {}), '(_SQLALCHEMY_DATABASE_URL)\n', (398, 424), Fa... |
from copy import copy
from ..helpers import merge_dicts
from .update import Update
class Prototype:
# Public
def __init__(self, *args, Class, Updates=None, **kwargs):
if Updates is None:
Updates = []
self.__class = Class
self.__updates = copy(Updates)
self.__args ... | [
"copy.copy"
] | [((286, 299), 'copy.copy', 'copy', (['Updates'], {}), '(Updates)\n', (290, 299), False, 'from copy import copy\n'), ((1970, 1990), 'copy.copy', 'copy', (['self.__updates'], {}), '(self.__updates)\n', (1974, 1990), False, 'from copy import copy\n'), ((2563, 2583), 'copy.copy', 'copy', (['self.__updates'], {}), '(self.__... |
from django.shortcuts import render
from django.http import HttpResponse
from .models.products import Product
from .models.categories import Category
# Create your views here.
def index(request):
products = None
categories = Category.get_all_categories()
categoryID = request.GET.get('category')
if cate... | [
"django.shortcuts.render"
] | [((544, 582), 'django.shortcuts.render', 'render', (['request', '"""index.html"""', 'context'], {}), "(request, 'index.html', context)\n", (550, 582), False, 'from django.shortcuts import render\n'), ((617, 647), 'django.shortcuts.render', 'render', (['request', '"""signup.html"""'], {}), "(request, 'signup.html')\n", ... |
from django.conf.urls.defaults import *
from pages.admin import pages_admin
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Example:
# (r'^testpages/', include('testpages.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
# (r'^admin/... | [
"django.contrib.admin.autodiscover"
] | [((110, 130), 'django.contrib.admin.autodiscover', 'admin.autodiscover', ([], {}), '()\n', (128, 130), False, 'from django.contrib import admin\n')] |
'''
Maze Generation Visualizer using Backtracking Algorithm
Python scripts for generating random solvable mazes using the depth-first search and recursive backtracking algorithms.
The code also implements a recursive backtracking pathfinding algorithm for solving the generated mazes.
'''
import pygame
import random... | [
"random.choice",
"pygame.init",
"pygame.quit",
"pygame.event.get",
"pygame.display.set_mode",
"pygame.draw.rect",
"pygame.display.set_caption",
"pygame.display.update"
] | [((321, 334), 'pygame.init', 'pygame.init', ([], {}), '()\n', (332, 334), False, 'import pygame\n'), ((415, 450), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(735, 735)'], {}), '((735, 735))\n', (438, 450), False, 'import pygame\n'), ((450, 484), 'pygame.display.set_caption', 'pygame.display.set_caption', ... |
import logging
import os
import re
import urllib.parse
from typing import Set, List, Iterable, Dict, Optional
import requests
from bauh.api.http import HttpClient
from bauh.gems.arch import AUR_INDEX_FILE, git
from bauh.gems.arch.exceptions import PackageNotFoundException
URL_INFO = 'https://aur.archlinux.org/rpc/?v... | [
"os.path.exists",
"re.compile",
"bauh.gems.arch.git.is_installed",
"bauh.gems.arch.exceptions.PackageNotFoundException",
"re.findall"
] | [((547, 583), 're.compile', 're.compile', (['"""(\\\\w+)\\\\s+=\\\\s+(.+)\\\\n"""'], {}), "('(\\\\w+)\\\\s+=\\\\s+(.+)\\\\n')\n", (557, 583), False, 'import re\n'), ((596, 616), 're.compile', 're.compile', (['"""[<>]?="""'], {}), "('[<>]?=')\n", (606, 616), False, 'import re\n'), ((6559, 6589), 'os.path.exists', 'os.pa... |
#-------------------------------------------------------------------------------
#
# Project: EOxServer <http://eoxserver.org>
# Authors: <NAME> <<EMAIL>>
#
#-------------------------------------------------------------------------------
# Copyright (C) 2014 EOX IT Services GmbH
#
# Permission is hereby granted, free o... | [
"logging.getLogger",
"eoxserver.resources.coverages.models.Collection.objects.get",
"eoxserver.backends.models.get_package_component",
"eoxserver.resources.coverages.models.iscoverage",
"re.compile",
"eoxserver.resources.coverages.models.Collection.objects.filter",
"eoxserver.backends.access.retrieve",
... | [((2033, 2060), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2050, 2060), False, 'import logging\n'), ((2076, 2149), 're.compile', 're.compile', (['"""template\\\\[(?P<value>[a-zA-Z0-9_\\\\[\\\\]]+)\\\\]"""', 're.IGNORECASE'], {}), "('template\\\\[(?P<value>[a-zA-Z0-9_\\\\[\\\\]]+)\\\\... |
import matplotlib as mpl
import uproot3 as uproot
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib.ticker import (MultipleLocator, AutoMinorLocator)
import scipy
import numpy as np
import math
import pandas as pd
import seaborn as sns
import mplhep as hep
#import zfit
import inspect
import sys
... | [
"matplotlib.ticker.NullFormatter",
"numpy.sqrt",
"matplotlib.pyplot.ylabel",
"math.cos",
"math.sinh",
"numpy.arange",
"numpy.histogram",
"argparse.ArgumentParser",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.style.use",
"numpy.diff",
"math.fabs",
"matplotlib.pyplot.axis",
"matplotlib.py... | [((389, 419), 'matplotlib.pyplot.style.use', 'plt.style.use', (['hep.style.ATLAS'], {}), '(hep.style.ATLAS)\n', (402, 419), True, 'import matplotlib.pyplot as plt\n'), ((421, 578), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (["{'font.sans-serif': 'Arial', 'font.family': 'sans-serif', 'font.size': 30,\n... |
from stv.parsers import FormulaParser
def testEval(formula, varValues, expected):
print(" using", varValues, "and expecting", expected)
evaluated = formula.expression.evaluate(varValues)
print(" evaluated to", evaluated)
assert evaluated == expected
fp = FormulaParser()
fs = "<<X,YYY>>F(A... | [
"stv.parsers.FormulaParser"
] | [((285, 300), 'stv.parsers.FormulaParser', 'FormulaParser', ([], {}), '()\n', (298, 300), False, 'from stv.parsers import FormulaParser\n')] |
from ete3 import NCBITaxa
class LineageTracker(object):
# tested
def __init__(self, ids):
# self.names = names
self.ncbi = NCBITaxa()
self.main_ranks = ['superkingdom', 'kingdom', 'phylum', 'class', 'order', 'family', 'genus', 'species']
self.taxa_ids = ids # how to... | [
"ete3.NCBITaxa"
] | [((140, 150), 'ete3.NCBITaxa', 'NCBITaxa', ([], {}), '()\n', (148, 150), False, 'from ete3 import NCBITaxa\n')] |
import setuptools
from typing import List
import glob
from Cython.Build import cythonize
import numpy as np
def get_scripts_from_bin() -> List[str]:
"""Get all local scripts from bin so they are included in the package."""
return glob.glob("bin/*")
def get_package_description() -> str:
"""Returns a desc... | [
"Cython.Build.cythonize",
"setuptools.find_packages",
"glob.glob",
"numpy.get_include"
] | [((240, 258), 'glob.glob', 'glob.glob', (['"""bin/*"""'], {}), "('bin/*')\n", (249, 258), False, 'import glob\n'), ((822, 867), 'Cython.Build.cythonize', 'cythonize', (['"""my_ml/model/_split_data_fast.pyx"""'], {}), "('my_ml/model/_split_data_fast.pyx')\n", (831, 867), False, 'from Cython.Build import cythonize\n'), (... |
"""
Code that goes along with the Airflow located at:
http://airflow.readthedocs.org/en/latest/tutorial.html
"""
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.operators.python_operator import PythonOperator
from taxi import get_taxi_data, transform_taxi_data, load_taxi_da... | [
"datetime.datetime",
"datetime.timedelta",
"airflow.operators.python_operator.PythonOperator",
"airflow.DAG"
] | [((813, 904), 'airflow.DAG', 'DAG', (['"""taxi"""'], {'default_args': 'default_args', 'schedule_interval': '"""0 */10 * * 1"""', 'catchup': '(False)'}), "('taxi', default_args=default_args, schedule_interval='0 */10 * * 1',\n catchup=False)\n", (816, 904), False, 'from airflow import DAG\n'), ((1014, 1155), 'airflow... |
from typing import Literal, Optional, Union
from aiohttp import ClientSession
from pyddragon.models.champion import Champion
from pyddragon.models.item import Item
from pyddragon.models.rune import Rune
from pyddragon.models.summoner import Summoner
from pyddragon.request import DdragonHttpClient
class Ddragon(Ddra... | [
"pyddragon.models.item.Item",
"pyddragon.models.rune.Rune",
"pyddragon.models.champion.Champion",
"pyddragon.models.summoner.Summoner"
] | [((1101, 1115), 'pyddragon.models.champion.Champion', 'Champion', (['data'], {}), '(data)\n', (1109, 1115), False, 'from pyddragon.models.champion import Champion\n'), ((2147, 2157), 'pyddragon.models.item.Item', 'Item', (['data'], {}), '(data)\n', (2151, 2157), False, 'from pyddragon.models.item import Item\n'), ((276... |
from itertools import chain
from typing import NamedTuple, Dict, Sequence, List, Set, Type, Union, TYPE_CHECKING, Tuple
from lightbus.exceptions import TransportNotFound, TransportsNotInstalled
from lightbus.transports.pool import TransportPool
from lightbus.utilities.importing import load_entrypoint_classes
empty = ... | [
"lightbus.exceptions.TransportsNotInstalled",
"lightbus.utilities.importing.load_entrypoint_classes",
"lightbus.exceptions.TransportNotFound",
"lightbus.transports.pool.TransportPool",
"typing.NamedTuple"
] | [((320, 339), 'typing.NamedTuple', 'NamedTuple', (['"""Empty"""'], {}), "('Empty')\n", (330, 339), False, 'from typing import NamedTuple, Dict, Sequence, List, Set, Type, Union, TYPE_CHECKING, Tuple\n'), ((10647, 10702), 'lightbus.utilities.importing.load_entrypoint_classes', 'load_entrypoint_classes', (['f"""lightbus_... |
import numpy as np
class NN_Model:
LEARNING_RATE = 0.1
LAYERS = 2
@staticmethod
def cost_mse(prediction: float):
return (prediction - NN_Model.TARGET) ** 2
@staticmethod
def sigmoid(x: float):
return 1 / (1 + np.exp(-x))
@staticmethod
def sigmoid_deriv(x: float)... | [
"numpy.exp",
"numpy.array"
] | [((385, 397), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (393, 397), True, 'import numpy as np\n'), ((258, 268), 'numpy.exp', 'np.exp', (['(-x)'], {}), '(-x)\n', (264, 268), True, 'import numpy as np\n')] |