code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
import unittest import InheritanceBaseTest class DerivedClassTests(InheritanceBaseTest.BaseClassTests): def test_derived_pass(self): pass def test_derived_fail(self): self.assertTrue(False, "Force a failure in derived class test.") if __name__ == '__main__': unittest.main()
[ "unittest.main" ]
[((301, 316), 'unittest.main', 'unittest.main', ([], {}), '()\n', (314, 316), False, 'import unittest\n')]
"""Automatic benchmarking.""" # yapf: disable from garage_benchmarks.experiments.algos import (ddpg_garage_tf, ppo_garage_pytorch, ppo_garage_tf, td3_garage_tf, ...
[ "garage_benchmarks.helper.iterate_experiments", "garage_benchmarks.helper.benchmark" ]
[((721, 753), 'garage_benchmarks.helper.benchmark', 'benchmark', ([], {'plot': '(False)', 'auto': '(True)'}), '(plot=False, auto=True)\n', (730, 753), False, 'from garage_benchmarks.helper import benchmark, iterate_experiments\n'), ((983, 1015), 'garage_benchmarks.helper.benchmark', 'benchmark', ([], {'plot': '(False)'...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Dict, List, Mapping, Optional, Tuple, Union from .. import ...
[ "pulumi.getter", "warnings.warn", "pulumi.ResourceOptions", "pulumi.get" ]
[((6987, 7021), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""accessPolicy"""'}), "(name='accessPolicy')\n", (7000, 7021), False, 'import pulumi\n'), ((7405, 7438), 'pulumi.get', 'pulumi.get', (['self', '"""access_policy"""'], {}), "(self, 'access_policy')\n", (7415, 7438), False, 'import pulumi\n'), ((7583, 7606...
# -*- coding: utf-8 -*- from model.group import Group import random from random import randrange def test_delete_some_group(app,db,check_ui): if len(db.get_group_list()) == 0: app.group.create(Group(name="Group for delete")) old_groups = db.get_group_list() group=random.choice(old_...
[ "model.group.Group", "random.choice" ]
[((302, 327), 'random.choice', 'random.choice', (['old_groups'], {}), '(old_groups)\n', (315, 327), False, 'import random\n'), ((217, 247), 'model.group.Group', 'Group', ([], {'name': '"""Group for delete"""'}), "(name='Group for delete')\n", (222, 247), False, 'from model.group import Group\n')]
import os from datetime import datetime from unittest.mock import patch import pytest from slackclient import SlackClient as RealSlackClient from sqlalchemy import create_engine from sqlalchemy.orm import Session import karmabot.commands.topchannels from karmabot.commands.joke import _get_closest_category from karmab...
[ "karmabot.karma._parse_karma_change", "unittest.mock.patch.dict", "karmabot.db.karma_user.KarmaUser.metadata.drop_all", "pytest.fixture", "datetime.datetime", "karmabot.settings.SLACK_CLIENT.rtm_read", "sqlalchemy.create_engine", "karmabot.slack.perform_text_replacements", "karmabot.db.db_session.cr...
[((930, 951), 'datetime.datetime', 'datetime', (['(2017)', '(8)', '(23)'], {}), '(2017, 8, 23)\n', (938, 951), False, 'from datetime import datetime\n'), ((1199, 1230), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (1213, 1230), False, 'import pytest\n'), ((1286, 1317), 'p...
from src.strategy import EpsilonGreedyStrategy from src import config def test_exceed_min_episilon(): strategy = EpsilonGreedyStrategy() for i in range(int(config.N_FRAMES_TO_TRAIN / 10) + 5): strategy.decrease_epsilon() assert strategy.epsilon == config.MIN_EPSILON
[ "src.strategy.EpsilonGreedyStrategy" ]
[((118, 141), 'src.strategy.EpsilonGreedyStrategy', 'EpsilonGreedyStrategy', ([], {}), '()\n', (139, 141), False, 'from src.strategy import EpsilonGreedyStrategy\n')]
### ### Copyright (C) 2018-2021 Intel Corporation ### ### SPDX-License-Identifier: BSD-3-Clause ### import os import slash from ....lib.gstreamer.encoderbase import BaseEncoderTest, Encoder as GstEncoder from ....lib.gstreamer.util import have_gst_element from ....lib.gstreamer.msdk.util import using_compatible_drive...
[ "slash.requires" ]
[((2571, 2610), 'slash.requires', 'slash.requires', (['using_compatible_driver'], {}), '(using_compatible_driver)\n', (2585, 2610), False, 'import slash\n')]
""" Yelp Scraper Part 1 This module utilizes the Yelp Fusion API to find businesses within a geographic area centered on a city. """ from yelpapi import YelpAPI from decouple import config import os import numpy as np import pandas as pd from app_global import g ######################### ### Environment Set...
[ "pandas.DataFrame", "decouple.config" ]
[((3326, 3368), 'pandas.DataFrame', 'pd.DataFrame', (["search_results['businesses']"], {}), "(search_results['businesses'])\n", (3338, 3368), True, 'import pandas as pd\n'), ((1435, 1452), 'decouple.config', 'config', (['"""api_key"""'], {}), "('api_key')\n", (1441, 1452), False, 'from decouple import config\n')]
import numpy as np import pandas as pd import os import math import matplotlib.pyplot as plt import pickle import geopy import geopy.distance as distance def retrieve_and_save(countries, fns, out_dir, keys, sample=True): for idx, country in enumerate(countries): df = pd.read_csv(fns[idx], sep=' ') df = df...
[ "math.ceil", "numpy.ones", "pandas.read_csv", "pickle.dump", "os.path.join", "numpy.max", "numpy.array", "numpy.zeros", "geopy.distance.great_circle", "geopy.Point", "numpy.min" ]
[((2394, 2408), 'numpy.array', 'np.array', (['lats'], {}), '(lats)\n', (2402, 2408), True, 'import numpy as np\n'), ((2419, 2433), 'numpy.array', 'np.array', (['lons'], {}), '(lons)\n', (2427, 2433), True, 'import numpy as np\n'), ((2448, 2461), 'numpy.min', 'np.min', (['nlats'], {}), '(nlats)\n', (2454, 2461), True, '...
# Autogenerated using symbolic_dynamics_n.py; don't edit! from enum import IntEnum import numpy as np from numpy import sin, cos from .dynamic_model_n import NBallDynamicModel class StateIndex(IntEnum): ALPHA_1_IDX = 0, PHI_IDX = 1, PSI_0_IDX = 2, ALPHA_DOT_1_IDX = 3, PHI_DOT_IDX = 4, PSI_DOT...
[ "numpy.sin", "numpy.zeros", "numpy.linalg.solve", "numpy.cos" ]
[((802, 810), 'numpy.cos', 'cos', (['phi'], {}), '(phi)\n', (805, 810), False, 'from numpy import sin, cos\n'), ((965, 973), 'numpy.sin', 'sin', (['phi'], {}), '(phi)\n', (968, 973), False, 'from numpy import sin, cos\n'), ((1073, 1083), 'numpy.sin', 'sin', (['psi_0'], {}), '(psi_0)\n', (1076, 1083), False, 'from numpy...
import abc from contextlib import contextmanager import datetime from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, String, ForeignKey, Float, Integer, DateTime, Enum from . import requests from . import storage RequestsBase = declarative_base() class SQLAlchemyStorage(abc.ABC):...
[ "sqlalchemy.orm.sessionmaker", "sqlalchemy.create_engine", "sqlalchemy.ForeignKey", "sqlalchemy.ext.declarative.declarative_base", "sqlalchemy.Enum", "datetime.timedelta", "sqlalchemy.Column" ]
[((266, 284), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', ([], {}), '()\n', (282, 284), False, 'from sqlalchemy.ext.declarative import declarative_base\n'), ((1300, 1361), 'sqlalchemy.Column', 'Column', (['String'], {'nullable': '(False)', 'primary_key': '(True)', 'unique': '(True)'}), '(String, ...
#!/usr/bin/env python """ TODO: Modify module doc. """ from __future__ import division __author__ = "<NAME>" __copyright__ = "Copyright 2013, The Materials Virtual Lab" __version__ = "0.1" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" __date__ = "4/12/14" import inspect import itertools import numpy as np from p...
[ "symmetry.groups.SpaceGroup", "matplotlib.pyplot.plot", "itertools.product", "inspect.getargspec", "numpy.array", "matplotlib.pyplot.figure", "numpy.dot", "numpy.cos", "matplotlib.pyplot.tight_layout", "numpy.sin", "matplotlib.pyplot.ylim", "matplotlib.pyplot.xlim", "numpy.arange", "matplo...
[((2553, 2571), 'symmetry.groups.SpaceGroup', 'SpaceGroup', (['"""Pnma"""'], {}), "('Pnma')\n", (2563, 2571), False, 'from symmetry.groups import SpaceGroup\n'), ((1011, 1039), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(10, 10)'}), '(figsize=(10, 10))\n', (1021, 1039), True, 'import matplotlib.pyplot ...
""" Module providing unit-testing for the `~halotools.mock_observables.tpcf` function. """ from __future__ import absolute_import, division, print_function, unicode_literals import numpy as np import warnings import pytest from astropy.utils.misc import NumpyRNGContext from .locate_external_unit_testing_data import t...
[ "numpy.allclose", "astropy.utils.misc.NumpyRNGContext", "numpy.random.random", "numpy.array", "numpy.linspace", "pytest.raises", "pytest.mark.skipif", "numpy.all", "numpy.load" ]
[((21047, 21098), 'pytest.mark.skipif', 'pytest.mark.skipif', (['"""not TPCF_CORRFUNC_FILES_EXIST"""'], {}), "('not TPCF_CORRFUNC_FILES_EXIST')\n", (21065, 21098), False, 'import pytest\n'), ((971, 996), 'numpy.array', 'np.array', (['[1.0, 1.0, 1.0]'], {}), '([1.0, 1.0, 1.0])\n', (979, 996), True, 'import numpy as np\n...
from pathlib import PurePath from unittest import TestCase from unittest.mock import Mock from core_get.package.manifest import Manifest, VariantManifest from core_get.package.package_maker import PackageMaker class TestPackageMaker(TestCase): def test_package_zips_right_directory(self): project_director...
[ "pathlib.PurePath", "unittest.mock.Mock", "core_get.package.manifest.VariantManifest", "core_get.package.package_maker.PackageMaker" ]
[((332, 338), 'unittest.mock.Mock', 'Mock', ([], {}), '()\n', (336, 338), False, 'from unittest.mock import Mock\n'), ((473, 479), 'unittest.mock.Mock', 'Mock', ([], {}), '()\n', (477, 479), False, 'from unittest.mock import Mock\n'), ((634, 661), 'unittest.mock.Mock', 'Mock', ([], {'return_value': 'manifest'}), '(retu...
import scrapy import json import requests import time from spiderUtil import FbrefFixtureResponseWrapper, FbrefMatchResponseWrapper from hashlib import md5 from dateSearch import DateSearch from itertools import permutations from scrapy.http import HtmlResponse class FixturesSpider(scrapy.Spider): name = "Fixtu...
[ "dateSearch.DateSearch", "json.dumps", "spiderUtil.FbrefFixtureResponseWrapper", "requests.get", "spiderUtil.FbrefMatchResponseWrapper", "scrapy.http.HtmlResponse", "time.time" ]
[((2613, 2670), 'spiderUtil.FbrefMatchResponseWrapper', 'FbrefMatchResponseWrapper', (['response', 'plSpider', 'matchScore'], {}), '(response, plSpider, matchScore)\n', (2638, 2670), False, 'from spiderUtil import FbrefFixtureResponseWrapper, FbrefMatchResponseWrapper\n'), ((2905, 2942), 'spiderUtil.FbrefFixtureRespons...
from aiida_firecrest.scheduler import FirecrestScheduler from aiida_firecrest.transport import FirecrestTransport def test_init_scheduler(): FirecrestScheduler() def init_transport(firecrest_server): transport = FirecrestTransport( url=firecrest_server.url, token_uri=firecrest_server.token_u...
[ "aiida_firecrest.scheduler.FirecrestScheduler", "aiida_firecrest.transport.FirecrestTransport" ]
[((147, 167), 'aiida_firecrest.scheduler.FirecrestScheduler', 'FirecrestScheduler', ([], {}), '()\n', (165, 167), False, 'from aiida_firecrest.scheduler import FirecrestScheduler\n'), ((224, 434), 'aiida_firecrest.transport.FirecrestTransport', 'FirecrestTransport', ([], {'url': 'firecrest_server.url', 'token_uri': 'fi...
import im3components as cmp class BuildDocs: TargetFile = 'components.rst' def __init__(self): self.heading = """ ================== Component Registry ================== """ self.body_element = """ {header_bar} {name} {header_bar} **Parent**: {parent} **Child**: {child} ...
[ "im3components.registry" ]
[((610, 624), 'im3components.registry', 'cmp.registry', ([], {}), '()\n', (622, 624), True, 'import im3components as cmp\n')]
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.GL import _types as _cs # End users want this... from OpenGL.raw.GL._types import * from OpenGL.raw.GL import _errors from OpenGL.constant import Constant as _C import ctypes _...
[ "OpenGL.constant.Constant", "OpenGL.platform.createFunction" ]
[((512, 541), 'OpenGL.constant.Constant', '_C', (['"""GL_ALPHA16_SNORM"""', '(36888)'], {}), "('GL_ALPHA16_SNORM', 36888)\n", (514, 541), True, 'from OpenGL.constant import Constant as _C\n'), ((558, 586), 'OpenGL.constant.Constant', '_C', (['"""GL_ALPHA8_SNORM"""', '(36884)'], {}), "('GL_ALPHA8_SNORM', 36884)\n", (560...
# dper related code import models def copy_as_dbr(song_pk): # attempt to get object try: song_obj = models.Song.objects.get(id=song_pk) except Exception as e: return (False, 'invalid song id') # check is already DBR if (song_obj.songtype[:3].upper() == 'DBR'): return (False,...
[ "models.Song.objects.create", "models.Song.objects.get" ]
[((582, 852), 'models.Song.objects.create', 'models.Song.objects.create', ([], {'songid': 'song_obj.songid', 'songtitle': "('%s (%d%s)' % (song_obj.songtitle, lvl, chartdiff))", 'songtype': "('DBR%s' % chartdiff)", 'songlevel': '(0)', 'songnotes': '(song_obj.songnotes * 2)', 'version': 'song_obj.version', 'original': '...
from __future__ import division import numpy as np import utils import pdb data = utils.load_dataset("credittest") Xvalid, yvalid = data['X'], data['y'] def kappa(ww, delta): ww = np.array(ww) yhat = np.sign(np.dot(Xvalid, ww)) ww2 = np.array(ww + delta) yhat2 = np.sign(np.dot(Xvalid, ww2)) ...
[ "numpy.argpartition", "numpy.sort", "numpy.array", "numpy.dot", "numpy.sum", "pdb.set_trace", "utils.load_dataset" ]
[((83, 115), 'utils.load_dataset', 'utils.load_dataset', (['"""credittest"""'], {}), "('credittest')\n", (101, 115), False, 'import utils\n'), ((191, 203), 'numpy.array', 'np.array', (['ww'], {}), '(ww)\n', (199, 203), True, 'import numpy as np\n'), ((258, 278), 'numpy.array', 'np.array', (['(ww + delta)'], {}), '(ww +...
""" Wipe all your tweets. 2018 zxvfxwing """ import csv import toml import time import twitter import argparse # TOML filename: toml_fname = "credentials.toml" # CSV default filename: csv_fname = "tweets.csv" def arguments(): parser = argparse.ArgumentParser() group = parser.add_mutually_exclusive_group() ...
[ "csv.DictReader", "argparse.ArgumentParser", "time.monotonic", "time.sleep", "toml.load", "twitter.Api" ]
[((243, 268), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (266, 268), False, 'import argparse\n'), ((962, 977), 'toml.load', 'toml.load', (['conf'], {}), '(conf)\n', (971, 977), False, 'import toml\n'), ((989, 1185), 'twitter.Api', 'twitter.Api', ([], {'consumer_key': "user['consumer']['key'...
from ocdsdata import util from ocdsdata.base import Source class MexicoCDMXSource(Source): publisher_name = 'Mexico CDMX' url = 'http://www.contratosabiertos.cdmx.gob.mx' source_id = 'mexico_cdmx' def gather_all_download_urls(self): r = util.get_url_request('http://www.contratosabiertos.cdmx....
[ "ocdsdata.util.get_url_request" ]
[((264, 353), 'ocdsdata.util.get_url_request', 'util.get_url_request', (['"""http://www.contratosabiertos.cdmx.gob.mx/api/contratos/todos"""'], {}), "(\n 'http://www.contratosabiertos.cdmx.gob.mx/api/contratos/todos')\n", (284, 353), False, 'from ocdsdata import util\n')]
""" Operations on DMRS structures """ from typing import Optional, Dict, List, Callable import warnings from delphin import variable from delphin import scope from delphin import mrs from delphin import dmrs _HCMap = Dict[str, mrs.HCons] _IdMap = Dict[str, int] def from_mrs( m: mrs.MRS, representative_priori...
[ "delphin.scope.representatives", "delphin.dmrs.Node", "delphin.variable.type", "delphin.dmrs.Link", "warnings.warn", "delphin.dmrs.DMRS" ]
[((898, 956), 'delphin.scope.representatives', 'scope.representatives', (['m'], {'priority': 'representative_priority'}), '(m, priority=representative_priority)\n', (919, 956), False, 'from delphin import scope\n'), ((1612, 1728), 'delphin.dmrs.DMRS', 'dmrs.DMRS', ([], {'top': 'top', 'index': 'index', 'nodes': 'nodes',...
import numpy as np import pandas as pd import itertools import matplotlib.pyplot as plt from sklearn.model_selection import cross_val_predict,cross_val_score,train_test_split from sklearn.metrics import classification_report,confusion_matrix,roc_curve,auc,precision_recall_curve,roc_curve import pickle #raw_df = pd.r...
[ "matplotlib.pyplot.ylabel", "sklearn.metrics.auc", "pandas.value_counts", "sklearn.metrics.precision_score", "sklearn.metrics.recall_score", "sklearn.metrics.roc_curve", "numpy.isfinite", "pandas.read_excel", "statsmodels.api.families.Gamma", "numpy.mean", "matplotlib.pyplot.xlabel", "matplotl...
[((520, 570), 'pandas.read_excel', 'pd.read_excel', (['myfile'], {'sheet_name': '"""Data"""', 'header': '(0)'}), "(myfile, sheet_name='Data', header=0)\n", (533, 570), True, 'import pandas as pd\n'), ((7507, 7519), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (7517, 7519), True, 'import matplotlib.pyplot...
import subprocess import pytest from ..helpers import BaseWFC3 @pytest.mark.xfail(reason="Temporary xfail. New input/truth files on Artifactory, but branch not merged.") class TestUVIS32Single(BaseWFC3): """ Test pos UVIS2 subarray data with CTE correction """ detector = 'uvis' def _single_...
[ "pytest.mark.xfail", "pytest.mark.parametrize", "subprocess.call" ]
[((67, 182), 'pytest.mark.xfail', 'pytest.mark.xfail', ([], {'reason': '"""Temporary xfail. New input/truth files on Artifactory, but branch not merged."""'}), "(reason=\n 'Temporary xfail. New input/truth files on Artifactory, but branch not merged.'\n )\n", (84, 182), False, 'import pytest\n'), ((926, 976), 'py...
# Copyright 2014-present PlatformIO <<EMAIL>> # # 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...
[ "SCons.Script.DefaultEnvironment", "os.path.isdir", "os.path.join" ]
[((1015, 1035), 'SCons.Script.DefaultEnvironment', 'DefaultEnvironment', ([], {}), '()\n', (1033, 1035), False, 'from SCons.Script import DefaultEnvironment\n'), ((1131, 1151), 'os.path.isdir', 'isdir', (['FRAMEWORK_DIR'], {}), '(FRAMEWORK_DIR)\n', (1136, 1151), False, 'from os.path import isdir, isfile, join\n'), ((30...
# Generated by Django 2.1.2 on 2018-11-22 08:34 from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('events', '0020_auto_20181122_0033'), ] operations = [ migrations.AlterField( model_name='event'...
[ "django.db.models.ManyToManyField" ]
[((371, 527), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'blank': '(True)', 'help_text': '"""Other users on athlete.photo functioning as organizers for this event."""', 'to': 'settings.AUTH_USER_MODEL'}), "(blank=True, help_text=\n 'Other users on athlete.photo functioning as organizers for ...
# Generated by Django 3.1.7 on 2021-04-04 11:42 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('invoice', '0001_initial'), ] operations = [ migrations.CreateModel( name='Trainer', fields=[ ('id', ...
[ "django.db.models.EmailField", "django.db.models.AutoField", "django.db.models.CharField", "django.db.models.IntegerField" ]
[((320, 413), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (336, 413), False, 'from django.db import migrations, models\...
# Generated by Django 4.0.3 on 2022-03-20 16:07 from django.db import migrations def seed_pickles(apps, schema_editor): pickles = [ ("Ahold", "Ahold Pickle Chips Hamburger Dills"), ("The Brinery", "The Brinery Pickles Jape Kin Cod"), ("Marco Polo", "Marco Polo Home Made Pickled Mushrooms"),...
[ "django.db.migrations.RunPython" ]
[((17314, 17348), 'django.db.migrations.RunPython', 'migrations.RunPython', (['seed_pickles'], {}), '(seed_pickles)\n', (17334, 17348), False, 'from django.db import migrations\n')]
import os from pytest import fixture from cumulusci.core.github import get_github_api @fixture def gh_api(): return get_github_api("TestOwner", "TestRepo") @fixture(scope="class", autouse=True) def restore_cwd(): d = os.getcwd() try: yield finally: os.chdir(d)
[ "pytest.fixture", "cumulusci.core.github.get_github_api", "os.chdir", "os.getcwd" ]
[((166, 202), 'pytest.fixture', 'fixture', ([], {'scope': '"""class"""', 'autouse': '(True)'}), "(scope='class', autouse=True)\n", (173, 202), False, 'from pytest import fixture\n'), ((123, 162), 'cumulusci.core.github.get_github_api', 'get_github_api', (['"""TestOwner"""', '"""TestRepo"""'], {}), "('TestOwner', 'TestR...
import pandas as pd import numpy as np from tqdm import tqdm from dateutil.relativedelta import relativedelta from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor from sklearn.multioutput import RegressorChain from sklearn.metrics import fbeta_score, mean_squared_error, r2_score from sklearn.prepr...
[ "vespid.data.neo4j_tools.Relationships", "dateutil.relativedelta.relativedelta", "vespid.models.static_communities.cosine_similarities", "vespid.models.static_communities.get_cluster_data", "vespid.setup_logger", "vespid.models.static_communities.jaccard_coefficient", "sklearn.multioutput.RegressorChain...
[((642, 664), 'vespid.setup_logger', 'setup_logger', (['__name__'], {}), '(__name__)\n', (654, 664), False, 'from vespid import setup_logger\n'), ((43773, 43789), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', ([], {}), '()\n', (43787, 43789), False, 'from sklearn.preprocessing import StandardScaler\n'), ((4...
import os # default constants WIDTH = 1360 HEIGHT = 720 FPS = 30 CAPTION = 'Parking Evolution' FONT = 'Arial' SCORE_TEXT = 'Parking score: ' # RGB of most basic colors BLACK = (0 , 0 , 0 ) WHITE = (255, 255, 255) RED = (255, 0 , 0 ) GREEN = (0 , 255, 0 ) BLUE = (0 , 0 , 255) # set up assets folder game_f...
[ "os.path.dirname", "os.path.join" ]
[((328, 353), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (343, 353), False, 'import os\n'), ((367, 402), 'os.path.join', 'os.path.join', (['game_folder', '"""assets"""'], {}), "(game_folder, 'assets')\n", (379, 402), False, 'import os\n'), ((418, 453), 'os.path.join', 'os.path.join', (['g...
#!/usr/bin/env python3 """Investigates the distribution for link Markov models. The link Markov model is based on the linking behavior of a given linkograph. Since the links in a linkograph are determined by ontology, the transition model is depending on the ontology. This script creates a sequence of random Markov m...
[ "numpy.mean", "argparse.ArgumentParser", "matplotlib.pyplot.ylabel", "markov.Model.genModelFromOntology", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "markov.Model.genModelFromLinko", "matplotlib.pyplot.figure", "numpy.zeros", "json.load", "matplotlib.pyplot.title", "time.time", "m...
[((5197, 5238), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'info'}), '(description=info)\n', (5220, 5238), False, 'import argparse\n'), ((7254, 7267), 'matplotlib.pyplot.figure', 'plt.figure', (['(1)'], {}), '(1)\n', (7264, 7267), True, 'import matplotlib.pyplot as plt\n'), ((7336, 7369)...
from Utils.Data.DatasetUtils import is_test_or_val_set, get_train_set_id_from_test_or_val_set from Utils.Data.Dictionary.MappingDictionary import * from Utils.Data.Features.Generated.GeneratedFeature import GeneratedFeaturePickle, GeneratedFeatureOnlyPickle from Utils.Data.Features.MappedFeatures import MappedFeatureTw...
[ "Utils.Data.Features.MappedFeatures.MappedFeatureTweetLanguage" ]
[((2060, 2103), 'Utils.Data.Features.MappedFeatures.MappedFeatureTweetLanguage', 'MappedFeatureTweetLanguage', (['self.dataset_id'], {}), '(self.dataset_id)\n', (2086, 2103), False, 'from Utils.Data.Features.MappedFeatures import MappedFeatureTweetLanguage\n')]
from python.enclave_interfaces import GlobalTensor as gt from python.timer_utils import NamedTimerInstance from python.torch_utils import compare_expected_actual from python.tensor_loader import TensorLoader import torch class SecretLayerBase(TensorLoader): PrevLayer = None NextLayer = None PlainForwardRe...
[ "python.timer_utils.NamedTimerInstance", "torch.set_num_threads" ]
[((3797, 3862), 'python.timer_utils.NamedTimerInstance', 'NamedTimerInstance', (['f"""S{self.sid}: {self.LayerName} PlainForward"""'], {}), "(f'S{self.sid}: {self.LayerName} PlainForward')\n", (3815, 3862), False, 'from python.timer_utils import NamedTimerInstance\n'), ((3876, 3900), 'torch.set_num_threads', 'torch.set...
from pyspark import SparkConf, SparkContext import collections conf = SparkConf().setMaster("local").setAppName("RatingsHistogram") #sc = SparkContext(conf = conf) sc = SparkContext.getOrCreate(); lines = sc.textFile("ml-100k/u.data") ratings = lines.map(lambda x: x.split()[2]) result = ratings.countByValue() sorted...
[ "pyspark.SparkConf", "pyspark.SparkContext.getOrCreate" ]
[((170, 196), 'pyspark.SparkContext.getOrCreate', 'SparkContext.getOrCreate', ([], {}), '()\n', (194, 196), False, 'from pyspark import SparkConf, SparkContext\n'), ((71, 82), 'pyspark.SparkConf', 'SparkConf', ([], {}), '()\n', (80, 82), False, 'from pyspark import SparkConf, SparkContext\n')]
"""Configuration for Elmax tests.""" import json from elmax_api.constants import ( BASE_URL, ENDPOINT_DEVICES, ENDPOINT_DISCOVERY, ENDPOINT_LOGIN, ) from httpx import Response import pytest import respx from tests.common import load_fixture from tests.components.elmax import MOCK_PANEL_ID, MOCK_PANEL_...
[ "pytest.fixture", "respx.mock", "tests.common.load_fixture" ]
[((327, 355), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (341, 355), False, 'import pytest\n'), ((439, 493), 'respx.mock', 'respx.mock', ([], {'base_url': 'BASE_URL', 'assert_all_called': '(False)'}), '(base_url=BASE_URL, assert_all_called=False)\n', (449, 493), False, 'import ...
# This file was *autogenerated* from the file script.sage from sage.all_cmdline import * # import sage library _sage_const_1 = Integer(1) from pwn import remote from Crypto.Util.number import * conn = remote("07.cr.yp.toc.tf", "10101", level="error") """ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++...
[ "pwn.remote" ]
[((207, 256), 'pwn.remote', 'remote', (['"""07.cr.yp.toc.tf"""', '"""10101"""'], {'level': '"""error"""'}), "('07.cr.yp.toc.tf', '10101', level='error')\n", (213, 256), False, 'from pwn import remote\n')]
# coding: utf-8 ''' what: vocabulary class for word2index, index2word & sentence -> index list ''' import numpy as np import operator class Vocab: def __init__(self, dic): self.dic = dic self.index = [] self._create_index() def _create_index(self): ...
[ "operator.itemgetter" ]
[((370, 392), 'operator.itemgetter', 'operator.itemgetter', (['(1)'], {}), '(1)\n', (389, 392), False, 'import operator\n')]
from findpython.utils import WINDOWS, looks_like_python import pytest matrix = [ ("python", True), ("python3", True), ("python38", True), ("python3.8", True), ("python3.10", True), ("python310", True), ("python3.6m", True), ("python3.6.8m", False), ("anaconda3.3", True), ("pyth...
[ "pytest.mark.parametrize", "findpython.utils.looks_like_python" ]
[((540, 589), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""name, expected"""', 'matrix'], {}), "('name, expected', matrix)\n", (563, 589), False, 'import pytest\n'), ((645, 668), 'findpython.utils.looks_like_python', 'looks_like_python', (['name'], {}), '(name)\n', (662, 668), False, 'from findpython.uti...
import argparse import logging import os import flask from flask import json from flask import views import psycopg2 as psy class RootView(views.MethodView): def get(self): return flask.render_template('index.html') class ItemsView(views.MethodView): def __init__(self, args): self.args = ar...
[ "logging.basicConfig", "flask.render_template", "psycopg2.connect", "argparse.ArgumentParser", "flask.Flask", "flask.json.jsonify", "os.getenv", "logging.info" ]
[((844, 865), 'flask.Flask', 'flask.Flask', (['__name__'], {}), '(__name__)\n', (855, 865), False, 'import flask\n'), ((1544, 1583), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (1563, 1583), False, 'import logging\n'), ((1588, 1631), 'logging.info', 'logging....
#!/usr/bin/env python3 # Arguments: # -h: help, -v: verbose mode -m mpi-tasks import os, sys, argparse, subprocess #------------------------------------------------ def guess_mpi_cmd(mpi_tasks, cpu_allocation, verbose): if verbose: print('os.uname=', os.uname()) node_name = os.uname()[1] if verbose: prin...
[ "subprocess.run", "argparse.ArgumentParser", "os.uname" ]
[((4642, 4667), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (4665, 4667), False, 'import os, sys, argparse, subprocess\n'), ((286, 296), 'os.uname', 'os.uname', ([], {}), '()\n', (294, 296), False, 'import os, sys, argparse, subprocess\n'), ((362, 372), 'os.uname', 'os.uname', ([], {}), '()\...
# Generated by Django 4.0 on 2022-01-01 17:23 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('publication', '0002_post'), ] operations = [ migrations.RenameField( model_name='post', old_name='user', new_name=...
[ "django.db.migrations.RenameField" ]
[((215, 292), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""post"""', 'old_name': '"""user"""', 'new_name': '"""author"""'}), "(model_name='post', old_name='user', new_name='author')\n", (237, 292), False, 'from django.db import migrations\n')]
import logging import json import re import urllib.parse from urllib.request import urlopen FORMAT = '[%(levelname)s] (%(threadName)-9s) %(message)s' logging.basicConfig(format=FORMAT) # Decoders for API Output - TODO: Proper error handling def _decode_json(s): try: if s == '': logging.info('...
[ "logging.basicConfig", "logging.getLogger", "json.loads", "logging.info", "logging.error", "re.search" ]
[((151, 185), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': 'FORMAT'}), '(format=FORMAT)\n', (170, 185), False, 'import logging\n'), ((402, 415), 'json.loads', 'json.loads', (['s'], {}), '(s)\n', (412, 415), False, 'import json\n'), ((1007, 1059), 're.search', 're.search', (['"""^(\\\\d+)\\\\s-\\\\s(.+)...
# Generated by Django 3.2.6 on 2021-08-29 20:50 import django.contrib.postgres.fields from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("village_api", "0005_person_family_name"), ] operations = [ migrations.RemoveField( model_n...
[ "django.db.migrations.RemoveField", "django.db.models.CharField" ]
[((277, 337), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""person"""', 'name': '"""siblings"""'}), "(model_name='person', name='siblings')\n", (299, 337), False, 'from django.db import migrations, models\n'), ((553, 584), 'django.db.models.CharField', 'models.CharField', ([], {'...
# Copyright 2022 <NAME> # This file, and derivatives thereof are licensed under the Apache License, Version 2.0 (the "License"); # Use of this file means you agree to the terms and conditions of the license and are in full compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/...
[ "pkg.core.StockTransactor.StockTransactor" ]
[((791, 817), 'pkg.core.StockTransactor.StockTransactor', 'StockTransactor', (['file_name'], {}), '(file_name)\n', (806, 817), False, 'from pkg.core.StockTransactor import StockTransactor\n')]
#!/usr/bin/env python import sys import os if sys.argv[1] == "": print("create_dummies.py <00_file> <ff_file> <size_in_mb>") sys.exit() else: zero_name = sys.argv[1] ff_name = sys.argv[2] size = int(sys.argv[3] or "6") fo_z = open(os.path.dirname(os.path.realpath(__file__)) + "/" + zero_name, "wb") fo_f = open(o...
[ "os.path.realpath", "sys.exit" ]
[((128, 138), 'sys.exit', 'sys.exit', ([], {}), '()\n', (136, 138), False, 'import sys\n'), ((254, 280), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (270, 280), False, 'import os\n'), ((335, 361), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (351, 361), Fal...
#!/usr/bin/env python3 import json from datetime import datetime, timedelta import os from functools import partial import pathlib import requests import sys import time import threading TOK_THINGSPEAK_PRIMARY_ID = "THINGSPEAK_PRIMARY_ID" TOK_THINGSPEAK_PRIMARY_ID_READ_KEY = "THINGSPEAK_PRIMARY_ID_READ_KEY" DATA_DIR ...
[ "os.path.exists", "pathlib.Path", "os.path.join", "threading.activeCount", "time.sleep", "requests.get", "datetime.datetime.now", "functools.partial", "os.unlink", "json.load", "threading.Thread", "datetime.timedelta", "json.dump" ]
[((1289, 1306), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (1301, 1306), False, 'import requests\n'), ((1311, 1332), 'time.sleep', 'time.sleep', (['GET_SLEEP'], {}), '(GET_SLEEP)\n', (1321, 1332), False, 'import time\n'), ((1688, 1702), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (1700, 17...
#!/usr/bin/python3 # -*- coding: utf-8 -*- ########################################### # (c) 2016-2020 <NAME> # <EMAIL> ########################################### """ This tool can completely purge a user from the database. Warning: This may reduce information on other users, as the given user is purged from all min...
[ "optparse.OptionParser", "datetime.datetime.utcnow" ]
[((1710, 1771), 'optparse.OptionParser', 'optparse.OptionParser', ([], {'usage': 'u"""Usage: %prog [options] <user>"""'}), "(usage=u'Usage: %prog [options] <user>')\n", (1731, 1771), False, 'import optparse\n'), ((2155, 2172), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (2170, 2172), False, 'from d...
from model.group import Group def testAddGroup(app): app.session.login( username="admin", password= "<PASSWORD>") app.group.create( Group (name="name", header="header", footer="footer")) app.session.logout()
[ "model.group.Group" ]
[((150, 202), 'model.group.Group', 'Group', ([], {'name': '"""name"""', 'header': '"""header"""', 'footer': '"""footer"""'}), "(name='name', header='header', footer='footer')\n", (155, 202), False, 'from model.group import Group\n')]
import pytest from py_scripts.singleton_calling_utils import get_good_idxs, get_singleton_idx, levenshtein, reformat_genotypes, normalize_var import numpy as np def test_reformat_genotypes(genotype_array): assert np.array_equal(reformat_genotypes(genotype_array), np.array([0, 1, 1, 2])) def test_reformat_genotyp...
[ "py_scripts.singleton_calling_utils.normalize_var", "py_scripts.singleton_calling_utils.reformat_genotypes", "py_scripts.singleton_calling_utils.levenshtein", "pytest.mark.parametrize", "numpy.array", "py_scripts.singleton_calling_utils.get_singleton_idx", "py_scripts.singleton_calling_utils.get_good_id...
[((449, 594), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""invara,invarb,outvar"""', "[('TCC', 'CCC', ('T', 'C')), ('CAGGGGG', 'CTGGGGG', ('A', 'T')), ('GAT',\n 'GAT', ('N', 'N'))]"], {}), "('invara,invarb,outvar', [('TCC', 'CCC', ('T', 'C')),\n ('CAGGGGG', 'CTGGGGG', ('A', 'T')), ('GAT', 'GAT', ('...
from tkinter import * from tkinter import ttk root = Tk() root.geometry("640x480+200+200") ttk.Label(root, text="Orange", background="orange").place( x=100, y=50, width=100, height=50 ) ttk.Label(root, text="Red", background="red").place( relx=0.5, rely=0.5, anchor="center", relwidth=0.5, relheight=0.5 ) t...
[ "tkinter.ttk.Label" ]
[((94, 145), 'tkinter.ttk.Label', 'ttk.Label', (['root'], {'text': '"""Orange"""', 'background': '"""orange"""'}), "(root, text='Orange', background='orange')\n", (103, 145), False, 'from tkinter import ttk\n'), ((194, 239), 'tkinter.ttk.Label', 'ttk.Label', (['root'], {'text': '"""Red"""', 'background': '"""red"""'}),...
# # Model base class test file. # # @author <NAME> # # (c) Digital Content Analysis Technology Ltd 2022 # from datetime import datetime, timezone from functools import partial import json from mock import patch import pytest import requests import requests_mock import uuid from tests.custom_test_case import CustomTes...
[ "fusion_platform.models.model.Model", "fusion_platform.models.data.DataSchema", "json.loads", "fusion_platform.common.utilities.value_to_string", "json.dumps", "requests_mock.Mocker", "uuid.uuid4", "fusion_platform.models.model.Model._first_and_generator", "datetime.datetime.now", "fusion_platform...
[((871, 880), 'fusion_platform.session.Session', 'Session', ([], {}), '()\n', (878, 880), False, 'from fusion_platform.session import Session, RequestError\n'), ((898, 912), 'fusion_platform.models.model.Model', 'Model', (['session'], {}), '(session)\n', (903, 912), False, 'from fusion_platform.models.model import Mode...
''' Este programa: 1. Lee los archivos de una ruta si son de Nielsen y los clasifica segun su extension. 2. Los transforma hasta convertirlos en una única tabla. 3. Exporta el resultado en un archivo .csv Se asume que el nombre de los archivo sigue esta estructura: Nielsen -...
[ "datetime.datetime.now", "pandas.read_excel", "pandas.DataFrame", "datetime.timedelta", "os.walk" ]
[((2293, 2311), 'os.walk', 'os.walk', (['file_path'], {}), '(file_path)\n', (2300, 2311), False, 'import os\n'), ((2930, 2976), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "(lista_campos + ['Value'])"}), "(columns=lista_campos + ['Value'])\n", (2942, 2976), True, 'import pandas as pd\n'), ((3092, 3125), 'panda...
# -*- coding: utf-8 -*- import hashlib import os import decimal import base64 import tempfile import json class Salt: @classmethod def get_salt(cls, size): return os.urandom(size).hex() class Hash: @classmethod def sha3_512(cls, plain): plain = plain.encode() hash = hashlib.s...
[ "json.loads", "hashlib.sha3_512", "os.urandom", "base64.b64encode", "json.dumps", "base64.b64decode", "tempfile.NamedTemporaryFile", "decimal.Decimal" ]
[((311, 334), 'hashlib.sha3_512', 'hashlib.sha3_512', (['plain'], {}), '(plain)\n', (327, 334), False, 'import hashlib\n'), ((667, 707), 'json.dumps', 'json.dumps', (['obj'], {'default': 'decimal_default'}), '(obj, default=decimal_default)\n', (677, 707), False, 'import json\n'), ((756, 777), 'base64.b64encode', 'base6...
# Generated by Django 3.1.13 on 2022-02-01 23:33 # Standard Libraries import json # Django Imports from django.db import migrations def convert_to_jsonfield(apps, schema_editor): # Convert the to-be-deleted fields to JSON for the ``JSONfield`` Domain = apps.get_model("shepherd", "Domain") for entry in D...
[ "json.loads", "json.dumps", "django.db.migrations.RunPython" ]
[((748, 770), 'json.dumps', 'json.dumps', (['categories'], {}), '(categories)\n', (758, 770), False, 'import json\n'), ((845, 865), 'json.loads', 'json.loads', (['cat_json'], {}), '(cat_json)\n', (855, 865), False, 'import json\n'), ((1033, 1075), 'django.db.migrations.RunPython', 'migrations.RunPython', (['convert_to_...
import pytest from nexus import NexusReader from nexus.tools.check_zeros import check_zeros, remove_zeros @pytest.fixture def nex(): nex = NexusReader.from_string(""" Begin data; Dimensions ntax=4 nchar=8; Format datatype=standard symbols="01" gap=-; Matrix [ ...
[ "pytest.mark.parametrize", "nexus.tools.check_zeros.remove_zeros", "nexus.NexusReader.from_string" ]
[((510, 659), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""kw,expected"""', "[({}, [0, 5, 6, 7]), ({'missing': ['-']}, [0, 5]), ({'absences': ['1', '0']\n }, [0, 1, 2, 3, 4, 5, 6, 7])]"], {}), "('kw,expected', [({}, [0, 5, 6, 7]), ({'missing': [\n '-']}, [0, 5]), ({'absences': ['1', '0']}, [0, 1, 2...
from setuptools import setup, find_packages setup( name='django-simple-metatags', version='2.0.3', description="The django application allows to add title, keywords and " "description meta tags to site's pages.", author='<NAME>', author_email='<EMAIL>', url='https://github.com/...
[ "setuptools.find_packages" ]
[((433, 448), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (446, 448), False, 'from setuptools import setup, find_packages\n')]
"""Unit tests for stupendous_cow.db.core""" from stupendous_cow.db.core import * from stupendous_cow.testing import DatabaseTestCase import datetime import os import os.path import sqlite3 import unittest class ResultSetTests(DatabaseTestCase): def test_retrieve_all_items(self): def the_test(cursor): ...
[ "unittest.main", "datetime.datetime", "datetime.datetime.utcfromtimestamp" ]
[((17005, 17020), 'unittest.main', 'unittest.main', ([], {}), '()\n', (17018, 17020), False, 'import unittest\n'), ((5177, 5219), 'datetime.datetime', 'datetime.datetime', (['(2018)', '(10)', '(1)', '(12)', '(34)', '(56)'], {}), '(2018, 10, 1, 12, 34, 56)\n', (5194, 5219), False, 'import datetime\n'), ((5562, 5604), 'd...
#!/usr/bin/python # # Copyright (C) 2013-2018 Draios Inc dba Sysdig. # # This file is part of sysdig . # # 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/L...
[ "lxml.html.fromstring", "sys.stderr.write", "sys.exit", "urllib.request.urlopen", "urllib.parse.unquote" ]
[((2939, 2996), 'sys.stderr.write', 'sys.stderr.write', (["('Usage: ' + sys.argv[0] + ' <distro>\\n')"], {}), "('Usage: ' + sys.argv[0] + ' <distro>\\n')\n", (2955, 2996), False, 'import sys\n'), ((3001, 3012), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (3009, 3012), False, 'import sys\n'), ((3289, 3310), 'lxml.ht...
#!/usr/bin/env python3 #testprog for serial writing import serial import sys import time def err(txt): print("ERROR: %s"%txt) sys.exit(1) def sendSerial(file,port,sleeptime,baudout=4800): firstTry=True fout=None f=None try: port=int(port) except: pass try: f=open(file,"rb") fout...
[ "sys.exc_info", "serial.Serial", "time.sleep", "sys.exit" ]
[((134, 145), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (142, 145), False, 'import sys\n'), ((321, 369), 'serial.Serial', 'serial.Serial', (['port'], {'timeout': '(2)', 'baudrate': 'baudout'}), '(port, timeout=2, baudrate=baudout)\n', (334, 369), False, 'import serial\n'), ((925, 936), 'sys.exit', 'sys.exit', (['...
import numpy as np import cv2 from PIL import Image face_cascade = cv2.CascadeClassifier('cascades/data/haarcascade_frontalface_default.xml') image = cv2.imread('jeantest.JPG') gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) faces = face_cascade.detectMultiScale(gray, 1.1, 5) for (x, y, w, h) in faces: print(x,y,...
[ "cv2.imwrite", "cv2.waitKey", "cv2.destroyAllWindows", "cv2.cvtColor", "cv2.CascadeClassifier", "cv2.imread" ]
[((68, 142), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['"""cascades/data/haarcascade_frontalface_default.xml"""'], {}), "('cascades/data/haarcascade_frontalface_default.xml')\n", (89, 142), False, 'import cv2\n'), ((152, 178), 'cv2.imread', 'cv2.imread', (['"""jeantest.JPG"""'], {}), "('jeantest.JPG')\n", (16...
import discord # noinspection PyBroadException class File: """Represents an OS file.""" def __init__(self, file_location, image_url): """ :param file_location: The full file location :param image_url: Image host url of the image """ self.file_location: str = file_locat...
[ "discord.File" ]
[((712, 758), 'discord.File', 'discord.File', (['self.file_location'], {'spoiler': '(True)'}), '(self.file_location, spoiler=True)\n', (724, 758), False, 'import discord\n')]
# coding=utf-8 """ Filter to remove mentions that are Non-words.""" from .basefilter import BaseFilter from corefgraph.resources.dictionaries import stopwords from corefgraph.constants import FORM, ID __author__ = "<NAME> <<EMAIL>>" class NonWordFilter(BaseFilter): """Class that filter mentions that have non w...
[ "corefgraph.resources.dictionaries.stopwords.non_words" ]
[((712, 742), 'corefgraph.resources.dictionaries.stopwords.non_words', 'stopwords.non_words', (['head_form'], {}), '(head_form)\n', (731, 742), False, 'from corefgraph.resources.dictionaries import stopwords\n')]
"""Module for testing the user model.""" import pytest from django.core.exceptions import ValidationError @pytest.mark.django_db def test_user_string_representation(user): """Test user string representation.""" assert str(user) == user.username @pytest.mark.django_db def test_regional_user_cannot_have_stt(re...
[ "pytest.raises" ]
[((429, 459), 'pytest.raises', 'pytest.raises', (['ValidationError'], {}), '(ValidationError)\n', (442, 459), False, 'import pytest\n'), ((706, 736), 'pytest.raises', 'pytest.raises', (['ValidationError'], {}), '(ValidationError)\n', (719, 736), False, 'import pytest\n')]
#!/usr/bin/env python3 """Very basic MIDI synthesizer. This does the same as midi_sine.py, but it uses NumPy and block processing. It is therefore much more efficient. But there are still many allocations and dynamically growing and shrinking data structures. """ import jack import numpy as np import threading # F...
[ "threading.Event", "numpy.zeros", "numpy.arange", "jack.Client" ]
[((482, 512), 'jack.Client', 'jack.Client', (['"""MIDI-Sine-NumPy"""'], {}), "('MIDI-Sine-NumPy')\n", (493, 512), False, 'import jack\n'), ((622, 639), 'threading.Event', 'threading.Event', ([], {}), '()\n', (637, 639), False, 'import threading\n'), ((3458, 3478), 'numpy.arange', 'np.arange', (['blocksize'], {}), '(blo...
# Copyright 2020 Silicon Compiler Authors. All Rights Reserved. import os import siliconcompiler import pytest @pytest.mark.eda @pytest.mark.quick def test_ghdl(datadir): design = "adder" design_src = os.path.join(datadir, f'{design}.vhdl') chip = siliconcompiler.Chip(loglevel="INFO") chip.load_target...
[ "os.path.join", "siliconcompiler.Chip", "tests.fixtures.datadir" ]
[((210, 249), 'os.path.join', 'os.path.join', (['datadir', 'f"""{design}.vhdl"""'], {}), "(datadir, f'{design}.vhdl')\n", (222, 249), False, 'import os\n'), ((262, 299), 'siliconcompiler.Chip', 'siliconcompiler.Chip', ([], {'loglevel': '"""INFO"""'}), "(loglevel='INFO')\n", (282, 299), False, 'import siliconcompiler\n'...
""" .. codeauthor:: <NAME> <<EMAIL>> """ import numpy as np import pytest from .. import CylindricalGrid from ..boundaries.local import NeumannBC def test_cylindrical_grid(): """ test simple cylindrical grid """ for periodic in [True, False]: grid = CylindricalGrid(4, (-1, 2), (8, 9), periodic_z=per...
[ "pytest.approx", "numpy.sqrt", "numpy.testing.assert_allclose", "numpy.any", "pytest.mark.parametrize", "numpy.random.randint", "numpy.testing.assert_almost_equal", "pytest.raises", "numpy.array", "numpy.linspace", "numpy.all" ]
[((2947, 2997), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""periodic"""', '[True, False]'], {}), "('periodic', [True, False])\n", (2970, 2997), False, 'import pytest\n'), ((2058, 2124), 'numpy.testing.assert_allclose', 'np.testing.assert_allclose', (['pf_cart1.data', 'pf_cart2.data'], {'atol': '(0.1)'})...
#!/usr/bin/env python3 # Copyright 2004-present Facebook. All Rights Reserved. """ Simple 2 input mixer node. This takes two inputs of potentially different sizes, weights them and then sums them to form an output. """ import asyncio import queue import labgraph as lg import numpy as np from ...messages.generic_s...
[ "asyncio.Event", "numpy.dot", "labgraph.publisher", "asyncio.sleep", "queue.Queue", "labgraph.Topic", "labgraph.subscriber" ]
[((630, 659), 'labgraph.Topic', 'lg.Topic', (['SignalSampleMessage'], {}), '(SignalSampleMessage)\n', (638, 659), True, 'import labgraph as lg\n'), ((688, 717), 'labgraph.Topic', 'lg.Topic', (['SignalSampleMessage'], {}), '(SignalSampleMessage)\n', (696, 717), True, 'import labgraph as lg\n'), ((741, 770), 'labgraph.To...
from http.server import HTTPServer, BaseHTTPRequestHandler import os import socket import logging import json class httpHandler(BaseHTTPRequestHandler): def do_GET(self): if self.path == '/a': self.wfile.write('Helloa! '.encode()) elif self.path == '/statsd': send_statsd_met...
[ "socket.socket", "os.getenv", "json.dumps", "logging.warning", "http.server.HTTPServer" ]
[((738, 762), 'os.getenv', 'os.getenv', (['"""INSTANCE_ID"""'], {}), "('INSTANCE_ID')\n", (747, 762), False, 'import os\n'), ((786, 820), 'os.getenv', 'os.getenv', (['"""COLLECTOR_UDP_ADDRESS"""'], {}), "('COLLECTOR_UDP_ADDRESS')\n", (795, 820), False, 'import os\n'), ((825, 853), 'logging.warning', 'logging.warning', ...
# coding: utf-8 # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # --------------------------------------------------------------------...
[ "azure.storage.blob.BlobServiceClient.from_connection_string", "azure.storage.blob.RetentionPolicy", "os.getenv" ]
[((978, 1022), 'os.getenv', 'os.getenv', (['"""AZURE_STORAGE_CONNECTION_STRING"""'], {}), "('AZURE_STORAGE_CONNECTION_STRING')\n", (987, 1022), False, 'import os\n'), ((1302, 1366), 'azure.storage.blob.BlobServiceClient.from_connection_string', 'BlobServiceClient.from_connection_string', (['self.connection_string'], {}...
from neomodel import StructuredNode, StringProperty, ArrayProperty, Relationship, config, StructuredRel, JSONProperty, \ UniqueIdProperty class BaseNode(StructuredNode): model_metadata = JSONProperty() class BaseRelation(StructuredRel): model_metadata = JSONProperty() class GeneralizationRel(BaseRelat...
[ "neomodel.StringProperty", "neomodel.ArrayProperty", "neomodel.Relationship", "neomodel.UniqueIdProperty", "neomodel.JSONProperty" ]
[((197, 211), 'neomodel.JSONProperty', 'JSONProperty', ([], {}), '()\n', (209, 211), False, 'from neomodel import StructuredNode, StringProperty, ArrayProperty, Relationship, config, StructuredRel, JSONProperty, UniqueIdProperty\n'), ((270, 284), 'neomodel.JSONProperty', 'JSONProperty', ([], {}), '()\n', (282, 284), Fa...
# -*- coding: utf-8 -*- """ @author: david """ import os.path import pandas as pd class DataCleaner: Minuscules = [chr(c) for c in range(ord('a'), ord('z') + 1)] Majuscules = [chr(c) for c in range(ord('A'), ord('Z') + 1)] Xifres = [str(i) for i in range(10)] Especials = ['.', ';', '-', '_', '+', '*',...
[ "pandas.read_csv" ]
[((1669, 1725), 'pandas.read_csv', 'pd.read_csv', (['data'], {'on_bad_lines': '"""skip"""', 'encoding': '"""utf-8"""'}), "(data, on_bad_lines='skip', encoding='utf-8')\n", (1680, 1725), True, 'import pandas as pd\n'), ((2062, 2118), 'pandas.read_csv', 'pd.read_csv', (['data'], {'on_bad_lines': '"""skip"""', 'encoding':...
from statistics import mode from typing import Tuple, List, Optional from ._fixer_tool import FixerToolInterface from ._languages import Languages from ._sentence_pair import SentencePair from .fixer_configurator import FixerConfigurator from .fixer_statistics import FixerStatisticsMarks as StatisticsMarks class Nam...
[ "statistics.mode" ]
[((4986, 5018), 'statistics.mode', 'mode', (['possible_target_names_idxs'], {}), '(possible_target_names_idxs)\n', (4990, 5018), False, 'from statistics import mode\n')]
import unittest from xmot.dataset import Dataset import os class TestDataset(unittest.TestCase): def test_read_frame_mp4(self): fnam = os.path.join(os.getcwd(), "data/test.mp4") dset = Dataset(video_name=fnam) img = dset.get_img(0) self.assertIsNotNone(img) def t...
[ "xmot.dataset.Dataset", "os.getcwd" ]
[((217, 241), 'xmot.dataset.Dataset', 'Dataset', ([], {'video_name': 'fnam'}), '(video_name=fnam)\n', (224, 241), False, 'from xmot.dataset import Dataset\n'), ((437, 461), 'xmot.dataset.Dataset', 'Dataset', ([], {'video_name': 'fnam'}), '(video_name=fnam)\n', (444, 461), False, 'from xmot.dataset import Dataset\n'), (...
import json import boto3 import secrets import string import time import uuid from botocore.vendored import requests dynamodb = boto3.resource('dynamodb') host = 'https://search-bands-rrdxgwmdnc4xz6ea7mouqyca5u.us-east-1.es.amazonaws.com' index = 'bands' type = '_doc' url = host + '/' + index + '/' + type headers = { ...
[ "uuid.uuid1", "boto3.resource", "json.dumps", "botocore.vendored.requests.post" ]
[((129, 155), 'boto3.resource', 'boto3.resource', (['"""dynamodb"""'], {}), "('dynamodb')\n", (143, 155), False, 'import boto3\n'), ((1094, 1106), 'uuid.uuid1', 'uuid.uuid1', ([], {}), '()\n', (1104, 1106), False, 'import uuid\n'), ((1963, 1992), 'json.dumps', 'json.dumps', (['message'], {'indent': '(2)'}), '(message, ...
import numpy as np import csv import os import util # Reproducible random numbers np.random.seed(0) # Prefix path = 'results/hw2/' if not os.path.exists(path): os.mkdir(path) reportLines = [] # 100 x 100 children res = util.measurement(path, taskId = 'hw2_1', childrenPerLevel = (100, 100), initSecPrice = ...
[ "os.path.exists", "util.measurement", "csv.writer", "os.mkdir", "numpy.random.seed" ]
[((85, 102), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (99, 102), True, 'import numpy as np\n'), ((233, 372), 'util.measurement', 'util.measurement', (['path'], {'taskId': '"""hw2_1"""', 'childrenPerLevel': '(100, 100)', 'initSecPrice': '[1, 100, 100, 100]', 'logNormalMean': '(2)', 'logNormalSigma'...
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F class FaceMeshBlock(nn.Module): """This is the main building block for architecture which is just residual block with one dw-conv and max-pool/channel pad in the second branch if input channels doesn't match output chann...
[ "torch.nn.ReflectionPad2d", "torch.load", "torch.from_numpy", "torch.nn.Conv2d", "torch.nn.PReLU", "torch.nn.MaxPool2d", "torch.nn.functional.pad", "torch.no_grad" ]
[((1211, 1233), 'torch.nn.PReLU', 'nn.PReLU', (['out_channels'], {}), '(out_channels)\n', (1219, 1233), True, 'import torch.nn as nn\n'), ((610, 657), 'torch.nn.MaxPool2d', 'nn.MaxPool2d', ([], {'kernel_size': 'stride', 'stride': 'stride'}), '(kernel_size=stride, stride=stride)\n', (622, 657), True, 'import torch.nn as...
from django.db import models from django.template import Template, Context from django.contrib.auth.models import User class Box(models.Model): label = models.CharField(max_length=100, db_index=True) user = models.ForeignKey(User, null=True, blank=True) content = models.TextField() class Me...
[ "django.db.models.TextField", "django.db.models.ForeignKey", "django.template.Template", "django.template.Context", "django.db.models.CharField" ]
[((164, 211), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)', 'db_index': '(True)'}), '(max_length=100, db_index=True)\n', (180, 211), False, 'from django.db import models\n'), ((223, 269), 'django.db.models.ForeignKey', 'models.ForeignKey', (['User'], {'null': '(True)', 'blank': '(True)'...
import os import zipfile from datetime import datetime class _UtilityOutput: utility = None dir_index = 0 parent_output_dir = None _feedname = None def initialize_utility(self, utility): # utiltiy is one of: # average_headways # one_day # etc. self.ut...
[ "os.path.exists", "zipfile.ZipFile", "os.path.join", "datetime.datetime.now", "os.rmdir", "os.mkdir", "os.path.basename", "os.walk", "os.remove" ]
[((2064, 2087), 'os.path.exists', 'os.path.exists', (['csvfile'], {}), '(csvfile)\n', (2078, 2087), False, 'import os\n'), ((1260, 1283), 'os.path.exists', 'os.path.exists', (['out_dir'], {}), '(out_dir)\n', (1274, 1283), False, 'import os\n'), ((1298, 1315), 'os.mkdir', 'os.mkdir', (['out_dir'], {}), '(out_dir)\n', (1...
from __future__ import division import numpy as np from sklearn.base import BaseEstimator, TransformerMixin from sklearn.preprocessing import Imputer, MinMaxScaler, StandardScaler, OneHotEncoder from sklearn.feature_selection import VarianceThreshold import pandas as pd from clumpy.unique_threshold import UniqueThre...
[ "numpy.intersect1d", "sklearn.feature_selection.VarianceThreshold", "numpy.unique", "clumpy.datasets.utils.categorical_columns", "numpy.searchsorted", "sklearn.preprocessing.Imputer", "numpy.putmask", "sklearn.preprocessing.StandardScaler", "numpy.sum", "numpy.argsort", "clumpy.datasets.utils.or...
[((613, 625), 'numpy.unique', 'np.unique', (['y'], {}), '(y)\n', (622, 625), True, 'import numpy as np\n'), ((892, 904), 'numpy.unique', 'np.unique', (['y'], {}), '(y)\n', (901, 904), True, 'import numpy as np\n'), ((3158, 3206), 'sklearn.preprocessing.Imputer', 'Imputer', ([], {'strategy': 'strategy', 'missing_values'...
#!/usr/bin/python # -*- coding:utf-8 -*- # @author : east # @time : 2021/7/13 10:34 # @file : interval.py # @project : fepy # software : PyCharm import numpy as np # Functions # --------- def area(*points): [pl, pr] = np.asarray(points) if (pl.ndim > 1) or (pr.ndim > 1): raise ValueError('Inp...
[ "numpy.asarray" ]
[((233, 251), 'numpy.asarray', 'np.asarray', (['points'], {}), '(points)\n', (243, 251), True, 'import numpy as np\n')]
from rest_framework.routers import SimpleRouter from v1.comments.views import CommentViewSet router = SimpleRouter(trailing_slash=False) router.register('comments', CommentViewSet)
[ "rest_framework.routers.SimpleRouter" ]
[((104, 138), 'rest_framework.routers.SimpleRouter', 'SimpleRouter', ([], {'trailing_slash': '(False)'}), '(trailing_slash=False)\n', (116, 138), False, 'from rest_framework.routers import SimpleRouter\n')]
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
[ "google.gax.path_template.PathTemplate" ]
[((2170, 2197), 'google.gax.path_template.PathTemplate', 'PathTemplate', (['"""hello/world"""'], {}), "('hello/world')\n", (2182, 2197), False, 'from google.gax.path_template import PathTemplate, ValidationException\n'), ((2315, 2342), 'google.gax.path_template.PathTemplate', 'PathTemplate', (['"""hello/world"""'], {})...
from validator.rules import RequiredIf def test_required_if_01(): rule = RequiredIf("a") value_to_check = "abc" assert rule.check(value_to_check) rule = RequiredIf("a") value_to_check = ["a", "b", "c"] assert rule.check(value_to_check) def test_required_if_02(): rule = RequiredIf("a") ...
[ "validator.rules.RequiredIf" ]
[((79, 94), 'validator.rules.RequiredIf', 'RequiredIf', (['"""a"""'], {}), "('a')\n", (89, 94), False, 'from validator.rules import RequiredIf\n'), ((172, 187), 'validator.rules.RequiredIf', 'RequiredIf', (['"""a"""'], {}), "('a')\n", (182, 187), False, 'from validator.rules import RequiredIf\n'), ((303, 318), 'validat...
from datalayer import DataLayer from collections import Counter, defaultdict from asynclayer import AsyncLayer from itertools import chain, count, permutations from operator import attrgetter, methodcaller from random import choice, sample, shuffle from bisect import bisect_right from copy import copy from six import i...
[ "operator.attrgetter", "random.choice", "random.shuffle", "logging.debug", "bisect.bisect_right", "itertools.count", "collections.defaultdict", "itertools.permutations" ]
[((471, 483), 'random.shuffle', 'shuffle', (['shf'], {}), '(shf)\n', (478, 483), False, 'from random import choice, sample, shuffle\n'), ((568, 585), 'itertools.permutations', 'permutations', (['shf'], {}), '(shf)\n', (580, 585), False, 'from itertools import chain, count, permutations\n'), ((1642, 1659), 'collections....
import os import json import argparse from tensorflow.keras.utils import get_file from sklearn.metrics.pairwise import cosine_similarity as measure from paz.backend.camera import VideoPlayer, Camera from scenes import DictionaryView from model import AutoEncoder from pipelines import ImplicitRotationPredictor pars...
[ "argparse.ArgumentParser", "os.path.join", "pipelines.ImplicitRotationPredictor", "tensorflow.keras.utils.get_file", "model.AutoEncoder", "paz.backend.camera.Camera", "os.path.expanduser" ]
[((325, 389), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Implicit orientation demo"""'}), "(description='Implicit orientation demo')\n", (348, 389), False, 'import argparse\n'), ((2188, 2234), 'os.path.join', 'os.path.join', (['args.model_path', 'args.model_name'], {}), '(args.model_...
from datetime import datetime from updatesproducer.iupdates_provider import IUpdatesProvider from updatesproducer.updateapi.update import Update class MockUpdatesProvider(IUpdatesProvider): def get_updates(self, user_id: str): return [ Update( content='Mock updateapi', ...
[ "datetime.datetime.now" ]
[((384, 398), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (396, 398), False, 'from datetime import datetime\n')]
import sqlite3 # Establish connection conn = sqlite3.connect('demo_data.sqlite3') cur = conn.cursor() # Create table create_table_statement = """ CREATE TABLE demo (s CHAR(1) PRIMARY KEY NOT NULL, x INT, y INT);""" cur.execute(create_table_statement) # Insert data into table cur.execute("""INSERT INTO demo (s, x, y) VA...
[ "sqlite3.connect" ]
[((45, 81), 'sqlite3.connect', 'sqlite3.connect', (['"""demo_data.sqlite3"""'], {}), "('demo_data.sqlite3')\n", (60, 81), False, 'import sqlite3\n')]
import sys import os UTILS_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'utils') sys.path.insert(1, UTILS_DIR) from training import train, test if __name__ == '__main__': BREAK_EARLY = False BATCH_SIZE = 500 print("For this one, I just want to try out a different KL or two. Becau...
[ "training.train", "os.path.dirname", "sys.path.insert", "training.test" ]
[((105, 134), 'sys.path.insert', 'sys.path.insert', (['(1)', 'UTILS_DIR'], {}), '(1, UTILS_DIR)\n', (120, 134), False, 'import sys\n'), ((62, 87), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (77, 87), False, 'import os\n'), ((501, 923), 'training.train', 'train', ([], {'model_class': '"""m...
__doc__ = """Image chunk class""" import numpy as np from chunkflow.chunk import Chunk class AffinityMap(Chunk): """ a chunk of affinity map. It has x,y,z three channels with single precision. """ def __init__(self, array, voxel_offset=None): assert array.ndim == 4 assert np.issubdtyp...
[ "numpy.issubdtype", "chunkflow.chunk.Chunk" ]
[((308, 346), 'numpy.issubdtype', 'np.issubdtype', (['array.dtype', 'np.float32'], {}), '(array.dtype, np.float32)\n', (321, 346), True, 'import numpy as np\n'), ((654, 726), 'chunkflow.chunk.Chunk', 'Chunk', (['image'], {'voxel_offset': 'self.voxel_offset', 'voxel_size': 'self.voxel_size'}), '(image, voxel_offset=self...
#!/usr/bin/env python import numpy as np import rospy from geometry_msgs.msg import PoseStamped from styx_msgs.msg import Lane, Waypoint, TrafficLightArray from std_msgs.msg import Int32 from scipy.spatial import KDTree import yaml import math ''' This node will publish waypoints from the car's current position to so...
[ "rospy.logerr", "rospy.Subscriber", "rospy.is_shutdown", "rospy.init_node", "rospy.get_param", "scipy.spatial.KDTree", "math.sqrt", "numpy.array", "numpy.dot", "rospy.Rate", "styx_msgs.msg.Waypoint", "rospy.Publisher", "rospy.loginfo", "styx_msgs.msg.Lane" ]
[((1036, 1071), 'rospy.init_node', 'rospy.init_node', (['"""waypoint_updater"""'], {}), "('waypoint_updater')\n", (1051, 1071), False, 'import rospy\n'), ((1099, 1159), 'rospy.Subscriber', 'rospy.Subscriber', (['"""/current_pose"""', 'PoseStamped', 'self.pose_cb'], {}), "('/current_pose', PoseStamped, self.pose_cb)\n",...
#!/usr/bin/PMFTools from __future__ import with_statement import HAConf, GenerateCGSystem import os gromacs = HAConf.configuration['gromacs_location'] def UmbrellaGenerate(name="umbrella",window=None): #Need to generate 2 files; an index file with a group representing lipids and backbone, and a ppa file lipid_mixtu...
[ "os.system" ]
[((544, 571), 'os.system', 'os.system', (['make_ndx_command'], {}), '(make_ndx_command)\n', (553, 571), False, 'import os\n')]
# -*- coding: utf-8 -*- import logging import ResMgr import nations import SoundGroups from gui.Scaleform.framework.entities.View import View from gui.game_control.epic_meta_game_ctrl import _FrontLineSounds from modsettings import MOD_NAME _logger = logging.getLogger(MOD_NAME) _logger.setLevel(logging.DEBUG) cl...
[ "logging.getLogger", "SoundGroups.g_instance.soundModes.modes.keys", "gui.game_control.epic_meta_game_ctrl._FrontLineSounds.onChange", "ResMgr.openSection" ]
[((256, 283), 'logging.getLogger', 'logging.getLogger', (['MOD_NAME'], {}), '(MOD_NAME)\n', (273, 283), False, 'import logging\n'), ((916, 959), 'ResMgr.openSection', 'ResMgr.openSection', (['self.__CFG_SECTION_PATH'], {}), '(self.__CFG_SECTION_PATH)\n', (934, 959), False, 'import ResMgr\n'), ((1982, 2020), 'gui.game_c...
from django.conf.urls import url from .views import tracker_serve, track, attach_contact, send_event, attach_data urlpatterns = [ url(r'shiva.js$', tracker_serve), url(r'track$', track), url(r'attach$', attach_contact), url(r'data$', attach_data), url(r'event$', send_event), ]
[ "django.conf.urls.url" ]
[((136, 167), 'django.conf.urls.url', 'url', (['"""shiva.js$"""', 'tracker_serve'], {}), "('shiva.js$', tracker_serve)\n", (139, 167), False, 'from django.conf.urls import url\n'), ((174, 194), 'django.conf.urls.url', 'url', (['"""track$"""', 'track'], {}), "('track$', track)\n", (177, 194), False, 'from django.conf.ur...
import re def sort_urls(url_list,reverse=True): return sorted(url_list, key=lambda k: k['bandwidth'], reverse=reverse) def name_checker(name): name = name.replace("'", "") name = re.findall(r"([\w\d-]+)", name) return ' '.join([x for x in name])
[ "re.findall" ]
[((204, 236), 're.findall', 're.findall', (['"""([\\\\w\\\\d-]+)"""', 'name'], {}), "('([\\\\w\\\\d-]+)', name)\n", (214, 236), False, 'import re\n')]
# -*- coding: utf-8 -*- from icalendar.compat import iteritems from icalendar.parser_tools import to_unicode try: from collections import OrderedDict except ImportError: from ordereddict import OrderedDict def canonsort_keys(keys, canonical_order=None): """Sorts leading keys according to canonical_order....
[ "icalendar.compat.iteritems", "icalendar.parser_tools.to_unicode" ]
[((1471, 1486), 'icalendar.parser_tools.to_unicode', 'to_unicode', (['key'], {}), '(key)\n', (1481, 1486), False, 'from icalendar.parser_tools import to_unicode\n'), ((1607, 1622), 'icalendar.parser_tools.to_unicode', 'to_unicode', (['key'], {}), '(key)\n', (1617, 1622), False, 'from icalendar.parser_tools import to_un...
bl_info = { "name": "Exec nvim", "category": "3D View", "author": "asshole", "version": (0, 4, 8), "blender": (2, 80, 0), } import bpy # from neovim import attach class ExecNvim(bpy.types.Operator): """Object Cursor Array""" bl_idname = "object.cursor_array" bl_label = "Exec Nvim" ...
[ "bpy.props.IntProperty", "bpy.utils.unregister_class", "bpy.types.VIEW3D_MT_object.append", "bpy.types.VIEW3D_MT_object.remove", "bpy.utils.register_class" ]
[((369, 431), 'bpy.props.IntProperty', 'bpy.props.IntProperty', ([], {'name': '"""Steps"""', 'default': '(2)', 'min': '(1)', 'max': '(100)'}), "(name='Steps', default=2, min=1, max=100)\n", (390, 431), False, 'import bpy\n'), ((1154, 1188), 'bpy.utils.register_class', 'bpy.utils.register_class', (['ExecNvim'], {}), '(E...
#!/usr/bin/env python3 # Copyright 2021 BHG [bw.org] # db-query.py as of 2021-04-07 bw import sqlite3 def main(): db = sqlite3.connect("../db/scratch.db") cur = db.cursor() cur.execute("DROP TABLE IF EXISTS temp") cur.execute("CREATE TABLE IF NOT EXISTS temp ( a TEXT, b TEXT, c TEXT )") cur.exec...
[ "sqlite3.connect" ]
[((126, 161), 'sqlite3.connect', 'sqlite3.connect', (['"""../db/scratch.db"""'], {}), "('../db/scratch.db')\n", (141, 161), False, 'import sqlite3\n')]
import torch from torch import Tensor from typing import List, Tuple from numpy import ndarray import numpy as np from .config import SentenceTransformerConfig from .models import TransformerModel from tqdm import tqdm class SentenceEncoder: """ Wrapper for the encoding and embedding of sentences with Sentenc...
[ "torch.stack", "tqdm.tqdm", "numpy.argsort", "torch.tensor", "torch.cuda.is_available", "torch.no_grad" ]
[((3422, 3451), 'numpy.argsort', 'np.argsort', (['length_sorted_idx'], {}), '(length_sorted_idx)\n', (3432, 3451), True, 'import numpy as np\n'), ((4887, 4906), 'torch.stack', 'torch.stack', (['labels'], {}), '(labels)\n', (4898, 4906), False, 'import torch\n'), ((1770, 1800), 'tqdm.tqdm', 'tqdm', (['iterator'], {'desc...