code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import tensorflow as tf
from deepsleep.nn import *
class DeepFeatureNet(object):
def __init__(
self,
batch_size,
input_dims,
n_classes,
is_train,
reuse_params,
use_dropout,
name="deepfeaturenet"
):
self.batch_size ... | [
"tensorflow.compat.v1.placeholder",
"tensorflow.unstack",
"tensorflow.compat.v1.variable_scope",
"tensorflow.nn.relu",
"tensorflow.ones",
"tensorflow.compat.v1.get_collection",
"tensorflow.reduce_sum",
"tensorflow.compat.v1.get_variable_scope",
"tensorflow.compat.v1.nn.static_bidirectional_rnn",
"... | [((780, 892), 'tensorflow.compat.v1.placeholder', 'tf.compat.v1.placeholder', (['tf.float32'], {'shape': '[self.batch_size, self.input_dims, 1, 1]', 'name': "(name + '_inputs')"}), "(tf.float32, shape=[self.batch_size, self.\n input_dims, 1, 1], name=name + '_inputs')\n", (804, 892), True, 'import tensorflow as tf\n... |
import fnmatch
import os.path
import sys
import re
def print_help():
print(
"""usage: python single_header_packer.py --macro <macro> [--intro <files>] --extern <files> --pub <files> --priv1 <files> --priv2 <files> [--outro <files>]
where <files> can be a comma-separated list of files. e.g. --priv *.c,inc/... | [
"re.sub",
"fnmatch.fnmatch"
] | [((2175, 2219), 're.sub', 're.sub', (['"""//(.*)(\\\\n|$)"""', '"""/* \\\\1 */\\\\2"""', 'str'], {}), "('//(.*)(\\\\n|$)', '/* \\\\1 */\\\\2', str)\n", (2181, 2219), False, 'import re\n'), ((1364, 1395), 'fnmatch.fnmatch', 'fnmatch.fnmatch', (['file', 'wildcard'], {}), '(file, wildcard)\n', (1379, 1395), False, 'import... |
# coding=utf-8
'''
kivy 2.0.0
ROTABOXER
______________________________________________________________________________
Rotaboxer is an editing tool for the Rotabox bounds*.
With an image as input, the user can visually shape specific colliding... | [
"kivy.core.window.Window.unbind",
"kivy.graphics.vertex_instructions.Line",
"future.utils.iteritems",
"kivy.uix.boxlayout.BoxLayout",
"future.utils.itervalues",
"kivy.core.window.Window.bind",
"math.cos",
"kivy.properties.ListProperty",
"sys.exit",
"math.hypot",
"kivy.app.App.get_running_app",
... | [((1240, 1296), 'kivy.config.Config.set', 'Config.set', (['"""input"""', '"""mouse"""', '"""mouse,disable_multitouch"""'], {}), "('input', 'mouse', 'mouse,disable_multitouch')\n", (1250, 1296), False, 'from kivy.config import Config\n'), ((1425, 1469), 'kivy.config.Config.set', 'Config.set', (['"""graphics"""', '"""pos... |
"""LSTM (2000 version) language model."""
import argparse
import math
from typing import Any, ClassVar, List, Optional, Tuple, Union
import torch
import torch.nn as nn
import torch.nn.functional as F
import lmp.util.metric
import lmp.util.validate
from lmp.model._base import BaseModel
from lmp.tknzr._base import PAD... | [
"torch.tanh",
"torch.nn.functional.softmax",
"torch.nn.Dropout",
"torch.nn.Tanh",
"torch.stack",
"torch.sigmoid",
"torch.nn.Linear",
"torch.no_grad",
"torch.nn.init.uniform_",
"torch.zeros",
"torch.nn.Embedding"
] | [((19534, 19549), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (19547, 19549), False, 'import torch\n'), ((10044, 10136), 'torch.nn.Embedding', 'nn.Embedding', ([], {'num_embeddings': 'tknzr.vocab_size', 'embedding_dim': 'd_emb', 'padding_idx': 'PAD_TKID'}), '(num_embeddings=tknzr.vocab_size, embedding_dim=d_emb... |
# -*- coding: utf-8 -*-
import copy
from gitlint.tests.base import BaseTestCase
from gitlint.config import LintConfig, LintConfigBuilder, LintConfigError
from gitlint import rules
class LintConfigBuilderTests(BaseTestCase):
def test_set_option(self):
config_builder = LintConfigBuilder()
config ... | [
"gitlint.rules.TitleRegexMatches",
"gitlint.config.LintConfig",
"gitlint.config.LintConfigBuilder",
"copy.deepcopy"
] | [((285, 304), 'gitlint.config.LintConfigBuilder', 'LintConfigBuilder', ([], {}), '()\n', (302, 304), False, 'from gitlint.config import LintConfig, LintConfigBuilder, LintConfigError\n'), ((1802, 1814), 'gitlint.config.LintConfig', 'LintConfig', ([], {}), '()\n', (1812, 1814), False, 'from gitlint.config import LintCon... |
# -*- coding: utf-8 -*-
"""Tests for module :mod:`~utilipy.decorators.code_dev`."""
__all__ = [
"test_DevelopmentWarning",
"test_BetaDevelopmentWarning",
"test_indev_doc",
"test_indev_func_message",
"test_indev_decorator_func",
"test_indev_decorator_class",
]
################################... | [
"utilipy.decorators.code_dev.indev",
"utilipy.decorators.code_dev.BetaDevelopmentWarning",
"utilipy.decorators.code_dev.indev_doc",
"utilipy.decorators.code_dev.DevelopmentWarning",
"pytest.warns"
] | [((1612, 1660), 'utilipy.decorators.code_dev.indev_doc', 'cdev.indev_doc', ([], {'old_doc': 'old_doc', 'message': 'message'}), '(old_doc=old_doc, message=message)\n', (1626, 1660), True, 'from utilipy.decorators import code_dev as cdev\n'), ((2217, 2333), 'utilipy.decorators.code_dev.indev', 'cdev.indev', ([], {'messag... |
import django
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
from django_jsonfield_backport import features, forms, models
class JSONFieldConfig(AppConfig):
name = "django_jsonfield_backport"
verbose_name = _("JSONField backport from Django 3.1")
def ready(self... | [
"django_jsonfield_backport.forms.patch_admin",
"django.utils.translation.ugettext_lazy",
"django_jsonfield_backport.features.connect_signal_receivers",
"django_jsonfield_backport.models.register_lookups"
] | [((261, 300), 'django.utils.translation.ugettext_lazy', '_', (['"""JSONField backport from Django 3.1"""'], {}), "('JSONField backport from Django 3.1')\n", (262, 300), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((387, 422), 'django_jsonfield_backport.features.connect_signal_receivers', 'featur... |
# -*- coding: utf-8 -*-
import os
import logging
import click
import requests
import json
from dotenv import find_dotenv, load_dotenv
def get_auth_headers():
LICHESS_TOKEN = os.getenv("LICHESS_TOKEN")
headers = {"Authorization": "Bearer {}".format(LICHESS_TOKEN)}
headers.update({"Accept": "application/x-n... | [
"logging.getLogger",
"logging.basicConfig",
"json.loads",
"dotenv.find_dotenv",
"os.getenv",
"requests.get",
"click.Path",
"click.command",
"json.dump"
] | [((837, 852), 'click.command', 'click.command', ([], {}), '()\n', (850, 852), False, 'import click\n'), ((180, 206), 'os.getenv', 'os.getenv', (['"""LICHESS_TOKEN"""'], {}), "('LICHESS_TOKEN')\n", (189, 206), False, 'import os\n'), ((454, 493), 'requests.get', 'requests.get', (['test_url'], {'headers': 'headers'}), '(t... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 Alibaba Group Holding Limited.
#
# 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/LICENS... | [
"queue.Queue",
"graphscope.proto.op_def_pb2.DagDef",
"copy.deepcopy"
] | [((2396, 2409), 'queue.Queue', 'queue.Queue', ([], {}), '()\n', (2407, 2409), False, 'import queue\n'), ((2455, 2474), 'graphscope.proto.op_def_pb2.DagDef', 'op_def_pb2.DagDef', ([], {}), '()\n', (2472, 2474), False, 'from graphscope.proto import op_def_pb2\n'), ((2779, 2798), 'graphscope.proto.op_def_pb2.DagDef', 'op_... |
# coding=utf-8
# Copyright 2021 The Reach ML Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | [
"tf_agents.utils.nest_utils.batch_nested_array",
"tf_agents.specs.tensor_spec.to_nest_array_spec",
"absl.logging.warning",
"tf_agents.utils.nest_utils.unbatch_nested_tensors_to_arrays",
"tensorflow.nest.map_structure"
] | [((1231, 1284), 'tf_agents.specs.tensor_spec.to_nest_array_spec', 'tensor_spec.to_nest_array_spec', (['policy.time_step_spec'], {}), '(policy.time_step_spec)\n', (1261, 1284), False, 'from tf_agents.specs import tensor_spec\n'), ((1303, 1353), 'tf_agents.specs.tensor_spec.to_nest_array_spec', 'tensor_spec.to_nest_array... |
import os
import yaml
import logging
import json
_LOGGER = logging.getLogger(__name__)
IMAGE_LABEL = 'opendatahub.io/notebook-image'
class Images(object):
def __init__(self, oapi_client, namespace):
self.oapi_client = oapi_client
self.namespace = namespace
def get_images(self, label=None)... | [
"logging.getLogger"
] | [((60, 87), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (77, 87), False, 'import logging\n')] |
from django.conf.urls import url
from django.contrib.auth.views import LoginView, LogoutView
from .views import RegisterView
urlpatterns = [
url(r'^register/$', RegisterView.as_view(), name='register'),
url(r'^login/$', LoginView.as_view(template_name='account/login.html'), name="login"),
url(r'^logout/$... | [
"django.contrib.auth.views.LoginView.as_view",
"django.contrib.auth.views.LogoutView.as_view"
] | [((231, 284), 'django.contrib.auth.views.LoginView.as_view', 'LoginView.as_view', ([], {'template_name': '"""account/login.html"""'}), "(template_name='account/login.html')\n", (248, 284), False, 'from django.contrib.auth.views import LoginView, LogoutView\n'), ((323, 377), 'django.contrib.auth.views.LogoutView.as_view... |
# coding: utf-8
import chainer
class Range(chainer.Chain):
def forward(self, x):
return range(x)
class RangeStop(chainer.Chain):
def forward(self, x, y):
return range(x, y)
class RangeStep(chainer.Chain):
def forward(self, x, y, z):
return range(x, y, z)
class RangeListComp(... | [
"chainer_compiler.ch2o.generate_testcase",
"numpy.int64",
"numpy.random.rand",
"numpy.random.randint"
] | [((618, 652), 'chainer_compiler.ch2o.generate_testcase', 'ch2o.generate_testcase', (['Range', '[5]'], {}), '(Range, [5])\n', (640, 652), False, 'from chainer_compiler import ch2o\n'), ((857, 889), 'numpy.random.randint', 'np.random.randint', (['(0)', '(5)'], {'size': 'wn'}), '(0, 5, size=wn)\n', (874, 889), True, 'impo... |
"""Snyk metrics collector."""
from base_collectors import JSONFileSourceCollector
from collector_utilities.functions import md5_hash
from source_model import Entity, SourceMeasurement, SourceResponses
class SnykSecurityWarnings(JSONFileSourceCollector):
"""Snyk collector for security warnings."""
async def ... | [
"source_model.SourceMeasurement",
"collector_utilities.functions.md5_hash",
"source_model.Entity"
] | [((1655, 1691), 'source_model.SourceMeasurement', 'SourceMeasurement', ([], {'entities': 'entities'}), '(entities=entities)\n', (1672, 1691), False, 'from source_model import Entity, SourceMeasurement, SourceResponses\n'), ((1215, 1267), 'collector_utilities.functions.md5_hash', 'md5_hash', (['f"""{vulnerability[\'id\'... |
#####################################################
# Title: HTML parse- and analyser
# Author: <NAME> (<EMAIL>)
# Licence: GPLv2
#####################################################
#!/usr/bin/python
import sys
import sqlite3
import datetime
import timeit
import math
import re
import pandas as pd
imp... | [
"sklearn.feature_selection.VarianceThreshold",
"sklearn.metrics.balanced_accuracy_score",
"sklearn.metrics.classification_report",
"sklearn.metrics.auc",
"sklearn.metrics.roc_auc_score",
"sklearn.metrics.roc_curve",
"numpy.mean",
"sklearn.feature_extraction.text.CountVectorizer",
"sklearn.tree.Decis... | [((1454, 1469), 'sklearn.naive_bayes.MultinomialNB', 'MultinomialNB', ([], {}), '()\n', (1467, 1469), False, 'from sklearn.naive_bayes import MultinomialNB\n'), ((1483, 1521), 'sklearn.ensemble.RandomForestClassifier', 'RandomForestClassifier', ([], {'random_state': '(0)'}), '(random_state=0)\n', (1505, 1521), False, '... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class OnPolicy(nn.Module):
def __init__(self):
super(OnPolicy, self).__init__()
self.steps_done = 0
def forward(self, x):
raise NotImplementedError
def select_action(self, x, test = 0, determini... | [
"torch.no_grad",
"torch.nn.functional.softmax",
"torch.nn.functional.log_softmax"
] | [((544, 567), 'torch.nn.functional.softmax', 'F.softmax', (['logit'], {'dim': '(1)'}), '(logit, dim=1)\n', (553, 567), True, 'import torch.nn.functional as F\n'), ((831, 854), 'torch.nn.functional.softmax', 'F.softmax', (['logit'], {'dim': '(1)'}), '(logit, dim=1)\n', (840, 854), True, 'import torch.nn.functional as F\... |
from urllib.parse import urlencode
from django.urls import reverse
from utils.tests import APIViewTestCase, ListAPIViewTestCase
from ..services import follow, is_following
class FollowersListAPIViewTestCase(ListAPIViewTestCase):
def url(self, parameters={}):
url = reverse("followers_list")
if p... | [
"urllib.parse.urlencode",
"django.urls.reverse"
] | [((1929, 1954), 'django.urls.reverse', 'reverse', (['"""following_list"""'], {}), "('following_list')\n", (1936, 1954), False, 'from django.urls import reverse\n'), ((282, 307), 'django.urls.reverse', 'reverse', (['"""followers_list"""'], {}), "('followers_list')\n", (289, 307), False, 'from django.urls import reverse\... |
import pandas as pd
import numpy as np
import requests
import json
df = pd.read_csv('./ingredients.csv').iloc[:,1:]
df.columns = ['banana', 'blueberries', 'apple', 'whole-wheat bread', 'brown rice',
'oatmeal', 'sweet potatoes', 'quinoa', 'greek yogurt', 'chicken breast',
'turkey breast', 'lean beef', 'br... | [
"json.loads",
"json.dumps",
"pandas.read_csv"
] | [((1243, 1261), 'json.loads', 'json.loads', (['r.text'], {}), '(r.text)\n', (1253, 1261), False, 'import json\n'), ((73, 105), 'pandas.read_csv', 'pd.read_csv', (['"""./ingredients.csv"""'], {}), "('./ingredients.csv')\n", (84, 105), True, 'import pandas as pd\n'), ((1214, 1230), 'json.dumps', 'json.dumps', (['data'], ... |
# scatterplot of mixed sign data; crosshairs at (0,0); superscripts in labels; data points have tooltips
import svgdatashapes as s
import examples.sampledata1 as sampledata1
def example2(): # scatterplot example
# get some sample plot data... eg. [ (-6.3, -5.2), (0.4, ... | [
"svgdatashapes.yspace",
"svgdatashapes.settext",
"svgdatashapes.datapoint",
"svgdatashapes.svgbegin",
"svgdatashapes.xspace",
"svgdatashapes.plotdeco",
"svgdatashapes.setline",
"svgdatashapes.yaxis",
"svgdatashapes.xaxis",
"svgdatashapes.findrange",
"svgdatashapes.svgresult",
"examples.sampled... | [((349, 379), 'examples.sampledata1.datapoints', 'sampledata1.datapoints', (['"""set1"""'], {}), "('set1')\n", (371, 379), True, 'import examples.sampledata1 as sampledata1\n'), ((397, 427), 'examples.sampledata1.datapoints', 'sampledata1.datapoints', (['"""set2"""'], {}), "('set2')\n", (419, 427), True, 'import exampl... |
# -*- coding: utf-8 -*-
#
# Copyright 2019 SoloKeys Developers
#
# Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
# http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
# http://opensource.org/licenses/MIT>, at your option. This file may not be
# copied, modified, or distribute... | [
"threading.Event",
"threading.Timer"
] | [((1095, 1102), 'threading.Event', 'Event', ([], {}), '()\n', (1100, 1102), False, 'from threading import Event, Timer\n'), ((1128, 1164), 'threading.Timer', 'Timer', (['time_or_event', 'self.event.set'], {}), '(time_or_event, self.event.set)\n', (1133, 1164), False, 'from threading import Event, Timer\n')] |
import argparse
import json
import os
from pathlib import Path
import numpy as np
import torch
import torch.nn as nn
import torchvision
from torch.utils.data import Dataset, ConcatDataset, DataLoader
from torchvision import transforms
from torchvision.datasets.folder import pil_loader
from tqdm import tran... | [
"torch.nn.CrossEntropyLoss",
"torch.max",
"numpy.array_split",
"torch.sum",
"numpy.mean",
"os.listdir",
"argparse.ArgumentParser",
"pathlib.Path",
"numpy.asarray",
"numpy.concatenate",
"torchvision.transforms.ToTensor",
"numpy.random.permutation",
"torch.Tensor.cpu",
"torchvision.transform... | [((6253, 6268), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (6266, 6268), False, 'import torch\n'), ((6856, 6871), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (6869, 6871), False, 'import torch\n'), ((4501, 4606), 'torch.utils.data.DataLoader', 'DataLoader', (['train_data'], {'batch_size': 'batch_size',... |
"""Python versions of the objects represented by the 2DM mesh."""
import abc
import functools
import warnings
from typing import (Any, ClassVar, Iterable, List, Optional, SupportsFloat,
Tuple, Type, TypeVar, Union)
from .errors import CardError, CustomFormatIgnored
from ._parser import parse_eleme... | [
"warnings.warn",
"functools.lru_cache",
"typing.TypeVar"
] | [((662, 697), 'typing.TypeVar', 'TypeVar', (['"""_EntityT"""'], {'bound': '"""Entity"""'}), "('_EntityT', bound='Entity')\n", (669, 697), False, 'from typing import Any, ClassVar, Iterable, List, Optional, SupportsFloat, Tuple, Type, TypeVar, Union\n'), ((710, 747), 'typing.TypeVar', 'TypeVar', (['"""_ElementT"""'], {'... |
from django.utils.translation import ugettext_lazy as _
from . import PermissionNamespace
namespace = PermissionNamespace(label=_('Permissions'), name='permissions')
permission_role_create = namespace.add_permission(
label=_('Create roles'), name='role_create'
)
permission_role_delete = namespace.add_pe... | [
"django.utils.translation.ugettext_lazy"
] | [((134, 150), 'django.utils.translation.ugettext_lazy', '_', (['"""Permissions"""'], {}), "('Permissions')\n", (135, 150), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((237, 254), 'django.utils.translation.ugettext_lazy', '_', (['"""Create roles"""'], {}), "('Create roles')\n", (238, 254), True,... |
import json
import re
import ast
all_courses_file = "../vue-app/data/allCourses.json"
major_reqs_file = "../vue-app/data/course_requirements.json"
def read_data_files(all_courses_file, major_reqs_file):
with open(all_courses_file, 'r') as f:
all_courses = json.load(f)
with open(major_reqs_file, 'r') ... | [
"ast.literal_eval",
"re.sub",
"json.load"
] | [((2192, 2247), 're.sub', 're.sub', (['"""/\'\'permission of instructor\'\'"""', '""""""', 'prereq_str'], {}), '("/\'\'permission of instructor\'\'", \'\', prereq_str)\n', (2198, 2247), False, 'import re\n'), ((2700, 2727), 're.sub', 're.sub', (['""" """', '""""""', 'prereq_str'], {}), "(' ', '', prereq_str)\n", (2706,... |
import json
import tornado
from notebook.base.handlers import APIHandler
from notebook.utils import url_path_join
class ListSnippets(APIHandler):
'''
This class is based on the handler implemnted here:
https://github.com/QuantStack/jupyterlab-snippets
'''
def initialize(self, loader):
s... | [
"json.dumps",
"notebook.utils.url_path_join"
] | [((488, 508), 'json.dumps', 'json.dumps', (['snippets'], {}), '(snippets)\n', (498, 508), False, 'import json\n'), ((833, 865), 'json.dumps', 'json.dumps', (["{'content': content}"], {}), "({'content': content})\n", (843, 865), False, 'import json\n'), ((998, 1041), 'notebook.utils.url_path_join', 'url_path_join', (['b... |
import nextcord
from nextcord.ext import commands
class deletewarn(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(name="deletewarn", aliases=["delwarn", "dw"], description="Deletes a warn of a member.", usage="[deletewarn @member number]")
@commands.has_permissions(kick_m... | [
"nextcord.ext.commands.has_permissions",
"nextcord.ext.commands.command"
] | [((141, 288), 'nextcord.ext.commands.command', 'commands.command', ([], {'name': '"""deletewarn"""', 'aliases': "['delwarn', 'dw']", 'description': '"""Deletes a warn of a member."""', 'usage': '"""[deletewarn @member number]"""'}), "(name='deletewarn', aliases=['delwarn', 'dw'], description=\n 'Deletes a warn of a ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import print_function
from src.unfollow_protocol import unfollow_protocol
from src.follow_protocol import follow_protocol
from src.feed_scanner import feed_scanner
from src.check_status import check_status
from src import InstaBot
import configparser
import... | [
"json.loads",
"configparser.ConfigParser",
"json.dumps",
"os.path.isfile",
"re.sub"
] | [((678, 705), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (703, 705), False, 'import configparser\n'), ((775, 806), 'os.path.isfile', 'os.path.isfile', (['config_location'], {}), '(config_location)\n', (789, 806), False, 'import os\n'), ((1649, 2146), 'json.dumps', 'json.dumps', (["[['th... |
#!/usr/bin/env python
"""
A performance benchmark using the example from issue #232:
https://github.com/Julian/jsonschema/pull/232
"""
from twisted.python.filepath import FilePath
from perf import Runner
from pyrsistent import m
from jsonschema.tests._suite import Collection
import jsonschema
collection = Collecti... | [
"twisted.python.filepath.FilePath",
"pyrsistent.m",
"perf.Runner"
] | [((385, 388), 'pyrsistent.m', 'm', ([], {}), '()\n', (386, 388), False, 'from pyrsistent import m\n'), ((516, 524), 'perf.Runner', 'Runner', ([], {}), '()\n', (522, 524), False, 'from perf import Runner\n'), ((333, 351), 'twisted.python.filepath.FilePath', 'FilePath', (['__file__'], {}), '(__file__)\n', (341, 351), Fal... |
from concurrent.futures import Future, ThreadPoolExecutor
import logging
from vonx.indy.messages import StoredCredential
from vonx.web.view_helpers import (
IndyCredentialProcessor,
IndyCredentialProcessorException,
)
from api_indy.indy.credential import Credential, CredentialException, CredentialManager
fr... | [
"logging.getLogger",
"concurrent.futures.ThreadPoolExecutor",
"api_indy.indy.credential.CredentialManager",
"api_indy.indy.credential.Credential"
] | [((362, 389), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (379, 389), False, 'import logging\n'), ((909, 958), 'concurrent.futures.ThreadPoolExecutor', 'ThreadPoolExecutor', ([], {'max_workers': 'self._max_threads'}), '(max_workers=self._max_threads)\n', (927, 958), False, 'from concur... |
from flask import Flask, json, jsonify, make_response
api = Flask(__name__)
@api.route('/users/<username>', methods=['GET'])
def get_userinfo(username):
with open('./db/users.json') as f:
users = json.load(f)['users']
for u in users:
if u['username'] == username:
del u['username']
del u['pass_sh1']
ret... | [
"flask.jsonify",
"flask.json.load",
"flask.Flask"
] | [((61, 76), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (66, 76), False, 'from flask import Flask, json, jsonify, make_response\n'), ((357, 390), 'flask.jsonify', 'jsonify', (["{'Error': 'Bad Request'}"], {}), "({'Error': 'Bad Request'})\n", (364, 390), False, 'from flask import Flask, json, jsonify, ma... |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2014, <NAME>, <EMAIL>
#
import unittest
from ...compatibility import StringIO
from ...worksheet import Worksheet
class TestCalculateSpans(unittest.TestCase):
"""
Test the _calcula... | [
"unittest.main"
] | [((8018, 8033), 'unittest.main', 'unittest.main', ([], {}), '()\n', (8031, 8033), False, 'import unittest\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from urllib.request import urlopen
import yaml
import subprocess
import shlex
from telegram.ext.dispatcher import run_async, TelegramError
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
from telegram import ParseMode
import logging
imp... | [
"logging.basicConfig",
"logging.getLogger",
"shlex.split",
"yaml.load",
"yaml.add_constructor",
"urllib.request.urlopen",
"os.path.dirname",
"telegram.ext.MessageHandler",
"re.findall",
"telegram.ext.CommandHandler",
"telegram.ext.Updater"
] | [((372, 479), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s - %(name)s - %(levelname)s - %(message)s"""', 'level': 'logging.INFO'}), "(format=\n '%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)\n", (391, 479), False, 'import logging\n'), ((508, 535), 'loggin... |
import dynet as dy
class LinearTransform:
def __init__(self,input_dim,output_dim,pc):
self.W_param = pc.add_parameters((output_dim, input_dim)) #parameter object
self.b_param = pc.add_parameters((output_dim)) #parameter object
self.store_expressions()
def store_expressions(self... | [
"dynet.parameter"
] | [((340, 366), 'dynet.parameter', 'dy.parameter', (['self.W_param'], {}), '(self.W_param)\n', (352, 366), True, 'import dynet as dy\n'), ((388, 414), 'dynet.parameter', 'dy.parameter', (['self.b_param'], {}), '(self.b_param)\n', (400, 414), True, 'import dynet as dy\n')] |
#
# Constant-current constant-voltage charge
#
import pybamm
pybamm.set_logging_level("INFO")
experiment = pybamm.Experiment(
[
"Discharge at C/2 until 11 V",
"Rest for 1 hour",
"Charge at C/2 until 14.5 V",
"Hold at 14.5 V until 200 mA",
"Rest for 1 hour",
]
)
model = p... | [
"pybamm.lead_acid.Full",
"pybamm.Experiment",
"pybamm.set_logging_level",
"pybamm.CasadiSolver"
] | [((62, 94), 'pybamm.set_logging_level', 'pybamm.set_logging_level', (['"""INFO"""'], {}), "('INFO')\n", (86, 94), False, 'import pybamm\n'), ((108, 265), 'pybamm.Experiment', 'pybamm.Experiment', (["['Discharge at C/2 until 11 V', 'Rest for 1 hour',\n 'Charge at C/2 until 14.5 V', 'Hold at 14.5 V until 200 mA',\n ... |
import sys
from unittest.mock import MagicMock
import pytest
from lightning_transformers.core.nlp import HFBackboneConfig, HFTransformerDataConfig
from lightning_transformers.task.nlp.text_classification import (
TextClassificationDataModule,
TextClassificationTransformer,
)
@pytest.mark.skipif(sys.platform... | [
"unittest.mock.MagicMock",
"lightning_transformers.core.nlp.HFBackboneConfig",
"lightning_transformers.task.nlp.text_classification.TextClassificationDataModule",
"pytest.mark.skipif"
] | [((289, 382), 'pytest.mark.skipif', 'pytest.mark.skipif', (["(sys.platform == 'win32')"], {'reason': '"""Currently Windows is not supported"""'}), "(sys.platform == 'win32', reason=\n 'Currently Windows is not supported')\n", (307, 382), False, 'import pytest\n'), ((525, 618), 'pytest.mark.skipif', 'pytest.mark.skip... |
from darkflow.darkflow.defaults import argHandler # Import the default arguments
import os
from darkflow.darkflow.net.build import TFNet
import cv2
import numpy as np
def manual_seeting():
FLAGS = argHandler()
FLAGS.setDefaults()
FLAGS.demo = "Video/20180725_1320.mp4" # Initial video file to use, or if... | [
"darkflow.darkflow.defaults.argHandler",
"darkflow.darkflow.net.build.TFNet"
] | [((204, 216), 'darkflow.darkflow.defaults.argHandler', 'argHandler', ([], {}), '()\n', (214, 216), False, 'from darkflow.darkflow.defaults import argHandler\n'), ((1833, 1845), 'darkflow.darkflow.net.build.TFNet', 'TFNet', (['FLAGS'], {}), '(FLAGS)\n', (1838, 1845), False, 'from darkflow.darkflow.net.build import TFNet... |
import os
from torch.utils.data import Dataset
from facade_project import LABEL_NAME_TO_VALUE
from facade_project.utils.load import load_tuple_from_json
class FacadeLabelmeDataset(Dataset):
"""
Facade Labelme Dataset
A dataset which loads labelme style json files within a directory.
Items of the d... | [
"facade_project.utils.load.load_tuple_from_json",
"os.listdir",
"os.path.join",
"torch.utils.data.Dataset.__init__"
] | [((504, 526), 'torch.utils.data.Dataset.__init__', 'Dataset.__init__', (['self'], {}), '(self)\n', (520, 526), False, 'from torch.utils.data import Dataset\n'), ((892, 948), 'facade_project.utils.load.load_tuple_from_json', 'load_tuple_from_json', (['img_path', 'self.label_name_to_value'], {}), '(img_path, self.label_n... |
from telegram.ext import CallbackContext, CommandHandler
from telegram.update import Update
from loader import LoaderApps
EXCLUDED_HANDLERS = ["quiz_response"]
def cmd_help(update: Update, contex: CallbackContext):
helper = ['Available commands:']
for app in LoaderApps.apps():
if app.__name__ not in ... | [
"telegram.ext.CommandHandler",
"loader.LoaderApps.apps"
] | [((270, 287), 'loader.LoaderApps.apps', 'LoaderApps.apps', ([], {}), '()\n', (285, 287), False, 'from loader import LoaderApps\n'), ((646, 678), 'telegram.ext.CommandHandler', 'CommandHandler', (['"""help"""', 'cmd_help'], {}), "('help', cmd_help)\n", (660, 678), False, 'from telegram.ext import CallbackContext, Comman... |
import time
from datetime import datetime
from django.template import Library, Node, Variable, TemplateSyntaxError
register = Library()
def convert_times(feed):
"""
Convert feed parser time_stuct to datetime
"""
for entry in feed.entries:
if hasattr(entry, 'updated_parsed'):
if is... | [
"datetime.datetime",
"feedparser.parse",
"django.template.TemplateSyntaxError",
"django.template.Library",
"re.search"
] | [((127, 136), 'django.template.Library', 'Library', ([], {}), '()\n', (134, 136), False, 'from django.template import Library, Node, Variable, TemplateSyntaxError\n'), ((2106, 2139), 're.search', 're.search', (['"""(.*?) as (\\\\w+)"""', 'arg'], {}), "('(.*?) as (\\\\w+)', arg)\n", (2115, 2139), False, 'import re\n'), ... |
# Modified Flood Fill algorithm based on http://ijcte.org/papers/738-T012.pdf
# Flood Fill algorithm based on https://github.com/bblodget/MicromouseSim
# Written by <NAME>
import turtle, sys
SCREEN_HEIGHT = 512
SCREEN_WIDTH = 512
CANVAS_BUFFER = 0
BOX_SIZE = 32
turtle.colormode(255)
turtle.speed(0)
turtle.delay(0)
t... | [
"turtle.setheading",
"turtle.forward",
"turtle.ycor",
"turtle.delay",
"turtle.left",
"turtle.xcor",
"turtle.heading",
"turtle.down",
"turtle.towards",
"turtle.setpos",
"turtle.setworldcoordinates",
"turtle.color",
"turtle.speed",
"turtle.up",
"turtle.colormode",
"turtle.screensize",
... | [((265, 286), 'turtle.colormode', 'turtle.colormode', (['(255)'], {}), '(255)\n', (281, 286), False, 'import turtle, sys\n'), ((287, 302), 'turtle.speed', 'turtle.speed', (['(0)'], {}), '(0)\n', (299, 302), False, 'import turtle, sys\n'), ((303, 318), 'turtle.delay', 'turtle.delay', (['(0)'], {}), '(0)\n', (315, 318), ... |
import pickle
from collections import defaultdict
from pathlib import Path
from typing import Optional, Callable
import numpy as np
import torch
import torch.utils.data as torchdata
from ignite.contrib.handlers import ProgressBar
from ignite.engine import create_supervised_evaluator, Events, Engine
from ignite.metrics... | [
"ignite.engine.create_supervised_evaluator",
"torch.utils.data.ConcatDataset",
"ignite.metrics.Loss",
"ignite.metrics.Accuracy",
"torch.max",
"alr.training.utils.PLPredictionSaver",
"alr.MCDropout",
"ignite.engine.Engine",
"alr.data.datasets.Dataset.MNIST.get_fixed",
"numpy.array",
"torch.cuda.i... | [((6568, 6598), 'torch.utils.data.DataLoader', 'torchdata.DataLoader', ([], {}), '(**kwargs)\n', (6588, 6598), True, 'import torch.utils.data as torchdata\n'), ((8645, 8658), 'ignite.engine.Engine', 'Engine', (['_step'], {}), '(_step)\n', (8651, 8658), False, 'from ignite.engine import create_supervised_evaluator, Even... |
# decompyle3 version 3.3.2
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.8.1 (default, Jan 3 2020, 22:44:00)
# [GCC 8.3.0]
# Embedded file name: ulang\parser\lrparser.py
# Size of source mod 2**32: 82682 bytes
from rply.errors import ParsingError
class LRParser:
def __init__(self, lrparser):
... | [
"rply.token.Token"
] | [((586, 607), 'rply.token.Token', 'Token', (['"""$end"""', '"""$end"""'], {}), "('$end', '$end')\n", (591, 607), False, 'from rply.token import Token\n'), ((1315, 1336), 'rply.token.Token', 'Token', (['"""$end"""', '"""$end"""'], {}), "('$end', '$end')\n", (1320, 1336), False, 'from rply.token import Token\n')] |
"""
Objective functions can be implemented in this file.
Author:
<NAME>
"""
from random import Random
from zoopt.dimension import Dimension
import numpy as np
class SetCover:
"""
set cover problem for discrete optimization
this problem has some extra initialization tasks, thus we define this problem... | [
"numpy.random.normal",
"numpy.sqrt",
"random.Random",
"zoopt.dimension.Dimension",
"numpy.exp",
"numpy.cos"
] | [((4688, 4696), 'random.Random', 'Random', ([], {}), '()\n', (4694, 4696), False, 'from random import Random\n'), ((4178, 4216), 'zoopt.dimension.Dimension', 'Dimension', (['dim_size', 'dim_regs', 'dim_tys'], {}), '(dim_size, dim_regs, dim_tys)\n', (4187, 4216), False, 'from zoopt.dimension import Dimension\n'), ((5275... |
import torch.nn as nn
import torch
from torch.nn.modules.loss import BCELoss
class BPR(nn.Module):
def __init__(self):
super(BPR, self).__init__()
self.bce_loss = nn.BCELoss(reduction='sum')
def forward(self, score_l_items, score_r_items, labels):
diffs = score_l_items - score_r_items
... | [
"torch.nn.BCELoss",
"torch.sigmoid"
] | [((184, 211), 'torch.nn.BCELoss', 'nn.BCELoss', ([], {'reduction': '"""sum"""'}), "(reduction='sum')\n", (194, 211), True, 'import torch.nn as nn\n'), ((335, 355), 'torch.sigmoid', 'torch.sigmoid', (['diffs'], {}), '(diffs)\n', (348, 355), False, 'import torch\n')] |
from vec import Vec
from GF2 import one
from factoring_support import dumb_factor
from factoring_support import intsqrt
from factoring_support import gcd
from factoring_support import primes
from factoring_support import prod
import echelon
## Task 1
def int2GF2(i):
'''
Returns one if i is odd, 0 otherwise.
... | [
"factoring_support.gcd",
"factoring_support.dumb_factor",
"factoring_support.prod",
"factoring_support.intsqrt"
] | [((2317, 2328), 'factoring_support.prod', 'prod', (['alist'], {}), '(alist)\n', (2321, 2328), False, 'from factoring_support import prod\n'), ((2337, 2371), 'factoring_support.prod', 'prod', (['[(x * x - N) for x in alist]'], {}), '([(x * x - N) for x in alist])\n', (2341, 2371), False, 'from factoring_support import p... |
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2018, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | [
"collections.OrderedDict",
"collections.namedtuple",
"pkg_resources.get_build_platform",
"dateutil.relativedelta.relativedelta",
"importlib.import_module",
"tzlocal.get_localzone",
"shutil.ignore_patterns",
"sys.version.split",
"uuid.uuid4",
"qiime2.core.cite.Citations",
"qiime2.core.path.Proven... | [((752, 803), 'collections.namedtuple', 'collections.namedtuple', (['"""ForwardRef"""', "['reference']"], {}), "('ForwardRef', ['reference'])\n", (774, 803), False, 'import collections\n'), ((819, 867), 'collections.namedtuple', 'collections.namedtuple', (['"""NoProvenance"""', "['uuid']"], {}), "('NoProvenance', ['uui... |
from tkinter import messagebox, Label, Tk, simpledialog, filedialog
from tkinter.ttk import Progressbar
from os import path, _exit
import sys
import traceback
title = "pymanga | .zip to .cbz or .pdf"
# Start window and set icon
root = Tk()
root.title(title)
icon = ""
if getattr(sys, 'frozen', False):
icon = path.... | [
"tkinter.messagebox.showerror",
"pathlib.Path.home",
"os.path.join",
"tkinter.simpledialog.askstring",
"os.path.dirname",
"tkinter.messagebox.askquestion",
"tkinter.Tk",
"os._exit",
"tkinter.Label",
"tkinter.ttk.Progressbar",
"traceback.print_exc",
"tkinter.messagebox.showinfo"
] | [((237, 241), 'tkinter.Tk', 'Tk', ([], {}), '()\n', (239, 241), False, 'from tkinter import messagebox, Label, Tk, simpledialog, filedialog\n'), ((435, 461), 'os.path.join', 'path.join', (['icon', '"""app.ico"""'], {}), "(icon, 'app.ico')\n", (444, 461), False, 'from os import path, _exit\n'), ((315, 343), 'os.path.dir... |
from guillotina_amqp.utils import metric_measure
class MockPrometheusMetric:
def __init__(self, labels=None):
self.labels_called = False
self.observe_called = False
self._values = []
self._labels = {l: None for l in labels or []}
def labels(self, **labels):
self.labels... | [
"guillotina_amqp.utils.metric_measure"
] | [((673, 707), 'guillotina_amqp.utils.metric_measure', 'metric_measure', (['None', '"""foo"""', '"""bar"""'], {}), "(None, 'foo', 'bar')\n", (687, 707), False, 'from guillotina_amqp.utils import metric_measure\n'), ((811, 876), 'guillotina_amqp.utils.metric_measure', 'metric_measure', (['histogram', '(20)', "{'label1': ... |
import pytest
import shaderlab
from helper import *
@pytest.fixture
def basic_shader():
data = read_text_data("basic.shader")
return shaderlab.parse(data)
@pytest.fixture
def uber_shader():
data = read_text_data("uber.shader")
return shaderlab.parse(data)
@pytest.fixture
def stripped_shader():
data = read_te... | [
"shaderlab.parse"
] | [((137, 158), 'shaderlab.parse', 'shaderlab.parse', (['data'], {}), '(data)\n', (152, 158), False, 'import shaderlab\n'), ((242, 263), 'shaderlab.parse', 'shaderlab.parse', (['data'], {}), '(data)\n', (257, 263), False, 'import shaderlab\n'), ((355, 376), 'shaderlab.parse', 'shaderlab.parse', (['data'], {}), '(data)\n'... |
import unittest
import rxbp
from rxbp.flowable import Flowable
from rxbp.multicast.multicast import MultiCast
from rxbp.multicast.multicastsubscriber import MultiCastSubscriber
from rxbp.multicast.multicasts.loopflowablemulticast import LoopFlowableMultiCast
from rxbp.multicast.testing.testmulticast import TestMultiCa... | [
"rxbp.multicast.multicast.MultiCast",
"rxbp.testing.tscheduler.TScheduler",
"rxbp.flowable.Flowable",
"rxbp.multicast.op.map",
"rxbp.multicast.testing.testmulticastobserver.TestMultiCastObserver",
"rxbp.testing.testflowable.TestFlowable",
"rxbp.testing.tobserver.TObserver",
"rxbp.subscriber.Subscriber... | [((746, 758), 'rxbp.testing.tscheduler.TScheduler', 'TScheduler', ([], {}), '()\n', (756, 758), False, 'from rxbp.testing.tscheduler import TScheduler\n'), ((791, 803), 'rxbp.testing.tscheduler.TScheduler', 'TScheduler', ([], {}), '()\n', (801, 803), False, 'from rxbp.testing.tscheduler import TScheduler\n'), ((991, 10... |
#import data processing module
import pandas as pd
#import ploting and visualization module
import matplotlib.pyplot as plt
#need regular expressions for parsing
import re
#easy counter for lists
from collections import Counter
#read the data into a Pandas dataframe for easy manipulation from the CSV file
data = pd.re... | [
"collections.Counter",
"pandas.read_csv",
"re.compile"
] | [((315, 350), 'pandas.read_csv', 'pd.read_csv', (['"""Trafficking_Data.csv"""'], {}), "('Trafficking_Data.csv')\n", (326, 350), True, 'import pandas as pd\n'), ((1354, 1484), 're.compile', 're.compile', (['"""(\\\\d{3}[-\\\\.\\\\s]??\\\\d{3}[-\\\\.\\\\s]??\\\\d{4}|\\\\(\\\\d{3}\\\\)\\\\s*\\\\d{3}[-\\\\.\\\\s]??\\\\d{4}... |
from functools import partial
from itertools import groupby
from couchdbkit import ResourceNotFound
from corehq.apps.domain import SHARED_DOMAIN, UNKNOWN_DOMAIN
from corehq.blobs import CODES
from corehq.blobs.mixin import BlobHelper, BlobMetaRef
from corehq.blobs.models import BlobMigrationState, BlobMeta
from coreh... | [
"corehq.blobs.models.BlobMeta.get_cursor_for_partition_value",
"corehq.util.doc_processor.sql.SqlDocumentProvider",
"corehq.apps.case_importer.tracking.models.CaseUploadRecord.objects.get",
"corehq.apps.users.models.CommCareUser.get",
"functools.partial",
"corehq.blobs.mixin.BlobHelper",
"corehq.blobs.m... | [((8919, 8947), 'corehq.blobs.mixin.BlobHelper', 'BlobHelper', (['doc', '*args'], {}), '(doc, *args, **kw)\n', (8929, 8947), False, 'from corehq.blobs.mixin import BlobHelper, BlobMetaRef\n'), ((1371, 1427), 'functools.partial', 'partial', (['BlobMetaMigrator'], {'blob_helper': 'couch_blob_helper'}), '(BlobMetaMigrator... |
from toontown.suit import DistributedFactorySuit
from toontown.suit.Suit import *
from direct.directnotify import DirectNotifyGlobal
from direct.actor import Actor
from otp.avatar import Avatar
from toontown.suit import SuitDNA
from toontown.toonbase import ToontownGlobals
from panda3d.core import *
from panda3d.direct... | [
"direct.directnotify.DirectNotifyGlobal.directNotify.newCategory"
] | [((590, 657), 'direct.directnotify.DirectNotifyGlobal.directNotify.newCategory', 'DirectNotifyGlobal.directNotify.newCategory', (['"""DistributedStageSuit"""'], {}), "('DistributedStageSuit')\n", (633, 657), False, 'from direct.directnotify import DirectNotifyGlobal\n')] |
from django.conf.urls import url
from .views import events_view, event_detail_view
urlpatterns = [
url(r'^$', events_view, name='list'),
url(r'^(?P<event_id>[\w-]+)/$', event_detail_view, name='detail'),
]
| [
"django.conf.urls.url"
] | [((104, 139), 'django.conf.urls.url', 'url', (['"""^$"""', 'events_view'], {'name': '"""list"""'}), "('^$', events_view, name='list')\n", (107, 139), False, 'from django.conf.urls import url\n'), ((146, 211), 'django.conf.urls.url', 'url', (['"""^(?P<event_id>[\\\\w-]+)/$"""', 'event_detail_view'], {'name': '"""detail"... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
from os.path import join, basename
from glob import glob
import argparse
sys.path.append('../')
from utils.util import mkdir_join, mkdir
from utils.in... | [
"argparse.ArgumentParser",
"os.path.join",
"utils.util.mkdir",
"os.path.basename",
"sys.path.append"
] | [((243, 265), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (258, 265), False, 'import sys\n'), ((358, 383), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (381, 383), False, 'import argparse\n'), ((1494, 1519), 'utils.util.mkdir', 'mkdir', (['args.htk_save_path'], {})... |
from typing import Iterable, Union, Optional
from time import strftime, localtime
import pandas as pd
import numpy as np
from tqdm import tqdm
import qontrol
from plab.config import logger, CONFIG
from plab.measurement import measurement, Measurement
from plab.smu.smu_control import smu_control
@measurement
def sweep... | [
"numpy.linspace",
"numpy.zeros_like"
] | [((637, 667), 'numpy.linspace', 'np.linspace', (['imin', 'imax', 'steps'], {}), '(imin, imax, steps)\n', (648, 667), True, 'import numpy as np\n'), ((843, 866), 'numpy.zeros_like', 'np.zeros_like', (['currents'], {}), '(currents)\n', (856, 866), True, 'import numpy as np\n')] |
import json
from django.contrib import admin
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from pygments import highlight
from pygments.formatters.html import HtmlFormatter
from pygments.lexers.data import JsonLexer
from owner.vehicle_util import display_format
from .models i... | [
"pygments.lexers.data.JsonLexer",
"owner.vehicle_util.display_format",
"django.contrib.admin.site.register",
"json.dumps",
"django.utils.safestring.mark_safe",
"pygments.formatters.html.HtmlFormatter"
] | [((3184, 3222), 'django.contrib.admin.site.register', 'admin.site.register', (['Owner', 'OwnerAdmin'], {}), '(Owner, OwnerAdmin)\n', (3203, 3222), False, 'from django.contrib import admin\n'), ((3223, 3265), 'django.contrib.admin.site.register', 'admin.site.register', (['Vehicle', 'VehicleAdmin'], {}), '(Vehicle, Vehic... |
import os, sys
example_folder = os.path.dirname(os.path.abspath(__file__))
files_path = [os.path.join(example_folder, x) for x in os.listdir(example_folder)]
for i, file in enumerate(files_path):
if file.endswith(".py"):
if __file__ in file:
continue
else:
print("\n=======... | [
"os.path.abspath",
"os.system",
"os.listdir",
"os.path.join"
] | [((50, 75), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (65, 75), False, 'import os, sys\n'), ((91, 122), 'os.path.join', 'os.path.join', (['example_folder', 'x'], {}), '(example_folder, x)\n', (103, 122), False, 'import os, sys\n'), ((132, 158), 'os.listdir', 'os.listdir', (['example_fold... |
import discord
from discord.ext import commands
import json
import os
import datetime
import random
colors = [0xFFE4E1, 0x00FF7F, 0xD8BFD8, 0xDC143C, 0xFF4500, 0xDEB887, 0xADFF2F, 0x800000, 0x4682B4, 0x006400, 0x808080, 0xA0522D, 0xF08080, 0xC71585, 0xFFB6C1, 0x00CED1, 0xff0000, 0xff8c00, 0xfff700, 0x5eff00, 0x00ffff,... | [
"discord.ext.commands.Cog.listener",
"json.load",
"random.choice"
] | [((489, 512), 'discord.ext.commands.Cog.listener', 'commands.Cog.listener', ([], {}), '()\n', (510, 512), False, 'from discord.ext import commands\n'), ((1183, 1206), 'discord.ext.commands.Cog.listener', 'commands.Cog.listener', ([], {}), '()\n', (1204, 1206), False, 'from discord.ext import commands\n'), ((2175, 2198)... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, print_function, absolute_import,
unicode_literals)
__all__ = []
import json
import sqlite3
if __name__ == "__main__":
with open("aas/abstracts.json") as f:
data = json.load(f)
with sqlite3.conne... | [
"json.load",
"json.dumps",
"sqlite3.connect"
] | [((284, 296), 'json.load', 'json.load', (['f'], {}), '(f)\n', (293, 296), False, 'import json\n'), ((307, 336), 'sqlite3.connect', 'sqlite3.connect', (['"""aas/aas.db"""'], {}), "('aas/aas.db')\n", (322, 336), False, 'import sqlite3\n'), ((1409, 1434), 'json.dumps', 'json.dumps', (["doc['counts']"], {}), "(doc['counts'... |
from collections import defaultdict
import logging
from xml.etree import cElementTree
from functools import partial
import asyncio as aio
import aiohttp as aioh
from aiohttp_wsgi import WSGIHandler
from aioouimeaux.utils import get_ip_address, requests_request
from aioouimeaux.device.insight import Insight
from aioou... | [
"logging.getLogger",
"xml.etree.cElementTree.fromstring",
"aioouimeaux.utils.get_ip_address",
"aiohttp.web.Application",
"aioouimeaux.utils.requests_request",
"collections.defaultdict",
"asyncio.sleep",
"asyncio.get_event_loop",
"random.randint",
"aiohttp_wsgi.WSGIHandler"
] | [((413, 440), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (430, 440), False, 'import logging\n'), ((685, 702), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (696, 702), False, 'from collections import defaultdict\n'), ((723, 742), 'random.randint', 'randint', ([... |
from datetime import datetime
class Results:
def __init__(self):
self.results = []
self.hit_goal = 0
def add_result(self, result, hit_goal=False):
self.results.append(result)
if hit_goal:
self.hit_goal += 1
def print_summary(self):
len_results = len(s... | [
"datetime.datetime.now"
] | [((493, 507), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (505, 507), False, 'from datetime import datetime\n')] |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2019-11-23 21:57
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('tracker', '0016_merge_20190914_1249'),
]
operatio... | [
"django.db.models.ForeignKey",
"django.db.models.PositiveIntegerField",
"django.db.models.BooleanField"
] | [((435, 599), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)', 'help_text': '"""Set this if this bid is a \'target\' for donations (bottom level choice or challenge)"""', 'verbose_name': '"""Target"""'}), '(default=False, help_text=\n "Set this if this bid is a \'target\' for donat... |
# Generated by Django 2.1.1 on 2019-08-21 00:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0014_auto_20190821_0852'),
]
operations = [
migrations.AlterField(
model_name='loan',
name='cbu',
... | [
"django.db.models.DecimalField"
] | [((327, 402), 'django.db.models.DecimalField', 'models.DecimalField', ([], {'blank': '(True)', 'decimal_places': '(2)', 'max_digits': '(20)', 'null': '(True)'}), '(blank=True, decimal_places=2, max_digits=20, null=True)\n', (346, 402), False, 'from django.db import migrations, models\n'), ((524, 576), 'django.db.models... |
import os
from setuptools import find_packages, setup
from openwisp_ipam import get_version
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
def get_install_requires():
"""
parse requirements.txt, ignore links, exclude comments
"""
requirements ... | [
"os.path.dirname",
"setuptools.find_packages",
"openwisp_ipam.get_version"
] | [((578, 591), 'openwisp_ipam.get_version', 'get_version', ([], {}), '()\n', (589, 591), False, 'from openwisp_ipam import get_version\n'), ((1014, 1056), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['tests*', 'docs*']"}), "(exclude=['tests*', 'docs*'])\n", (1027, 1056), False, 'from setuptools import... |
import sys
sys.path.append('dastro_bot/_default_settings')
| [
"sys.path.append"
] | [((12, 59), 'sys.path.append', 'sys.path.append', (['"""dastro_bot/_default_settings"""'], {}), "('dastro_bot/_default_settings')\n", (27, 59), False, 'import sys\n')] |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"mindspore.common.initializer.Zero",
"numpy.ones",
"psutil.Process",
"mindspore.common.initializer.random_normal",
"mindspore.ops.Pow",
"numpy.zeros",
"mindspore.ops.ReduceSum",
"model.resnet.resnet50",
"mindspore.ops.ReduceMean",
"os.getpid",
"mindspore.common.initializer.Normal",
"mindspore.... | [((1060, 1071), 'os.getpid', 'os.getpid', ([], {}), '()\n', (1069, 1071), False, 'import os\n'), ((1081, 1100), 'psutil.Process', 'psutil.Process', (['pid'], {}), '(pid)\n', (1095, 1100), False, 'import psutil\n'), ((2104, 2156), 'mindspore.common.initializer.random_normal', 'random_normal', (['arr.shape', 'seed', 'see... |
"""
Look operations module for doctests
"""
from operations import multiply_num
print(multiply_num(2, 10))
| [
"operations.multiply_num"
] | [((88, 107), 'operations.multiply_num', 'multiply_num', (['(2)', '(10)'], {}), '(2, 10)\n', (100, 107), False, 'from operations import multiply_num\n')] |
import os
from astropy import units as u
from pocs.scheduler.constraint import Altitude
from pocs.scheduler.constraint import Duration
from pocs.scheduler.constraint import MoonAvoidance
from pocs.scheduler.scheduler import BaseScheduler # pragma: no flakes
from pocs.utils.config import load_config
from pocs.utils i... | [
"os.path.exists",
"pocs.scheduler.constraint.Altitude",
"pocs.utils.error.NotFound",
"os.path.join",
"pocs.utils.logger.get_root_logger",
"pocs.scheduler.constraint.MoonAvoidance",
"pocs.utils.horizon.Horizon",
"pocs.scheduler.constraint.Duration",
"pocs.utils.location.create_location_from_config",
... | [((687, 704), 'pocs.utils.logger.get_root_logger', 'get_root_logger', ([], {}), '()\n', (702, 704), False, 'from pocs.utils.logger import get_root_logger\n'), ((1298, 1357), 'os.path.join', 'os.path.join', (["config['directories']['targets']", 'fields_file'], {}), "(config['directories']['targets'], fields_file)\n", (1... |
from stack import Stack
class Graph:
def __init__(self):
self.vertices: list = []
self.adjacencyList: dict = {}
self.distance: dict = {}
self.prev: dict = {}
self.colors: dict = {}
self.entry: dict = {}
self.exit: dict = {}
self.time: int = 0
def... | [
"stack.Stack"
] | [((727, 734), 'stack.Stack', 'Stack', ([], {}), '()\n', (732, 734), False, 'from stack import Stack\n')] |
import re
def Remove_Duplicates(Test_string):
Pattern = r"\b(\w+)(?:\W\1\b)+"
return re.sub(Pattern, r"\1", Test_string, flags=re.IGNORECASE)
Test_string1 = "Good bye bye world world"
Test_string2 = "Ram went went to to his home"
Test_string3 = "Hello hello world world"
print(Remove_Duplicates(Te... | [
"re.sub"
] | [((100, 156), 're.sub', 're.sub', (['Pattern', '"""\\\\1"""', 'Test_string'], {'flags': 're.IGNORECASE'}), "(Pattern, '\\\\1', Test_string, flags=re.IGNORECASE)\n", (106, 156), False, 'import re\n')] |
from typing import Iterable, List
from elasticsearch import Elasticsearch
from elasticsearch.helpers import bulk
from elasticsearch_reindex.logs import create_logger
logger = create_logger(__name__)
def chunkify(lst: List, n: int) -> Iterable:
"""
Yield successive n-sized chunks from list.
"""
# Sl... | [
"elasticsearch.helpers.bulk",
"elasticsearch_reindex.logs.create_logger"
] | [((178, 201), 'elasticsearch_reindex.logs.create_logger', 'create_logger', (['__name__'], {}), '(__name__)\n', (191, 201), False, 'from elasticsearch_reindex.logs import create_logger\n'), ((967, 1023), 'elasticsearch.helpers.bulk', 'bulk', ([], {'client': 'es_client', 'actions': 'actions', 'stats_only': '(True)'}), '(... |
"""
An example training an SGDClassifier, performing grid search
using TuneGridSearchCV.
This example uses early stopping to further improve runtimes
by eliminating worse hyperparameter choices early based off
of its average test score from cross validation.
"""
from tune_sklearn import TuneGridSearchCV
from sklearn.... | [
"sklearn.linear_model.SGDClassifier",
"sklearn.model_selection.train_test_split",
"tune_sklearn.TuneGridSearchCV",
"ray.tune.schedulers.MedianStoppingRule",
"sklearn.datasets.load_digits",
"numpy.array"
] | [((516, 538), 'sklearn.datasets.load_digits', 'datasets.load_digits', ([], {}), '()\n', (536, 538), False, 'from sklearn import datasets\n'), ((608, 645), 'sklearn.model_selection.train_test_split', 'train_test_split', (['x', 'y'], {'test_size': '(0.2)'}), '(x, y, test_size=0.2)\n', (624, 645), False, 'from sklearn.mod... |
#!/usr/bin/python
# This program generates and html file that shows movies and trailers based on IMDb's Top 250 list
# Sample usage:
# python entertainment_center.py --key={DEVELOPER_KEY} --max-results=10
# NOTE: To use this program, you must provide a developer key obtained
# in the Google APIs Console.
impo... | [
"fresh_tomatoes.open_movies_page",
"argparse.ArgumentParser",
"imdb_search.IMDBSearch",
"logger.Logger.get_logger",
"youtube_search.YoutubeSearch"
] | [((564, 582), 'imdb_search.IMDBSearch', 'IMDBSearch', (['logger'], {}), '(logger)\n', (574, 582), False, 'from imdb_search import IMDBSearch\n'), ((884, 908), 'fresh_tomatoes.open_movies_page', 'open_movies_page', (['movies'], {}), '(movies)\n', (900, 908), False, 'from fresh_tomatoes import open_movies_page\n'), ((986... |
import argparse
import numpy as np
import rdkit
from moses.metrics.metrics import get_all_metrics
from moses.script_utils import read_smiles_csv
lg = rdkit.RDLogger.logger()
lg.setLevel(rdkit.RDLogger.CRITICAL)
def main(config, print_metrics=True):
test = None
test_scaffolds = None
ptest = None
ptes... | [
"moses.script_utils.read_smiles_csv",
"argparse.ArgumentParser",
"rdkit.RDLogger.logger",
"moses.metrics.metrics.get_all_metrics",
"numpy.load"
] | [((152, 175), 'rdkit.RDLogger.logger', 'rdkit.RDLogger.logger', ([], {}), '()\n', (173, 175), False, 'import rdkit\n'), ((957, 989), 'moses.script_utils.read_smiles_csv', 'read_smiles_csv', (['config.gen_path'], {}), '(config.gen_path)\n', (972, 989), False, 'from moses.script_utils import read_smiles_csv\n'), ((1004, ... |
"""This module allows adding a semantic hub layout to NDEx CX networkx. This
is useful when a network is centered around a single hub node. The
layout generated here allocates different classes of nodes into segments
around the hub and then gives them random coordinates within that segment."""
import json
import math
... | [
"networkx.MultiDiGraph",
"math.cos",
"collections.defaultdict",
"json.load",
"random.random",
"math.sin"
] | [((2850, 2873), 'networkx.MultiDiGraph', 'networkx.MultiDiGraph', ([], {}), '()\n', (2871, 2873), False, 'import networkx\n'), ((4182, 4197), 'math.cos', 'math.cos', (['alpha'], {}), '(alpha)\n', (4190, 4197), False, 'import math\n'), ((4210, 4225), 'math.sin', 'math.sin', (['alpha'], {}), '(alpha)\n', (4218, 4225), Fa... |
import logging
from mpfmc.tests.MpfMcTestCase import MpfMcTestCase
from unittest.mock import MagicMock, ANY
try:
from mpfmc.core.audio import SoundSystem
from mpfmc.assets.sound import SoundStealingMethod
except ImportError:
SoundSystem = None
SoundStealingMethod = None
logging.warning("mpfmc.core... | [
"logging.getLogger",
"unittest.mock.MagicMock",
"logging.warning"
] | [((293, 404), 'logging.warning', 'logging.warning', (['"""mpfmc.core.audio library could not be loaded. Audio features will not be available"""'], {}), "(\n 'mpfmc.core.audio library could not be loaded. Audio features will not be available'\n )\n", (308, 404), False, 'import logging\n'), ((2231, 2242), 'unittest... |
# Generated by Django 4.0.3 on 2022-03-29 08:33
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('common', '0002_notification_is_answered'),
]
operations = [
migrations.AlterModelOptions(
name='notification',
options={'ord... | [
"django.db.migrations.AlterModelOptions"
] | [((232, 328), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""notification"""', 'options': "{'ordering': ['-received_date']}"}), "(name='notification', options={'ordering': [\n '-received_date']})\n", (260, 328), False, 'from django.db import migrations\n')] |
# -*- encoding: utf-8 -*-
#
# Copyright 2014 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | [
"aodh.storage.get_connection_from_config",
"aodh.service.prepare_service",
"oslo_log.log.getLogger"
] | [((698, 721), 'oslo_log.log.getLogger', 'log.getLogger', (['__name__'], {}), '(__name__)\n', (711, 721), False, 'from oslo_log import log\n'), ((749, 774), 'aodh.service.prepare_service', 'service.prepare_service', ([], {}), '()\n', (772, 774), False, 'from aodh import service\n'), ((858, 883), 'aodh.service.prepare_se... |
# coding=utf-8
# Copyright 2020 The Ravens Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | [
"pybullet.getQuaternionFromEuler",
"numpy.int32",
"ravens.utils.utils.eulerXYZ_to_quatXYZW",
"numpy.random.rand"
] | [((1923, 1968), 'ravens.utils.utils.eulerXYZ_to_quatXYZW', 'utils.eulerXYZ_to_quatXYZW', (['(0, 0, np.pi / 2)'], {}), '((0, 0, np.pi / 2))\n', (1949, 1968), False, 'from ravens.utils import utils\n'), ((3223, 3269), 'ravens.utils.utils.eulerXYZ_to_quatXYZW', 'utils.eulerXYZ_to_quatXYZW', (['(roll, pitch, yaw)'], {}), '... |
"""
Blending module.
Check Blending_ section of W3C recommendation for blending mode definitions.
.. _Blending: https://www.w3.org/TR/compositing/#blending
"""
from __future__ import absolute_import, unicode_literals
import logging
from psd_tools.utils import new_registry
from psd_tools.constants import BlendMode
fr... | [
"logging.getLogger",
"numpy.abs",
"numpy.copy",
"numpy.sqrt",
"numpy.minimum",
"PIL.Image.new",
"numpy.min",
"numpy.max",
"PIL.Image.alpha_composite",
"numpy.stack",
"numpy.expand_dims",
"psd_tools.utils.new_registry",
"numpy.maximum",
"numpy.zeros_like"
] | [((367, 394), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (384, 394), False, 'import logging\n'), ((424, 438), 'psd_tools.utils.new_registry', 'new_registry', ([], {}), '()\n', (436, 438), False, 'from psd_tools.utils import new_registry\n'), ((1013, 1049), 'PIL.Image.new', 'Image.new'... |
import tensorflow as tf
import tensorflow.keras as keras
from config import config
from utils.utils import *
from DL_Models.tf_models.BaseNet import BaseNet
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Dense, Activation, Permute, Dropout
from tensorflow.keras.layers import Conv2D, MaxPo... | [
"tensorflow.keras.layers.Input",
"tensorflow.keras.constraints.max_norm",
"tensorflow.keras.layers.Concatenate",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.SeparableConv2D",
"tensorflow.transpose",
"tensorflow.keras.layers.AveragePooling2D",
"tensorflow.keras.layers.BatchNormalization"... | [((1798, 1827), 'logging.info', 'logging.info', (['"""Parameters..."""'], {}), "('Parameters...')\n", (1810, 1827), False, 'import logging\n'), ((2822, 2901), 'tensorflow.keras.layers.Input', 'keras.layers.Input', (["(config['eegnet']['channels'], config['eegnet']['samples'])"], {}), "((config['eegnet']['channels'], co... |
import time
import dweepy
import RPi.GPIO as GPIO
KEY = 'tweet_about_me'
OUTPUT_PIN = 18
OUTPUT_DURATION = 10
GPIO.setmode(GPIO.BCM)
GPIO.setup(OUTPUT_PIN, GPIO.OUT)
while True:
try:
for dweet in dweepy.listen_for_dweets_from(KEY):
print('Tweet: ' + dweet['content']['text'])
GPIO.o... | [
"RPi.GPIO.setmode",
"RPi.GPIO.setup",
"RPi.GPIO.output",
"time.sleep",
"dweepy.listen_for_dweets_from"
] | [((112, 134), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BCM'], {}), '(GPIO.BCM)\n', (124, 134), True, 'import RPi.GPIO as GPIO\n'), ((135, 167), 'RPi.GPIO.setup', 'GPIO.setup', (['OUTPUT_PIN', 'GPIO.OUT'], {}), '(OUTPUT_PIN, GPIO.OUT)\n', (145, 167), True, 'import RPi.GPIO as GPIO\n'), ((210, 244), 'dweepy.listen_for... |
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import numpy.linalg as la
bear_black = (0.141, 0.11, 0.11)
bear_white = (0.89, 0.856, 0.856)
magenta = (0xfc / 255, 0x75 / 255, 0xdb / 255) # Brighter magenta
orange = (218 / 255, 171 / 255, 115 / 255)
green = (175 / 255, 219 ... | [
"matplotlib.use",
"numpy.array",
"numpy.linalg.norm",
"numpy.zeros_like",
"matplotlib.pyplot.subplots"
] | [((19, 40), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (33, 40), False, 'import matplotlib\n'), ((1770, 3781), 'numpy.array', 'np.array', (['[[2.0030351, 2.229253, 2.1639012, 2.0809546, 1.9728726, 1.8974666, \n 1.8924396, 2.0030351, np.nan, 2.7017972, 2.8500957, 2.9707453, \n 3.0159889,... |
"""all the tiny tk helper functions"""
#from Tkinter import Button
import logging, time
from rdflib import Literal
from tkinter.tix import Button, Toplevel, Tk, IntVar, Entry, DoubleVar
import tkinter
from light9.namespaces import L9
from typing import Dict
log = logging.getLogger("toplevel")
windowlocations = {
... | [
"logging.getLogger",
"tkinter.tix.DoubleVar.__init__",
"tkinter.tix.Tk",
"tkinter.tix.Button.__init__",
"rdflib.Literal",
"tkinter.tix.IntVar",
"tkinter.tix.Entry",
"time.time",
"tkinter.tix.Toplevel"
] | [((266, 295), 'logging.getLogger', 'logging.getLogger', (['"""toplevel"""'], {}), "('toplevel')\n", (283, 295), False, 'import logging, time\n'), ((8579, 8583), 'tkinter.tix.Tk', 'Tk', ([], {}), '()\n', (8581, 8583), False, 'from tkinter.tix import Button, Toplevel, Tk, IntVar, Entry, DoubleVar\n'), ((8625, 8633), 'tki... |
"""
This module implements execution test 3
Copyright (c) 2018 <NAME> <<EMAIL>>
"""
import time
import jocn.get_state as get
import jocn.startup as startup
hostTX = '10.1.7.65'
hostRX = '10.1.7.66'
port = 830
login = 'root'
password = '<PASSWORD>.'
filter = "<transceiver-connectivity/>"
# INIT
print("INIT SERVER C... | [
"jocn.startup.close_connection",
"time.sleep",
"jocn.startup.init_connection",
"jocn.startup.create_configuration",
"jocn.get_state.get_ber_and_osnr_parameters"
] | [((348, 402), 'jocn.startup.init_connection', 'startup.init_connection', (['hostTX', 'port', 'login', 'password'], {}), '(hostTX, port, login, password)\n', (371, 402), True, 'import jocn.startup as startup\n'), ((418, 472), 'jocn.startup.init_connection', 'startup.init_connection', (['hostRX', 'port', 'login', 'passwo... |
# -*- coding: utf-8 -*-
import torch
import torch.autograd as autograd
import torch.nn as nn
from src.utils.fn import stripe
class MatrixTree(nn.Module):
"""
MatrixTree for calculating partition functions and marginals in O(N^3) for directed spanning trees
(a.k.a. non-projective trees) by an adaptation o... | [
"torch.enable_grad",
"torch.empty_like",
"src.utils.fn.stripe",
"torch.finfo",
"torch.autograd.grad",
"torch.zeros_like",
"torch.isnan"
] | [((759, 778), 'torch.enable_grad', 'torch.enable_grad', ([], {}), '()\n', (776, 778), False, 'import torch\n'), ((4064, 4083), 'torch.enable_grad', 'torch.enable_grad', ([], {}), '()\n', (4081, 4083), False, 'import torch\n'), ((9258, 9277), 'torch.enable_grad', 'torch.enable_grad', ([], {}), '()\n', (9275, 9277), Fals... |
from setuptools import find_packages, setup
description = 'Create webhook services for Dialogflow using Python'
setup(
name='dialogflow-fulfillment',
version='0.4.4',
author='<NAME>',
author_email='<EMAIL>',
packages=find_packages('src'),
package_dir={'': 'src'},
url='https://github.com/gc... | [
"setuptools.find_packages"
] | [((239, 259), 'setuptools.find_packages', 'find_packages', (['"""src"""'], {}), "('src')\n", (252, 259), False, 'from setuptools import find_packages, setup\n')] |
from jim import cmd_funcs
from jim.util.util import register_cmd, register_pattern, ADMINISTRATOR_PERM, MODERATOR_PERM
def register_cmds():
register_cmd("8ball", "Ask the magic 8 ball.", None, 2, cmd_funcs.eight_ball, False)
register_cmd("addcom", "Adds a custom command.", ADMINISTRATOR_PERM|MODERATOR_PERM, 3... | [
"jim.util.util.register_cmd",
"jim.util.util.register_pattern"
] | [((146, 235), 'jim.util.util.register_cmd', 'register_cmd', (['"""8ball"""', '"""Ask the magic 8 ball."""', 'None', '(2)', 'cmd_funcs.eight_ball', '(False)'], {}), "('8ball', 'Ask the magic 8 ball.', None, 2, cmd_funcs.\n eight_ball, False)\n", (158, 235), False, 'from jim.util.util import register_cmd, register_pat... |
"""This is a minimal example that obtains the TBR (Tritium Breeding Ratio)
for a parametric ball reactor"""
import openmc
import paramak
def make_model_and_simulate():
"""Makes a neutronics Reactor model and simulates the TBR"""
# makes the 3d geometry from input parameters
my_reactor = paramak.BallReac... | [
"paramak.BallReactor",
"openmc.stats.Point",
"openmc.Source",
"paramak.NeutronicsModel",
"openmc.stats.Isotropic",
"openmc.stats.Discrete"
] | [((304, 774), 'paramak.BallReactor', 'paramak.BallReactor', ([], {'inner_bore_radial_thickness': '(50)', 'inboard_tf_leg_radial_thickness': '(200)', 'center_column_shield_radial_thickness': '(50)', 'divertor_radial_thickness': '(50)', 'inner_plasma_gap_radial_thickness': '(50)', 'plasma_radial_thickness': '(100)', 'out... |
from distutils.core import setup
setup(name='drv8835_driver_pigpio',
version='1.1.2',
description=('Library for the Pololu DRV8835 Dual Motor '
'Driver Kit for Raspberry Pi using pigpio daemon'),
url='http://www.pololu.com/product/2753',
py_modules=['drv8835_driver_pigpio'],
... | [
"distutils.core.setup"
] | [((33, 285), 'distutils.core.setup', 'setup', ([], {'name': '"""drv8835_driver_pigpio"""', 'version': '"""1.1.2"""', 'description': '"""Library for the Pololu DRV8835 Dual Motor Driver Kit for Raspberry Pi using pigpio daemon"""', 'url': '"""http://www.pololu.com/product/2753"""', 'py_modules': "['drv8835_driver_pigpio... |
import cv2, time
#TODO: fix ipcam
#import urllib2, base64
import numpy as np
class ipCamera(object):
def __init__(self,url, user = None, password = None):
self.url = url
auth_encoded = base64.encodestring('%s:%s' % (user, password))[:-1]
self.req = urllib2.Request(self.url)
self.r... | [
"numpy.ones",
"cv2.VideoCapture",
"cv2.imdecode",
"cv2.putText"
] | [((540, 566), 'cv2.imdecode', 'cv2.imdecode', (['img_array', '(1)'], {}), '(img_array, 1)\n', (552, 566), False, 'import cv2, time\n'), ((667, 691), 'cv2.VideoCapture', 'cv2.VideoCapture', (['camera'], {}), '(camera)\n', (683, 691), False, 'import cv2, time\n'), ((1003, 1041), 'numpy.ones', 'np.ones', (['(480, 640, 3)'... |
import time
from pyrogram import Filters, Message
from userbot import UserBot
from userbot.plugins.help import add_command_help
class Custom(dict):
def __missing__(self, key):
return 0
@UserBot.on_message(Filters.command("wordcount", ".") & Filters.me)
async def word_count(bot: UserBot, message: Messa... | [
"userbot.plugins.help.add_command_help",
"time.sleep",
"pyrogram.Filters.command"
] | [((1122, 1306), 'userbot.plugins.help.add_command_help', 'add_command_help', (['"""metrics"""', "[['.wordcount',\n 'Finds the 25 most used words in the last 1000 messages in a group or private chat. Use in chat you want to find the metric in.'\n ]]"], {}), "('metrics', [['.wordcount',\n 'Finds the 25 most used... |
import matplotlib.pyplot as plt
import numpy as np
import time
import torch
from torch import nn
from torch import tensor
from torch import optim
import torch.nn.functional as F
from torch.autograd import Variable
from torchvision import datasets, transforms
import torchvision.models as models
import argpars... | [
"nnutils2.train_network",
"argparse.ArgumentParser",
"nnutils2.load_checkpoint",
"nnutils2.nn_setup",
"nnutils2.load_data",
"nnutils2.save_checkpoint"
] | [((351, 398), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Train.py"""'}), "(description='Train.py')\n", (374, 398), False, 'import argparse\n'), ((1835, 1860), 'nnutils2.load_data', 'nnutils2.load_data', (['where'], {}), '(where)\n', (1853, 1860), False, 'import nnutils2\n'), ((2044, ... |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
"nemo.core.classes.exportable.Exportable._prepare_for_export",
"nemo.core.neural_types.AcousticEncodedRepresentation",
"nemo.core.neural_types.SpectrogramType",
"torch.nn.ReLU",
"torch.nn.ModuleList",
"math.sqrt",
"nemo.collections.asr.parts.multi_head_attention.PositionalEncoding",
"torch.transpose",... | [((6693, 6704), 'nemo.core.classes.common.typecheck', 'typecheck', ([], {}), '()\n', (6702, 6704), False, 'from nemo.core.classes.common import typecheck\n'), ((3173, 3209), 'nemo.core.classes.exportable.Exportable._prepare_for_export', 'Exportable._prepare_for_export', (['self'], {}), '(self)\n', (3203, 3209), False, ... |
from __future__ import unicode_literals
from utils import CanadianScraper, CanadianPerson as Person
from six.moves.urllib.parse import urljoin
COUNCIL_PAGE = 'http://www.regina.ca/residents/council-committees/meet-city-council/'
MAYOR_CONTACT_URL = 'http://www.regina.ca/residents/regina-mayor/contact_mayor'
class R... | [
"six.moves.urllib.parse.urljoin",
"utils.CanadianPerson"
] | [((1329, 1356), 'six.moves.urllib.parse.urljoin', 'urljoin', (['url', 'photo_url_rel'], {}), '(url, photo_url_rel)\n', (1336, 1356), False, 'from six.moves.urllib.parse import urljoin\n'), ((1369, 1447), 'utils.CanadianPerson', 'Person', ([], {'primary_org': '"""legislature"""', 'name': 'name', 'district': 'ward', 'rol... |
#!/usr/bin/env python
import os
from copy import copy
from lulu.common import (
dry_run,
url_size,
urls_size,
set_proxy,
print_info,
parse_host,
unset_proxy,
maybe_print,
get_filename,
download_urls,
download_url_ffmpeg,
print_more_compatible as print,
)
from lulu impor... | [
"lulu.util.log.wtf",
"lulu.common.get_filename",
"lulu.common.parse_host",
"lulu.common.download_url_ffmpeg",
"lulu.json_output.output",
"os.path.join",
"lulu.common.print_info",
"lulu.common.maybe_print",
"lulu.util.log.sprint",
"lulu.common.print_more_compatible",
"lulu.common.url_size",
"lu... | [((4918, 4925), 'lulu.common.print_more_compatible', 'print', ([], {}), '()\n', (4923, 4925), True, 'from lulu.common import dry_run, url_size, urls_size, set_proxy, print_info, parse_host, unset_proxy, maybe_print, get_filename, download_urls, download_url_ffmpeg, print_more_compatible as print\n'), ((5113, 5164), 'lu... |
# coding: utf-8
from __future__ import unicode_literals
from ...util import get_lang_class
from ...attrs import LIKE_NUM
import pytest
@pytest.mark.parametrize('word', ['eleven'])
def test_en_lex_attrs(word):
lang = get_lang_class('en')
like_num = lang.Defaults.lex_attr_getters[LIKE_NUM]
asse... | [
"pytest.mark.parametrize"
] | [((147, 190), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""word"""', "['eleven']"], {}), "('word', ['eleven'])\n", (170, 190), False, 'import pytest\n'), ((389, 442), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""word"""', "['elleve', 'første']"], {}), "('word', ['elleve', 'første'])\n", (4... |
"""
Test the multi-PCA module
"""
import numpy as np
from nose.tools import assert_raises
import nibabel
from nilearn.decomposition.multi_pca import MultiPCA
from nilearn.input_data import MultiNiftiMasker
def test_multi_pca():
# Smoke test the MultiPCA
# XXX: this is mostly a smoke test
shape = (6, 8,... | [
"numpy.eye",
"numpy.testing.assert_array_almost_equal",
"numpy.ones",
"numpy.arange",
"nose.tools.assert_raises",
"nilearn.decomposition.multi_pca.MultiPCA",
"nibabel.Nifti1Image",
"numpy.random.RandomState"
] | [((341, 350), 'numpy.eye', 'np.eye', (['(4)'], {}), '(4)\n', (347, 350), True, 'import numpy as np\n'), ((361, 385), 'numpy.random.RandomState', 'np.random.RandomState', (['(0)'], {}), '(0)\n', (382, 385), True, 'import numpy as np\n'), ((758, 797), 'nilearn.decomposition.multi_pca.MultiPCA', 'MultiPCA', ([], {'mask': ... |
#!/usr/bin/env python3
import argparse
import glob
import html
import json
import os
import random
import re
import shutil
import subprocess
import sys
import traceback
from datetime import datetime
from distutils.version import StrictVersion
from functools import partial
from multiprocessing import Pool
from typing i... | [
"mdx_utils.normalize_id",
"dateutil.relativedelta.relativedelta",
"re.compile",
"mdx_utils.fix_mdx",
"sys.exit",
"html.escape",
"re.search",
"datetime.datetime",
"re.split",
"CommonServerPython.tableToMarkdown",
"os.path.exists",
"argparse.ArgumentParser",
"json.dumps",
"sys.stderr.flush",... | [((1917, 1944), 'os.getenv', 'os.getenv', (['"""HEAD"""', '"""master"""'], {}), "('HEAD', 'master')\n", (1926, 1944), False, 'import os\n'), ((2161, 2184), 'os.getenv', 'os.getenv', (['"""FILE_REGEX"""'], {}), "('FILE_REGEX')\n", (2170, 2184), False, 'import os\n'), ((1964, 1993), 'os.getenv', 'os.getenv', (['"""MAX_FA... |