code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import logging
from typing import Callable
from typing import List
import numpy as np
import torch.utils.data
from .video_dataset import VideoDataset
from .video_dataset import VideoRecord
LOG = logging.getLogger(__name__)
# line_profiler injects a "profile" into __builtins__. When not running under
# line_profile... | [
"logging.getLogger",
"numpy.zeros",
"numpy.random.randint"
] | [((199, 226), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (216, 226), False, 'import logging\n'), ((3419, 3449), 'numpy.zeros', 'np.zeros', (['(self.num_segments,)'], {}), '((self.num_segments,))\n', (3427, 3449), True, 'import numpy as np\n'), ((2618, 2677), 'numpy.random.randint', 'n... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (t... | [
"allura.lib.helpers.monkeypatch",
"webob.Request",
"mock.patch.dict",
"pylons.request.path.endswith",
"allura.lib.helpers.push_config",
"simplejson.encoder.ESCAPE.pattern.rstrip",
"webob.exc.HTTPMovedPermanently"
] | [((1232, 1271), 'allura.lib.helpers.monkeypatch', 'h.monkeypatch', (['tg.decorators.Decoration'], {}), '(tg.decorators.Decoration)\n', (1245, 1271), True, 'from allura.lib import helpers as h\n'), ((1659, 1691), 'allura.lib.helpers.monkeypatch', 'h.monkeypatch', (['tg', 'tg.decorators'], {}), '(tg, tg.decorators)\n', (... |
#!/usr/bin/python3
import cartinit
from kivy.app import App
from kivy.uix.screenmanager import Screen, ScreenManager, SlideTransition
from kivy.lang import Builder
from buttons import RoundedButton
cartinit.init()
# create ScreenManager as root, put all screens into
sm = ScreenManager()
sm.transition = SlideTransiti... | [
"kivy.uix.screenmanager.ScreenManager",
"kivy.lang.Builder.load_file",
"cartinit.init",
"kivy.uix.screenmanager.SlideTransition"
] | [((200, 215), 'cartinit.init', 'cartinit.init', ([], {}), '()\n', (213, 215), False, 'import cartinit\n'), ((275, 290), 'kivy.uix.screenmanager.ScreenManager', 'ScreenManager', ([], {}), '()\n', (288, 290), False, 'from kivy.uix.screenmanager import Screen, ScreenManager, SlideTransition\n'), ((307, 324), 'kivy.uix.scr... |
# The MIT License (MIT)
#
# Copyright © 2021 <NAME>, <NAME>, <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
# rights to use, copy... | [
"matplotlib.pyplot.grid",
"numpy.linalg.pinv",
"sklearn.linear_model.Lasso",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.fill_between",
"numpy.arange",
"numpy.mean",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.exp",
"numpy.linspace",
"numpy.matmul",
"pandas.DataFrame",
... | [((1979, 2005), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(8, 7)'}), '(figsize=(8, 7))\n', (1989, 2005), True, 'import matplotlib.pyplot as plt\n'), ((2500, 2516), 'matplotlib.pyplot.title', 'plt.title', (['title'], {}), '(title)\n', (2509, 2516), True, 'import matplotlib.pyplot as plt\n'), ((2521, 25... |
""" Runs tests for Ptyhon Odin SDK """
import unittest
from os import environ
import random
from pymongo import MongoClient
import pyodin as odin
class OdinSdkTest(unittest.TestCase):
""" Establish OdinSdkTest object """
def setUp(self):
client = MongoClient(environ.get('ODIN_MONGODB'))
mongo... | [
"unittest.main",
"pyodin.Odin",
"os.environ.get",
"random.randint"
] | [((2522, 2537), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2535, 2537), False, 'import unittest\n'), ((597, 627), 'random.randint', 'random.randint', (['(100000)', '(999999)'], {}), '(100000, 999999)\n', (611, 627), False, 'import random\n'), ((699, 748), 'pyodin.Odin', 'odin.Odin', ([], {'config': '"""job.ym... |
from artemis.general.dict_ops import cross_dict_dicts, merge_dicts
__author__ = 'peter'
def test_cross_dict_dicts():
assert cross_dict_dicts({'a':{'aa': 1}, 'b':{'bb': 2}}, {'c': {'cc': 3}, 'd': {'dd': 4}}) == {
('a','c'):{'aa':1, 'cc':3},
('a','d'):{'aa':1, 'dd':4},
('b','c'):{'bb':2, 'c... | [
"artemis.general.dict_ops.cross_dict_dicts",
"artemis.general.dict_ops.merge_dicts"
] | [((131, 220), 'artemis.general.dict_ops.cross_dict_dicts', 'cross_dict_dicts', (["{'a': {'aa': 1}, 'b': {'bb': 2}}", "{'c': {'cc': 3}, 'd': {'dd': 4}}"], {}), "({'a': {'aa': 1}, 'b': {'bb': 2}}, {'c': {'cc': 3}, 'd': {\n 'dd': 4}})\n", (147, 220), False, 'from artemis.general.dict_ops import cross_dict_dicts, merge_... |
import numpy as np
import pandas as pd
import os.path as path
import abydos.distance as abd
import abydos.phonetic as abp
import pytest
from scipy.sparse import csc_matrix
from sklearn.feature_extraction.text import TfidfVectorizer
import name_matching.name_matcher as nm
@pytest.fixture
def name_match():
package... | [
"abydos.distance.Overlap",
"abydos.phonetic.RefinedSoundex",
"numpy.array",
"abydos.distance.Levenshtein",
"abydos.distance.KuhnsIII",
"abydos.distance.BaulieuXIII",
"name_matching.name_matcher.NameMatcher",
"pandas.testing.assert_frame_equal",
"abydos.distance.WeightedJaccard",
"abydos.phonetic.D... | [((1163, 1221), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""method"""', "['', None, 'no_method']"], {}), "('method', ['', None, 'no_method'])\n", (1186, 1221), False, 'import pytest\n'), ((3589, 3929), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""kwargs_str, result_1, result_2, result_3, ... |
import numpy as np
import math
import ROOT
import sys
class DistrReader:
def __init__(self, dataset):
self.stat_error = 0
self.sys_error = 0
self.plambda = 0
self.dataset = str(dataset)
self.hist = ROOT.TH1D('','', 100, -0.2, 0.2)
self.distr = ROOT.TH1D('','', 64, 0,... | [
"numpy.sqrt",
"ROOT.TH1D",
"numpy.power",
"ROOT.TMath.Log",
"ROOT.TFile"
] | [((243, 276), 'ROOT.TH1D', 'ROOT.TH1D', (['""""""', '""""""', '(100)', '(-0.2)', '(0.2)'], {}), "('', '', 100, -0.2, 0.2)\n", (252, 276), False, 'import ROOT\n'), ((297, 325), 'ROOT.TH1D', 'ROOT.TH1D', (['""""""', '""""""', '(64)', '(0)', '(64)'], {}), "('', '', 64, 0, 64)\n", (306, 325), False, 'import ROOT\n'), ((814... |
"""
Bad Apps Blog
Author: <NAME> (a.k.a. 7UR7L3)
(Initial commit is based on the official Flask tutorial)
About: This app began as an (essentially) exact copy
of the official Flask tutorial (linke below). It is
intented as an opportunity to practice application
security, secure design, and secure coding techniques.... | [
"logging.basicConfig",
"secrets.token_hex",
"os.makedirs",
"flask.Flask",
"os.path.join"
] | [((703, 821), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(asctime)s %(levelname)s %(name)s %(threadName)s : %(message)s"""'}), "(level=logging.INFO, format=\n '%(asctime)s %(levelname)s %(name)s %(threadName)s : %(message)s')\n", (722, 821), False, 'import logging\n')... |
from django.conf.urls import patterns, url
from status import views
urlpatterns = patterns('',
url(r'^ups$', views.ups_status, name='ups_status'),
url(r'^tor$', views.tor_status, name='tor_status'),
)
| [
"django.conf.urls.url"
] | [((97, 146), 'django.conf.urls.url', 'url', (['"""^ups$"""', 'views.ups_status'], {'name': '"""ups_status"""'}), "('^ups$', views.ups_status, name='ups_status')\n", (100, 146), False, 'from django.conf.urls import patterns, url\n'), ((150, 199), 'django.conf.urls.url', 'url', (['"""^tor$"""', 'views.tor_status'], {'nam... |
import os
import json
from common import update_json_file, get_logger, exec_cmd
from yamlparser import Parser
from pathlib import Path
logger = get_logger("update-image")
# Functions that work to update gluu_versions.json
def determine_final_official_and_dev_version(tag_list):
"""
Determine official version... | [
"json.loads",
"pathlib.Path",
"os.environ.get",
"yamlparser.Parser",
"common.update_json_file",
"common.get_logger"
] | [((145, 171), 'common.get_logger', 'get_logger', (['"""update-image"""'], {}), "('update-image')\n", (155, 171), False, 'from common import update_json_file, get_logger, exec_cmd\n'), ((5283, 5313), 'yamlparser.Parser', 'Parser', (['gluu_values_file', '(True)'], {}), '(gluu_values_file, True)\n', (5289, 5313), False, '... |
from bs4 import BeautifulSoup as soup
from urllib.request import Request, urlopen
from datetime import date
import math
import openpyxl
import pandas as pd
fname = 'https://www.governing.com/gov-data/census/state-minority-population-data-estimates.html'
req = Request(fname, headers={'User-Agent': 'Mozilla/5.0'})
webpa... | [
"bs4.BeautifulSoup",
"urllib.request.Request",
"urllib.request.urlopen",
"pandas.read_excel"
] | [((261, 314), 'urllib.request.Request', 'Request', (['fname'], {'headers': "{'User-Agent': 'Mozilla/5.0'}"}), "(fname, headers={'User-Agent': 'Mozilla/5.0'})\n", (268, 314), False, 'from urllib.request import Request, urlopen\n'), ((325, 337), 'urllib.request.urlopen', 'urlopen', (['req'], {}), '(req)\n', (332, 337), F... |
from django.core.exceptions import FieldError
from staff.models import Staff
import re
def get_choices():
# choices in a seperated funtion to change it easier
STATUS_CHOICES = (
('', ''),
('Test', 'Test'),
('Fertig', 'Fertig'),
('Löschen', 'Löschen'),
('Vertrieb', 'Vert... | [
"re.sub",
"re.findall",
"staff.models.Staff.objects.all"
] | [((476, 495), 'staff.models.Staff.objects.all', 'Staff.objects.all', ([], {}), '()\n', (493, 495), False, 'from staff.models import Staff\n'), ((621, 640), 'staff.models.Staff.objects.all', 'Staff.objects.all', ([], {}), '()\n', (638, 640), False, 'from staff.models import Staff\n'), ((6602, 6635), 're.findall', 're.fi... |
from threading import Thread
from flask import current_app,render_template
from flask_mail import Message
from . import mail
def send_async_email(app,msg):
with app.app_context():
mail.send(msg)
def send_email(to,subject,template,**kwargs):
app=current_app._get_current_object()
msg=Message(app.con... | [
"flask.render_template",
"flask_mail.Message",
"flask.current_app._get_current_object",
"threading.Thread"
] | [((263, 296), 'flask.current_app._get_current_object', 'current_app._get_current_object', ([], {}), '()\n', (294, 296), False, 'from flask import current_app, render_template\n'), ((305, 433), 'flask_mail.Message', 'Message', (["(app.config['FLASKY_MAIL_SUBJECT_PREFIX'] + ' ' + subject)"], {'sender': "app.config['FLASK... |
import pickle
from copy import deepcopy
from graphviz import Digraph
from torch.nn import Conv2d, MaxPool2d, ELU, Dropout, BatchNorm2d
import pandas as pd
from EEGNAS.model_generation.abstract_layers import IdentityLayer, ConvLayer, PoolingLayer, ActivationLayer
from EEGNAS.model_generation.custom_modules import Ident... | [
"graphviz.Digraph",
"pandas.Series",
"pandas.DataFrame",
"copy.deepcopy"
] | [((1689, 1704), 'copy.deepcopy', 'deepcopy', (['nodes'], {}), '(nodes)\n', (1697, 1704), False, 'from copy import deepcopy\n'), ((2947, 3043), 'graphviz.Digraph', 'Digraph', (['"""EEGNAS model"""'], {'filename': '"""EEGNAS_model.gv"""', 'graph_attr': "{'dpi': '300'}", 'format': '"""png"""'}), "('EEGNAS model', filename... |
from requests.auth import AuthBase
import hmac
import base64
import hashlib
import urlparse
import urllib
#add your custom auth handler class to this module
class MyEncryptedCredentialsAuthHAndler(AuthBase):
def __init__(self,**args):
# setup any auth-related data here
#self.username = args['usern... | [
"urlparse.parse_qs",
"urllib.quote_plus",
"urlparse.urlparse"
] | [((3075, 3099), 'urlparse.urlparse', 'urlparse.urlparse', (['r.url'], {}), '(r.url)\n', (3092, 3099), False, 'import urlparse\n'), ((3166, 3197), 'urlparse.parse_qs', 'urlparse.parse_qs', (['parsed.query'], {}), '(parsed.query)\n', (3183, 3197), False, 'import urlparse\n'), ((3821, 3849), 'urllib.quote_plus', 'urllib.q... |
import sys
from setuptools import setup
required_packages = ["boombox", "Pillow", "PyYAML", "rich"]
win_packages = ["keyboard"]
unix_packages = ["pynput"]
WIN = "win32"
LINUX = "linux"
MACOS = "darwin"
if sys.platform == WIN:
required_packages += win_packages
elif sys.platform in (LINUX, MACOS):
required_pa... | [
"setuptools.setup"
] | [((345, 897), 'setuptools.setup', 'setup', ([], {'name': '"""pantheras_box"""', 'version': '"""0.1.0"""', 'packages': "['pantheras_box', 'pantheras_box.story', 'pantheras_box.sounds',\n 'pantheras_box.backend', 'pantheras_box.frontend',\n 'pantheras_box.keyboard_handlers']", 'url': '""""""', 'license': '"""MIT"""... |
from zipcodes import is_valid
from random import randint
from all_lunch_locs import call_lunch_api
default_max = 30
default_range = 20
def random_zip():
# because what matters is good food, not close food.
random_zip = 0
# because strings are required for this module
while not is_valid(str(random_zip... | [
"zipcodes.is_valid",
"all_lunch_locs.call_lunch_api",
"random.randint"
] | [((1451, 1478), 'random.randint', 'randint', (['(0)', '(number_locs - 1)'], {}), '(0, number_locs - 1)\n', (1458, 1478), False, 'from random import randint\n'), ((1791, 1865), 'all_lunch_locs.call_lunch_api', 'call_lunch_api', ([], {'location': "param_dict['location']", 'range': "param_dict['range']"}), "(location=para... |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
from lottery.branch import base
import models.registry
from pruning.mask import Mask
from pruning.pruned_model import PrunedModel... | [
"utils.tensor_utils.erank",
"pruning.pruned_model.PrunedModel.to_mask_name",
"matplotlib.use",
"pruning.mask.Mask.load",
"pruning.mask.Mask.ones_like",
"os.path.join",
"numpy.argmax",
"seaborn.set_style",
"pruning.mask.Mask",
"seaborn.lineplot",
"torch.svd",
"copy.deepcopy",
"platforms.platf... | [((689, 710), 'matplotlib.use', 'matplotlib.use', (['"""pdf"""'], {}), "('pdf')\n", (703, 710), False, 'import matplotlib\n'), ((909, 935), 'seaborn.set_style', 'sns.set_style', (['"""whitegrid"""'], {}), "('whitegrid')\n", (922, 935), True, 'import seaborn as sns\n'), ((1281, 1307), 'pruning.mask.Mask.load', 'Mask.loa... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from collections import OrderedDict
from decimal import Decimal
from parser_data import InlineList, DuplicationList
from state import State, StateMachine
from type_check import is_int, is_float, is_sci_notation
from format import format
from error import DMPException
cl... | [
"parser_data.DuplicationList",
"type_check.is_sci_notation",
"collections.OrderedDict",
"type_check.is_int",
"error.DMPException.wraps",
"state.State.Error",
"type_check.is_float",
"subprocess.call",
"parser_data.InlineList",
"format.format",
"decimal.Decimal"
] | [((5702, 5744), 'subprocess.call', 'subprocess.call', (["['diff', infile, outfile]"], {}), "(['diff', infile, outfile])\n", (5717, 5744), False, 'import subprocess\n'), ((5749, 5781), 'subprocess.call', 'subprocess.call', (["['rm', outfile]"], {}), "(['rm', outfile])\n", (5764, 5781), False, 'import subprocess\n'), ((4... |
import torch
import math
from .grids import *
from .conversions import *
# =============================================================================
# Equirectangular mapping functions
# =============================================================================
#
# Note that there is no concept of padding for ... | [
"torch.stack",
"torch.zeros"
] | [((922, 946), 'torch.zeros', 'torch.zeros', (['kernel_size'], {}), '(kernel_size)\n', (933, 946), False, 'import torch\n'), ((958, 982), 'torch.zeros', 'torch.zeros', (['kernel_size'], {}), '(kernel_size)\n', (969, 982), False, 'import torch\n'), ((5778, 5802), 'torch.zeros', 'torch.zeros', (['kernel_size'], {}), '(ker... |
import json
from typing import Any, Callable, Dict, Optional
import attr
from .interfaces import Event, Router
@attr.s(kw_only=True)
class SingleRoute(Router):
"""
Routes to a single defined route without any conditions.
:param route: The single defined route. Only set via ``add_route``.
"""
... | [
"json.loads",
"attr.s",
"attr.ib"
] | [((117, 137), 'attr.s', 'attr.s', ([], {'kw_only': '(True)'}), '(kw_only=True)\n', (123, 137), False, 'import attr\n'), ((1411, 1431), 'attr.s', 'attr.s', ([], {'kw_only': '(True)'}), '(kw_only=True)\n', (1417, 1431), False, 'import attr\n'), ((3057, 3077), 'attr.s', 'attr.s', ([], {'kw_only': '(True)'}), '(kw_only=Tru... |
"""autogenerated by genpy from multi_map_server/VerticalOccupancyGridList.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class VerticalOccupancyGridList(genpy.Message):
_md5sum = "7ef85cc95b82747f51eb01a16bd7c795"
_type = "multi_map_server/Verti... | [
"struct.calcsize",
"struct.pack",
"struct.unpack",
"genpy.DeserializationError",
"struct.Struct"
] | [((6005, 6025), 'struct.Struct', 'struct.Struct', (['"""<2f"""'], {}), "('<2f')\n", (6018, 6025), False, 'import struct\n'), ((3115, 3139), 'struct.calcsize', 'struct.calcsize', (['pattern'], {}), '(pattern)\n', (3130, 3139), False, 'import struct\n'), ((3159, 3197), 'struct.unpack', 'struct.unpack', (['pattern', 'str[... |
"""
==============
GLVQ Benchmark
==============
This example shows the differences between the 4 different GLVQ implementations and LMNN.
The Image Segmentation dataset is used for training and test. Each plot shows the projection
and classification from each implementation. Because Glvq can't project the data on its ... | [
"sklearn_lvq.GmlvqModel",
"sklearn_lvq.LgmlvqModel",
"sklearn.decomposition.PCA",
"numpy.asarray",
"sklearn_lvq.utils._to_tango_colors",
"numpy.array",
"metric_learn.LMNN",
"sklearn_lvq.utils._tango_color",
"sklearn_lvq.GlvqModel",
"matplotlib.pyplot.subplot",
"sklearn_lvq.GrlvqModel",
"matplo... | [((1441, 1471), 'numpy.asarray', 'np.asarray', (['x'], {'dtype': '"""float64"""'}), "(x, dtype='float64')\n", (1451, 1471), True, 'import numpy as np\n'), ((1476, 1489), 'numpy.asarray', 'np.asarray', (['y'], {}), '(y)\n', (1486, 1489), True, 'import numpy as np\n'), ((1498, 1525), 'metric_learn.LMNN', 'LMNN', ([], {'k... |
def setopts(defaults, given):
"""Override default keyword dictionary options.
kwargs = setopts(defaults, kwargs)
A warning is shown if kwargs contains a key not found in default.
"""
# Override defaults
for key, value in given.items():
if type(given[key]) == dict:
setopts(... | [
"os.path.exists",
"time.strptime",
"shutil.copyfileobj",
"os.makedirs",
"inspect.stack",
"sys.stderr.flush",
"sys._getframe",
"os.utime",
"urllib.quote",
"os.path.dirname",
"sys.exc_info",
"json.load",
"urllib3.PoolManager",
"os.path.basename",
"warnings.warn",
"os.stat",
"sys.stdout... | [((3033, 3057), 'warnings.warn', 'warn', (['"""Normal warning 1"""'], {}), "('Normal warning 1')\n", (3037, 3057), False, 'from warnings import warn\n'), ((3062, 3086), 'warnings.warn', 'warn', (['"""Normal warning 2"""'], {}), "('Normal warning 2')\n", (3066, 3086), False, 'from warnings import warn\n'), ((3153, 3177)... |
from __future__ import unicode_literals, print_function, division
import feedparser
import dataset
from twisted.internet.reactor import callLater
from threading import Thread
import twisted.internet.error
import logging
logger = logging.getLogger('module_rss')
DATABASE = None
updater = None
botref = None
config = {}
... | [
"logging.getLogger",
"feedparser.parse",
"twisted.internet.reactor.callLater",
"threading.Thread",
"dataset.connect"
] | [((231, 262), 'logging.getLogger', 'logging.getLogger', (['"""module_rss"""'], {}), "('module_rss')\n", (248, 262), False, 'import logging\n'), ((844, 871), 'twisted.internet.reactor.callLater', 'callLater', (['(30)', 'update_feeds'], {}), '(30, update_feeds)\n', (853, 871), False, 'from twisted.internet.reactor import... |
__author__ = "<NAME> - 16600748"
from capstone import *
import pefile, os
# samplePaths = ["testSamples/" + sample for sample in os.listdir("testSamples")]
samplePaths = ["../bin-utf8-vec/benignSamples/" + sample for sample in os.listdir("../bin-utf8-vec/benignSamples")] + \
["../bin-utf8-vec/malwareSamples/" + sampl... | [
"os.system",
"os.listdir",
"pefile.PE"
] | [((639, 672), 'pefile.PE', 'pefile.PE', (['sample'], {'fast_load': '(True)'}), '(sample, fast_load=True)\n', (648, 672), False, 'import pefile, os\n'), ((1426, 1444), 'os.system', 'os.system', (['"""clear"""'], {}), "('clear')\n", (1435, 1444), False, 'import pefile, os\n'), ((447, 494), 'os.listdir', 'os.listdir', (['... |
import unittest
import os
import sys
import StringIO
path = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../lvsm')))
from lvsm.modules import keepalived
class Keepalived(unittest.TestCase):
"""Tests for the functionality of the keepalive... | [
"unittest.main",
"os.path.dirname",
"lvsm.modules.keepalived.Keepalived"
] | [((77, 102), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (92, 102), False, 'import os\n'), ((2035, 2050), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2048, 2050), False, 'import unittest\n'), ((649, 770), 'lvsm.modules.keepalived.Keepalived', 'keepalived.Keepalived', (["(path + '/... |
"""
Copyright 2014-2018 University of Illinois
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writ... | [
"django.conf.urls.url"
] | [((886, 1002), 'django.conf.urls.url', 'url', (['"""^all/(?P<result_slug>[\\\\w-]+)/(?P<rule_grouping>[\\\\w-]+)/$"""', 'GroupResultsViewCSV'], {'name': '"""group_results_csv"""'}), "('^all/(?P<result_slug>[\\\\w-]+)/(?P<rule_grouping>[\\\\w-]+)/$',\n GroupResultsViewCSV, name='group_results_csv')\n", (889, 1002), F... |
"""Test."""
import os
import unittest
import pytest
from utils import www
TEST_JSON_URL = os.path.join(
'https://raw.githubusercontent.com',
'nuuuwan/misc-sl-data/master',
'sl_power_station_info.json',
)
TEST_TSV_URL = os.path.join(
'https://raw.githubusercontent.com',
'nuuuwan/gig-data/master',... | [
"utils.www.exists",
"utils.www.read",
"utils.www.download_binary",
"os.path.join",
"utils.www.get_all_urls",
"utils.www.read_tsv",
"utils.www.read_json"
] | [((93, 207), 'os.path.join', 'os.path.join', (['"""https://raw.githubusercontent.com"""', '"""nuuuwan/misc-sl-data/master"""', '"""sl_power_station_info.json"""'], {}), "('https://raw.githubusercontent.com',\n 'nuuuwan/misc-sl-data/master', 'sl_power_station_info.json')\n", (105, 207), False, 'import os\n'), ((235, ... |
import pytest
import re
import unittest
import metric_learn
import numpy as np
from sklearn import clone
from test.test_utils import ids_metric_learners, metric_learners, remove_y
from metric_learn.sklearn_shims import set_random_state, SKLEARN_AT_LEAST_0_22
def remove_spaces(s):
return re.sub(r'\s+', '', s)
def ... | [
"metric_learn.SDML",
"metric_learn.sklearn_shims.set_random_state",
"numpy.array",
"sklearn.clone",
"numpy.sin",
"unittest.main",
"metric_learn.MMC",
"metric_learn.MMC_Supervised",
"metric_learn.MLKR",
"metric_learn.NCA",
"test.test_utils.remove_y",
"metric_learn.SDML_Supervised",
"metric_le... | [((7493, 7591), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""estimator, build_dataset"""', 'metric_learners'], {'ids': 'ids_metric_learners'}), "('estimator, build_dataset', metric_learners, ids=\n ids_metric_learners)\n", (7516, 7591), False, 'import pytest\n'), ((8409, 8507), 'pytest.mark.parametriz... |
import numpy as np
import pandas as pd
import scipy as sc
from scipy.stats import randint, norm, multivariate_normal, ortho_group
from scipy import linalg
from scipy.linalg import subspace_angles, orth
from scipy.optimize import fmin
import math
from statistics import mean
import seaborn as sns
from sklearn.cluster imp... | [
"sklearn.cluster.KMeans",
"statistics.mean",
"numpy.trace",
"scipy.optimize.bisect",
"numpy.random.rand",
"cluster.selfrepresentation.ElasticNetSubspaceClustering",
"numpy.ones",
"sklearn.decomposition.PCA",
"math.degrees",
"seaborn.heatmap",
"numpy.array",
"numpy.random.randint",
"numpy.zer... | [((2804, 2824), 'sklearn.cluster.KMeans', 'KMeans', ([], {'n_clusters': 'k'}), '(n_clusters=k)\n', (2810, 2824), False, 'from sklearn.cluster import KMeans\n'), ((2842, 2857), 'pandas.DataFrame', 'pd.DataFrame', (['X'], {}), '(X)\n', (2854, 2857), True, 'import pandas as pd\n'), ((6547, 6561), 'pandas.DataFrame', 'pd.D... |
import numba as nb
import numpy as np
import torch
from torch.autograd import Function
from Constants import MPS_KERNEL as w
from Constants import BASE_RADIUS, ND_RAIUS, GRAD_RADIUS, LAP_RADIUS
class DivOp(Function):
"""Compute the divergence of a given physics value.
Implement in terms of pytorch autogra... | [
"torch.zeros_like",
"torch.stack",
"torch.from_numpy",
"torch.sparse.mm"
] | [((1501, 1524), 'torch.sparse.mm', 'torch.sparse.mm', (['A', 'val'], {}), '(A, val)\n', (1516, 1524), False, 'import torch\n'), ((1712, 1742), 'torch.sparse.mm', 'torch.sparse.mm', (['A', 'grad_input'], {}), '(A, grad_input)\n', (1727, 1742), False, 'import torch\n'), ((2704, 2725), 'torch.zeros_like', 'torch.zeros_lik... |
# LinearRegression.py
# March 2018
#
# This script builds a Linear regression class to analyse data.
# It supports a continuous response and several continuous features.
# The class has a constructor building and fitting the model, and
# a plotting method for residuals.
#
# Dependencies:
#
# Usage:
# from pythia.Li... | [
"matplotlib.pyplot.ylabel",
"numpy.polyfit",
"numpy.array",
"numpy.poly1d",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.asarray",
"matplotlib.pyplot.axhline",
"numpy.dot",
"matplotlib.pyplot.scatter",
"numpy.abs",
"numpy.ones",
"matplotlib.use",
"matplotlib.pyplot.title",
... | [((468, 489), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (482, 489), False, 'import matplotlib\n'), ((563, 583), 'os.path.abspath', 'os.path.abspath', (['"""."""'], {}), "('.')\n", (578, 583), False, 'import os\n'), ((604, 626), 'os.path.abspath', 'os.path.abspath', (['"""../"""'], {}), "('..... |
# encoding: UTF-8
"""Physics Applications Utility"""
__copyright__ = "Copyright (c) 2015, Facility for Rare Isotope Beams"
__author__ = "<NAME>"
__version__ = "0.0.1"
import logging
import phylib
import machine
from machine import *
from phylib.libCore import *
# configure the root logger
logging.basicConfig(forma... | [
"logging.basicConfig"
] | [((295, 374), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(levelname)s: %(asctime)s: %(name)s: %(message)s"""'}), "(format='%(levelname)s: %(asctime)s: %(name)s: %(message)s')\n", (314, 374), False, 'import logging\n')] |
#!python3
#
# Copyright (C) 2014-2015 <NAME>. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""
PYPOWER-Dynamics
Functions for standard blocks (solves a step)
"""
import numpy as np
# Gain block
# yo = p * yi
# p is a scalar gain coefficie... | [
"numpy.prod"
] | [((1560, 1571), 'numpy.prod', 'np.prod', (['yi'], {}), '(yi)\n', (1567, 1571), True, 'import numpy as np\n')] |
from collections import namedtuple
import pytest
from nesta.packages.examples.example_package import some_func
@pytest.fixture
def mocked_row():
def _mocked_row(*, id, name):
Row = namedtuple('Row', ['id', 'name'])
return Row(id=id, name=name)
return _mocked_row
class TestSomeFunc:
def... | [
"nesta.packages.examples.example_package.some_func",
"collections.namedtuple"
] | [((197, 230), 'collections.namedtuple', 'namedtuple', (['"""Row"""', "['id', 'name']"], {}), "('Row', ['id', 'name'])\n", (207, 230), False, 'from collections import namedtuple\n'), ((459, 487), 'nesta.packages.examples.example_package.some_func', 'some_func', (['"""cat"""', 'mocked_row'], {}), "('cat', mocked_row)\n",... |
import asyncio
import unittest
import unittest.mock
import shc.misc
from test._helper import ExampleSubscribable, ExampleWritable, async_test, ExampleReadable
class MiscTests(unittest.TestCase):
@async_test
async def test_two_way_pipe(self) -> None:
pipe = shc.misc.TwoWayPipe(float)
pub_lef... | [
"test._helper.ExampleWritable",
"test._helper.ExampleSubscribable",
"test._helper.ExampleReadable",
"asyncio.sleep"
] | [((324, 350), 'test._helper.ExampleSubscribable', 'ExampleSubscribable', (['float'], {}), '(float)\n', (343, 350), False, 'from test._helper import ExampleSubscribable, ExampleWritable, async_test, ExampleReadable\n'), ((371, 397), 'test._helper.ExampleSubscribable', 'ExampleSubscribable', (['float'], {}), '(float)\n',... |
# -*- coding: utf-8 -*-
"""Supports F10.7 index values. Downloads data from LASP and the SWPC.
Properties
----------
platform
'sw'
name
'f107'
tag
- 'historic' LASP F10.7 data (downloads by month, loads by day)
- 'prelim' Preliminary SWPC daily solar indices
- 'daily' Daily SWPC solar indices (cont... | [
"pysat.Files.from_os",
"datetime.timedelta",
"pysatSpaceWeather.instruments.methods.f107.rewrite_daily_file",
"pandas.date_range",
"os.remove",
"datetime.datetime",
"ftplib.FTP",
"numpy.where",
"pandas.DataFrame.from_dict",
"os.path.split",
"pandas.DataFrame",
"sys.stdout.flush",
"json.loads... | [((3004, 3024), 'datetime.datetime.utcnow', 'dt.datetime.utcnow', ([], {}), '()\n', (3022, 3024), True, 'import datetime as dt\n'), ((3033, 3074), 'datetime.datetime', 'dt.datetime', (['now.year', 'now.month', 'now.day'], {}), '(now.year, now.month, now.day)\n', (3044, 3074), True, 'import datetime as dt\n'), ((3178, 3... |
# Generated by Django 3.0.5 on 2020-08-13 19:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('user', '0003_auto_20200813_1943'),
]
operations = [
migrations.AlterField(
model_name='user',
name='emailConfirmToke... | [
"django.db.models.TextField"
] | [((342, 438), 'django.db.models.TextField', 'models.TextField', ([], {'default': '"""-<KEY>"""', 'max_length': '(30)', 'verbose_name': '"""Токен подтверждения почты"""'}), "(default='-<KEY>', max_length=30, verbose_name=\n 'Токен подтверждения почты')\n", (358, 438), False, 'from django.db import migrations, models\... |
import glfw
import OpenGL.GL as gl
import imgui
from imgui.integrations.glfw import GlfwRenderer
def app(render):
imgui.create_context()
window = impl_glfw_init()
impl = GlfwRenderer(window)
while not glfw.window_should_close(window):
glfw.poll_events()
impl.process_inputs()
gl... | [
"glfw.make_context_current",
"glfw.swap_buffers",
"glfw.window_should_close",
"imgui.integrations.glfw.GlfwRenderer",
"glfw.poll_events",
"imgui.create_context",
"OpenGL.GL.glClear",
"glfw.window_hint",
"imgui.render",
"imgui.get_draw_data",
"OpenGL.GL.glClearColor",
"imgui.new_frame",
"glfw... | [((120, 142), 'imgui.create_context', 'imgui.create_context', ([], {}), '()\n', (140, 142), False, 'import imgui\n'), ((184, 204), 'imgui.integrations.glfw.GlfwRenderer', 'GlfwRenderer', (['window'], {}), '(window)\n', (196, 204), False, 'from imgui.integrations.glfw import GlfwRenderer\n'), ((561, 577), 'glfw.terminat... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Usage: %(scriptName) <bug_report_file> <data_prefix>
"""
import json
from timeit import default_timer
import datetime
import numpy as np
import pickle
import sys
from multiprocessing import Pool
from operator import itemgetter
from scipy import sparse
from sklearn.fe... | [
"sklearn.feature_extraction.text.TfidfTransformer",
"unqlite.UnQLite",
"timeit.default_timer",
"scipy.sparse.load_npz",
"tqdm.tqdm",
"operator.itemgetter",
"json.load",
"numpy.sum",
"datetime.datetime.now",
"numpy.zeros",
"multiprocessing.Pool",
"pickle.loads",
"scipy.sparse.save_npz",
"sc... | [((543, 558), 'timeit.default_timer', 'default_timer', ([], {}), '()\n', (556, 558), False, 'from timeit import default_timer\n'), ((846, 861), 'timeit.default_timer', 'default_timer', ([], {}), '()\n', (859, 861), False, 'from timeit import default_timer\n'), ((2114, 2147), 'pickle.loads', 'pickle.loads', (['types[var... |
from .db import db
from .userfollower import UserFollower
from werkzeug.security import generate_password_hash, check_password_hash
from flask_login import UserMixin
from sqlalchemy import Table, Column, Integer, ForeignKey, or_
from .directmessage import DirectMessage
from .userequipment import UserEquipment
from .equ... | [
"sqlalchemy.or_",
"werkzeug.security.generate_password_hash",
"werkzeug.security.check_password_hash"
] | [((2516, 2548), 'werkzeug.security.generate_password_hash', 'generate_password_hash', (['password'], {}), '(password)\n', (2538, 2548), False, 'from werkzeug.security import generate_password_hash, check_password_hash\n'), ((2600, 2644), 'werkzeug.security.check_password_hash', 'check_password_hash', (['self.password',... |
# Copyright 2016-2020 Blue Marble Analytics LLC.
#
# 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 ag... | [
"gridpath.project.operations.operational_types.common_functions.determine_relevant_timepoints",
"tests.common_functions.add_components_and_load_data",
"builtins.str",
"sys.exit",
"unittest.main"
] | [((8114, 8129), 'unittest.main', 'unittest.main', ([], {}), '()\n', (8127, 8129), False, 'import unittest\n'), ((2120, 2277), 'tests.common_functions.add_components_and_load_data', 'add_components_and_load_data', ([], {'prereq_modules': 'IMPORTED_PREREQ_MODULES', 'module_to_test': 'None', 'test_data_dir': 'TEST_DATA_DI... |
"""
Flask application settings.
"""
import os
DEBUG = True
# Output un-merged files in debug mode.
#ASSETS_DEBUG = DEBUG
SECRET_KEY = os.environ.get('SECRET_KEY', None)
MY_VAR = os.environ.get('MY_VAR', None)
#: Mongodb settings
MONGODB_SETTINGS = {'DB' : 'digfont'}
#: CSRF key
SECRET_KEY = "dig.font.s3cr3t"
| [
"os.environ.get"
] | [((138, 172), 'os.environ.get', 'os.environ.get', (['"""SECRET_KEY"""', 'None'], {}), "('SECRET_KEY', None)\n", (152, 172), False, 'import os\n'), ((182, 212), 'os.environ.get', 'os.environ.get', (['"""MY_VAR"""', 'None'], {}), "('MY_VAR', None)\n", (196, 212), False, 'import os\n')] |
import math
import time
from compas_fab.backends import RosClient
from compas.artists import Artist
from compas.geometry import Frame
with RosClient("localhost") as client:
robot = client.load_robot(load_geometry=True)
group = robot.main_group_name
frame = Frame((0.4, 0.3, 0.05), (-1, 0, 0), (0, 1, 0))
... | [
"compas.geometry.Frame",
"compas.artists.Artist",
"time.sleep",
"math.radians",
"compas_fab.backends.RosClient"
] | [((142, 164), 'compas_fab.backends.RosClient', 'RosClient', (['"""localhost"""'], {}), "('localhost')\n", (151, 164), False, 'from compas_fab.backends import RosClient\n'), ((273, 319), 'compas.geometry.Frame', 'Frame', (['(0.4, 0.3, 0.05)', '(-1, 0, 0)', '(0, 1, 0)'], {}), '((0.4, 0.3, 0.05), (-1, 0, 0), (0, 1, 0))\n'... |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from textwrap import... | [
"pants.base.build_file_aliases.BuildFileAliases.create",
"textwrap.dedent"
] | [((1442, 1926), 'pants.base.build_file_aliases.BuildFileAliases.create', 'BuildFileAliases.create', ([], {'targets': "{'java_library': JavaLibrary, 'python_library': PythonLibrary,\n 'jar_library': JarLibrary, 'unpacked_jars': UnpackedJars, 'resources':\n Resources, 'java_thrift_library': JavaThriftLibrary,\n ... |
import PIL
import numpy as np
def to_grayscale(img):
return np.dot(img, [0.299, 0.587, 0.144])
def zero_center(img):
return img - 127.0
def crop(img, bottom=12, left=6, right=6):
height, width = img.shape
return img[0: height - bottom, left: width - right]
def save(img, path):
pil_img = PIL.... | [
"numpy.dot",
"PIL.Image.fromarray"
] | [((66, 100), 'numpy.dot', 'np.dot', (['img', '[0.299, 0.587, 0.144]'], {}), '(img, [0.299, 0.587, 0.144])\n', (72, 100), True, 'import numpy as np\n'), ((316, 340), 'PIL.Image.fromarray', 'PIL.Image.fromarray', (['img'], {}), '(img)\n', (335, 340), False, 'import PIL\n')] |
"""
:mod:`pyffi.formats.tga` --- Targa (.tga)
=========================================
Implementation
--------------
.. autoclass:: TgaFormat
:show-inheritance:
:members:
Regression tests
----------------
Read a TGA file
^^^^^^^^^^^^^^^
>>> # check and read tga file
>>> import os
>>> from os.path import dir... | [
"pyffi.utils.graph.EdgeFilter",
"os.getenv",
"re.compile",
"os.path.dirname",
"doctest.testmod"
] | [((4018, 4057), 're.compile', 're.compile', (['"""^.*\\\\.tga$"""', 're.IGNORECASE'], {}), "('^.*\\\\.tga$', re.IGNORECASE)\n", (4028, 4057), False, 'import struct, os, re\n'), ((10857, 10874), 'doctest.testmod', 'doctest.testmod', ([], {}), '()\n', (10872, 10874), False, 'import doctest\n'), ((3896, 3919), 'os.getenv'... |
import telegram
import os
def main():
token = os.getenv("TOKEN", None)
message = os.getenv("MESSAGE", "No message, please set MESSAGE env")
chat_id = os.getenv("CHAT_ID", None)
bot = telegram.Bot(token=token)
bot.send_message(chat_id=chat_id, text=message, parse_mode=telegram.ParseMode.HTML)
if... | [
"telegram.Bot",
"os.getenv"
] | [((52, 76), 'os.getenv', 'os.getenv', (['"""TOKEN"""', 'None'], {}), "('TOKEN', None)\n", (61, 76), False, 'import os\n'), ((91, 149), 'os.getenv', 'os.getenv', (['"""MESSAGE"""', '"""No message, please set MESSAGE env"""'], {}), "('MESSAGE', 'No message, please set MESSAGE env')\n", (100, 149), False, 'import os\n'), ... |
# -*- encoding: utf-8 -*-
"""
Filename :train.py
Description :获取小作文摘要
Time :2021/06/22 15:21:08
Author :hwa
Version :1.0
"""
from app.lib.duplication_check.reply_database import ReplyDatabase
import time
def train_data():
start_time = time.time()
db = ReplyDatabase.... | [
"app.lib.duplication_check.reply_database.ReplyDatabase.load_from_json",
"time.time"
] | [((285, 296), 'time.time', 'time.time', ([], {}), '()\n', (294, 296), False, 'import time\n'), ((306, 367), 'app.lib.duplication_check.reply_database.ReplyDatabase.load_from_json', 'ReplyDatabase.load_from_json', (['"""data/bilibili_cnki_reply.json"""'], {}), "('data/bilibili_cnki_reply.json')\n", (334, 367), False, 'f... |
"""Builder for generating evergreen configuration."""
from threading import Lock
from typing import Set, List, Dict
import inject
from shrub.v2 import ShrubProject, BuildVariant, ExistingTask, Task
from buildscripts.patch_builds.task_generation import validate_task_generation_limit
from buildscripts.task_generation.c... | [
"shrub.v2.ShrubProject.empty",
"buildscripts.patch_builds.task_generation.validate_task_generation_limit",
"threading.Lock",
"buildscripts.task_generation.generated_config.GeneratedConfiguration",
"inject.autoparams",
"shrub.v2.ExistingTask",
"shrub.v2.BuildVariant"
] | [((1018, 1037), 'inject.autoparams', 'inject.autoparams', ([], {}), '()\n', (1035, 1037), False, 'import inject\n'), ((1872, 1892), 'shrub.v2.ShrubProject.empty', 'ShrubProject.empty', ([], {}), '()\n', (1890, 1892), False, 'from shrub.v2 import ShrubProject, BuildVariant, ExistingTask, Task\n'), ((2026, 2032), 'thread... |
"""
Routes and views for the flask application.
"""
import os
import json
from flask import Flask, redirect, request, render_template, flash
from pathlib import Path
from flask_wtf import FlaskForm
from wtforms import StringField,SelectField,PasswordField,BooleanField
from wtforms.validators import InputRequired,Valida... | [
"flask.render_template",
"flask.flash",
"pathlib.Path",
"wtforms.validators.ValidationError",
"wtforms.BooleanField",
"wtforms.PasswordField",
"pathlib.Path.home",
"os.path.join",
"wtforms.StringField",
"flask.redirect",
"json.load",
"wtforms.SelectField",
"json.dump"
] | [((1044, 1147), 'wtforms.SelectField', 'SelectField', (['"""Data Source"""'], {'choices': "[(source_dexcom, 'Dexcom'), (source_nightscout, 'Nightscout')]"}), "('Data Source', choices=[(source_dexcom, 'Dexcom'), (\n source_nightscout, 'Nightscout')])\n", (1055, 1147), False, 'from wtforms import StringField, SelectFi... |
########################################
# Automatically generated, do not edit.
########################################
from pyvisdk.thirdparty import Enum
VirtualMachineHtSharing = Enum(
'any',
'internal',
'none',
)
| [
"pyvisdk.thirdparty.Enum"
] | [((188, 219), 'pyvisdk.thirdparty.Enum', 'Enum', (['"""any"""', '"""internal"""', '"""none"""'], {}), "('any', 'internal', 'none')\n", (192, 219), False, 'from pyvisdk.thirdparty import Enum\n')] |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | [
"bpy.props.IntProperty",
"bpy.props.BoolProperty",
"bpy.props.StringProperty",
"bpy.utils.unregister_module",
"time.clock",
"bpy.types.INFO_MT_file_export.append",
"bpy.types.INFO_MT_file_export.remove",
"imp.reload",
"bpy.props.FloatProperty",
"bpy.props.EnumProperty",
"bpy.utils.register_modul... | [((2562, 2623), 'bpy.props.StringProperty', 'StringProperty', ([], {'default': '"""*.XMODEL_EXPORT"""', 'options': "{'HIDDEN'}"}), "(default='*.XMODEL_EXPORT', options={'HIDDEN'})\n", (2576, 2623), False, 'from bpy.props import BoolProperty, IntProperty, FloatProperty, StringProperty, EnumProperty\n'), ((4447, 4519), '... |
from collections import deque
class Solution(object):
def longestOnes(self, A, K):
"""
:type A: List[int]
:type K: int
:rtype: int
"""
start, res = 0, 0
zeros = deque()
for i in range(len(A)):
if A[i] == 0:
zeros.append(i)... | [
"collections.deque"
] | [((223, 230), 'collections.deque', 'deque', ([], {}), '()\n', (228, 230), False, 'from collections import deque\n')] |
#
# This script allows the user to control an Anki car using Python
# To control multiple cars at once, open a seperate Command Line Window for each car
# and call this script with the approriate car mac address.
# This script attempts to save lap times into local mysql db running on the pi
# Author: jstucken
#... | [
"overdrive.Overdrive",
"php_communicator.PhpCommunicator",
"network.Network.getLocalIPAddress",
"time.sleep"
] | [((594, 607), 'overdrive.Overdrive', 'Overdrive', (['(12)'], {}), '(12)\n', (603, 607), False, 'from overdrive import Overdrive\n'), ((1074, 1089), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (1084, 1089), False, 'import time\n'), ((2209, 2236), 'network.Network.getLocalIPAddress', 'Network.getLocalIPAddres... |
import board
from i2cperipheral import I2CPeripheral
from analogio import AnalogOut
from digitalio import DigitalInOut, Direction, Pull
import struct
import math
import time
regs = [0] * 16
index = 0
i2c_addr = 0x68
frame_id = 0
motor_control_mode = 0
backup_mode = 0
motor_switch_state = 0
hall_switch_state = 0
enc... | [
"i2cperipheral.I2CPeripheral",
"math.floor",
"time.sleep",
"struct.pack",
"struct.unpack",
"analogio.AnalogOut",
"digitalio.DigitalInOut"
] | [((575, 594), 'math.floor', 'math.floor', (['(100 / 2)'], {}), '(100 / 2)\n', (585, 594), False, 'import math\n'), ((3089, 3108), 'analogio.AnalogOut', 'AnalogOut', (['board.A0'], {}), '(board.A0)\n', (3098, 3108), False, 'from analogio import AnalogOut\n'), ((3152, 3174), 'digitalio.DigitalInOut', 'DigitalInOut', (['b... |
import threading
import time
import random
from multiprocessing.pool import ThreadPool
from PyQt5 import QtCore, QtGui, QtWidgets
bandera = False
val1 = ""
msg = 'Caballo ganador es: {}'
# Clase Caballo
class caballo(threading.Thread):
def __init__(self, num, b1,resultado):
global val... | [
"threading.Thread.__init__",
"random.choice",
"time.time",
"time.sleep"
] | [((337, 368), 'threading.Thread.__init__', 'threading.Thread.__init__', (['self'], {}), '(self)\n', (362, 368), False, 'import threading\n'), ((449, 460), 'time.time', 'time.time', ([], {}), '()\n', (458, 460), False, 'import time\n'), ((757, 778), 'random.choice', 'random.choice', (['mylist'], {}), '(mylist)\n', (770,... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020 Red Hat, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modi... | [
"freshmaker.kojiservice.KojiService",
"freshmaker.db.session.commit",
"re.search",
"semver.VersionInfo",
"freshmaker.log.info",
"freshmaker.lightblue.ContainerImage.get_additional_data_from_koji",
"koji.parse_NVR",
"datetime.datetime.utcnow",
"freshmaker.models.Event.get_or_create_from_event",
"se... | [((3228, 3277), 'freshmaker.models.Event.get_or_create_from_event', 'Event.get_or_create_from_event', (['db.session', 'event'], {}), '(db.session, event)\n', (3258, 3277), False, 'from freshmaker.models import ArtifactBuild, ArtifactType, Event\n'), ((11258, 11288), 'freshmaker.kojiservice.KojiService', 'KojiService', ... |
'''
' Python Regular Expression 正则表达式
'
'''
import re
def test_match():
s = 'hello python Hello'
p = 'hello'
o = re.match(p, s)
print(o)
print(dir(o))
print(o.group()) # 返回匹配的字符串
print(o.span()) # 范围
print(o.start()) # 开始处
print('*' * 30, 'flags参数的使用')
o2 = re.match(p, s, re.L)
print(o2.grou... | [
"re.subn",
"re.split",
"re.compile",
"re.match",
"re.finditer",
"re.sub",
"re.findall",
"re.search"
] | [((122, 136), 're.match', 're.match', (['p', 's'], {}), '(p, s)\n', (130, 136), False, 'import re\n'), ((284, 304), 're.match', 're.match', (['p', 's', 're.L'], {}), '(p, s, re.L)\n', (292, 304), False, 'import re\n'), ((5937, 5992), 're.match', 're.match', (['"""(\\\\d{3,4})-([1-9]\\\\d{4,7})"""', '"""1111-88888888"""... |
#! /usr/bin/env python2
# -*- coding: utf8 -*-
from subprocess import check_output
def get_pass():
return check_output("pass gmail/me", shell=True).strip("\n")
| [
"subprocess.check_output"
] | [((112, 153), 'subprocess.check_output', 'check_output', (['"""pass gmail/me"""'], {'shell': '(True)'}), "('pass gmail/me', shell=True)\n", (124, 153), False, 'from subprocess import check_output\n')] |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-12 17:41
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('menuCreate', '0001_initial'),
... | [
"django.db.models.DateField",
"django.db.models.AutoField",
"django.db.models.CharField",
"django.db.models.ForeignKey"
] | [((495, 588), '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", (511, 588), False, 'from django.db import migrations, models\... |
"""
S3AIO Class
Array access to a single S3 object
"""
from __future__ import absolute_import
import SharedArray as sa
import zstd
from itertools import repeat, product
import numpy as np
from pathos.multiprocessing import ProcessingPool
from six.moves import zip
try:
from StringIO import StringIO
except Impor... | [
"SharedArray.create",
"numpy.ravel_multi_index",
"itertools.product",
"zstd.ZstdDecompressor",
"SharedArray.delete",
"numpy.empty",
"numpy.unravel_index",
"numpy.frombuffer",
"numpy.dtype",
"SharedArray.attach",
"six.moves.zip",
"pathos.multiprocessing.ProcessingPool",
"itertools.repeat"
] | [((998, 1025), 'pathos.multiprocessing.ProcessingPool', 'ProcessingPool', (['num_workers'], {}), '(num_workers)\n', (1012, 1025), False, 'from pathos.multiprocessing import ProcessingPool\n'), ((1340, 1374), 'numpy.ravel_multi_index', 'np.ravel_multi_index', (['index', 'shape'], {}), '(index, shape)\n', (1360, 1374), T... |
import pickle
from unittest import mock
from nose2.tools.params import params
import numpy as np
import tensorflow as tf
from garage.tf.envs import TfEnv
from garage.tf.policies import GaussianMLPPolicyWithModel
from tests.fixtures import TfGraphTestCase
from tests.fixtures.envs.dummy import DummyBoxEnv
from tests.fi... | [
"tensorflow.Graph",
"pickle.dumps",
"tensorflow.placeholder",
"numpy.array_equal",
"nose2.tools.params.params",
"tests.fixtures.envs.dummy.DummyBoxEnv",
"pickle.loads",
"numpy.full",
"garage.tf.policies.GaussianMLPPolicyWithModel",
"unittest.mock.patch"
] | [((426, 532), 'nose2.tools.params.params', 'params', (['((1,), (1,))', '((1,), (2,))', '((2,), (2,))', '((1, 1), (1, 1))', '((1, 1), (2, 2))', '((2, 2), (2, 2))'], {}), '(((1,), (1,)), ((1,), (2,)), ((2,), (2,)), ((1, 1), (1, 1)), ((1, 1),\n (2, 2)), ((2, 2), (2, 2)))\n', (432, 532), False, 'from nose2.tools.params ... |
from cinebot_mini import SERVERS
import requests
import numpy as np
import json
def base_url():
blender_dict = SERVERS["blender"]
url = "http://{}:{}".format(
blender_dict["host"], blender_dict["port"])
return url
def handshake():
url = base_url() + "/api/ping"
for i in range(5):
... | [
"numpy.array",
"json.dumps",
"requests.get",
"requests.delete"
] | [((2923, 2940), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (2935, 2940), False, 'import requests\n'), ((4368, 4385), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (4380, 4385), False, 'import requests\n'), ((4714, 4731), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (4726, 4731), ... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018 The Regents of the University of California
# 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 copy... | [
"m5.objects.SimpleIndirectPredictor",
"m5.simulate",
"m5.objects.LTAGE",
"argparse.ArgumentParser",
"m5.curTick",
"m5.objects.LocalBP",
"m5.objects.BiModeBP",
"m5.objects.Root",
"m5.objects.TournamentBP",
"m5.instantiate"
] | [((2439, 2464), 'm5.objects.SimpleIndirectPredictor', 'SimpleIndirectPredictor', ([], {}), '()\n', (2462, 2464), False, 'from m5.objects import SimpleIndirectPredictor, LocalBP, BiModeBP, TournamentBP, LTAGE, SimpleMemory\n'), ((5829, 5854), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (5852,... |
from celerybeatmongo.schedulers import MongoScheduler
from mist.api.sharding.mixins import ShardManagerMixin
from mist.api.poller.models import PollingSchedule
from mist.api.poller.models import OwnerPollingSchedule
from mist.api.poller.models import CloudPollingSchedule
from mist.api.poller.models import MachinePoll... | [
"datetime.timedelta"
] | [((441, 471), 'datetime.timedelta', 'datetime.timedelta', ([], {'seconds': '(20)'}), '(seconds=20)\n', (459, 471), False, 'import datetime\n'), ((574, 604), 'datetime.timedelta', 'datetime.timedelta', ([], {'seconds': '(20)'}), '(seconds=20)\n', (592, 604), False, 'import datetime\n'), ((707, 737), 'datetime.timedelta'... |
from collections import Counter
import json
from pathlib import Path
from PIL import Image
import numpy as np
import torch
import torch.utils.data as data
import torchvision.transforms as transforms
from bootstrap.lib.logger import Logger
from bootstrap.datasets import transforms as bootstrap_tf
try:... | [
"PIL.Image.open",
"pathlib.Path",
"torch.LongTensor",
"torchvision.transforms.Resize",
"torch.Tensor",
"bootstrap.datasets.transforms.StackTensors",
"torch.utils.data.RandomSampler",
"json.dumps",
"collections.Counter",
"bootstrap.datasets.transforms.ListDictsToDictLists",
"torchvision.transform... | [((12678, 12705), 'pathlib.Path', 'Path', (['"""/datasets_local/HDD"""'], {}), "('/datasets_local/HDD')\n", (12682, 12705), False, 'from pathlib import Path\n'), ((3636, 3811), 'torch.utils.data.DataLoader', 'data.DataLoader', ([], {'dataset': 'self', 'batch_size': 'batch_size', 'shuffle': 'shuffle', 'pin_memory': 'sel... |
# https://www.hackerrank.com/challenges/one-week-preparation-kit-jesse-and-cookies/problem
#!/bin/python3
import math
import os
import random
import re
import sys
import heapq
#
# Complete the 'cookies' function below.
#
# The function is expected to return an INTEGER.
# The function accepts following parameters:
# ... | [
"heapq.heappush",
"heapq.heappop",
"heapq.heapify"
] | [((387, 403), 'heapq.heapify', 'heapq.heapify', (['A'], {}), '(A)\n', (400, 403), False, 'import heapq\n'), ((432, 448), 'heapq.heappop', 'heapq.heappop', (['A'], {}), '(A)\n', (445, 448), False, 'import heapq\n'), ((521, 537), 'heapq.heappop', 'heapq.heappop', (['A'], {}), '(A)\n', (534, 537), False, 'import heapq\n')... |
import bpy
import glob
from bpy.types import Panel, Operator
from bpy.app.handlers import persistent
import os
import threading
from queue import Queue
from pathlib import Path
from . mix_ops import *
from . matgan_ops import *
from . neural_ops import *
cache_path = os.path.join(Path(__file__).parent.resolve(), '.ca... | [
"bpy.app.handlers.save_pre.append",
"bpy.data.libraries.load",
"os.fsencode",
"bpy.app.handlers.load_post.append",
"os.fsdecode",
"bpy.data.images.load",
"os.walk",
"os.path.exists",
"pathlib.Path",
"os.path.split",
"os.path.isdir",
"bpy.app.handlers.save_pre.remove",
"bpy.app.handlers.load_... | [((4321, 4351), 'os.path.join', 'os.path.join', (['cache_path', 'name'], {}), '(cache_path, name)\n', (4333, 4351), False, 'import os\n'), ((4426, 4449), 'os.path.isdir', 'os.path.isdir', (['src_path'], {}), '(src_path)\n', (4439, 4449), False, 'import os\n'), ((4986, 5650), 'bpy.props.EnumProperty', 'bpy.props.EnumPro... |
import re
def part1(lines, yourbag="shiny gold"):
# A nice little regex that will extract a list of all bags in a given line.
# The first is the outermost bag, and the rest are inner bags.
pattern = re.compile(r"(?:\d*)\s*(.*?)\s*bags?[.,]?(?: contain)?\s*")
# We're going to use an adjacency list map... | [
"re.compile"
] | [((213, 275), 're.compile', 're.compile', (['"""(?:\\\\d*)\\\\s*(.*?)\\\\s*bags?[.,]?(?: contain)?\\\\s*"""'], {}), "('(?:\\\\d*)\\\\s*(.*?)\\\\s*bags?[.,]?(?: contain)?\\\\s*')\n", (223, 275), False, 'import re\n'), ((1866, 1926), 're.compile', 're.compile', (['"""(\\\\d*)\\\\s*(.*?)\\\\s*bags?[.,]?(?: contain)?\\\\s*... |
from backbone import entry_point
if __name__ == '__main__':
entry_point.main()
| [
"backbone.entry_point.main"
] | [((65, 83), 'backbone.entry_point.main', 'entry_point.main', ([], {}), '()\n', (81, 83), False, 'from backbone import entry_point\n')] |
import scrapy,json,re,time,os,glob
from scrapy.exceptions import CloseSpider
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutE... | [
"scrapy.exceptions.CloseSpider",
"selenium.webdriver.chrome.options.Options",
"selenium.webdriver.support.ui.WebDriverWait",
"selenium.webdriver.Chrome",
"json.dump",
"selenium.webdriver.support.expected_conditions.element_to_be_clickable",
"os.getcwd",
"os.chdir",
"scrapy.Request",
"json.load",
... | [((486, 498), 'json.load', 'json.load', (['f'], {}), '(f)\n', (495, 498), False, 'import scrapy, json, re, time, os, glob\n'), ((1839, 1850), 'time.time', 'time.time', ([], {}), '()\n', (1848, 1850), False, 'import scrapy, json, re, time, os, glob\n'), ((2092, 2103), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (2101, 2... |
from django.contrib import admin
from notifications.models import Notification
@admin.register(Notification)
class NotificationAdmin(admin.ModelAdmin):
list_display = (
'sender',
'recipient',
'creation_time',
'verb',
'unread',
)
list_filter = (
'sender',
... | [
"django.contrib.admin.register"
] | [((83, 111), 'django.contrib.admin.register', 'admin.register', (['Notification'], {}), '(Notification)\n', (97, 111), False, 'from django.contrib import admin\n')] |
# --------------
# import the libraries
import numpy as np
import pandas as pd
import seaborn as sns
from sklearn.model_selection import train_test_split
import warnings
warnings.filterwarnings('ignore')
# Code starts here
df=pd.read_csv(path)
print(df.head())
X=df.drop(columns='insuranceclaim')
y=df['insuranceclaim']... | [
"matplotlib.pyplot.boxplot",
"sklearn.model_selection.GridSearchCV",
"sklearn.metrics.accuracy_score",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.linear_model.LogisticRegression",
"sklearn.metrics.roc_auc_score",
"sklearn.metrics.roc_curve",
"matplotlib.pyplot.subplots",... | [((170, 203), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (193, 203), False, 'import warnings\n'), ((227, 244), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (238, 244), True, 'import pandas as pd\n'), ((351, 404), 'sklearn.model_selection.train_test_spl... |
"""Convert a Caffe model file to TensorFlow checkpoint format.
Assume that the network built is a equivalent (or a sub-) to the Caffe
definition.
"""
import tensorflow as tf
from nets import caffe_scope
from nets import nets_factory
slim = tf.contrib.slim
# ==========================================================... | [
"tensorflow.Graph",
"nets.nets_factory.get_network",
"tensorflow.placeholder",
"tensorflow.Session",
"tensorflow.logging.set_verbosity",
"tensorflow.train.Saver",
"tensorflow.app.flags.DEFINE_string",
"tensorflow.global_variables_initializer",
"nets.caffe_scope.CaffeScope",
"tensorflow.app.run"
] | [((434, 526), 'tensorflow.app.flags.DEFINE_string', 'tf.app.flags.DEFINE_string', (['"""model_name"""', '"""ssd_300_vgg"""', '"""Name of the model to convert."""'], {}), "('model_name', 'ssd_300_vgg',\n 'Name of the model to convert.')\n", (460, 526), True, 'import tensorflow as tf\n'), ((528, 614), 'tensorflow.app.... |
import tensorflow as tf
from detection.utils.misc import *
class PyramidROIAlign(tf.keras.layers.Layer):
def __init__(self, pool_shape, **kwargs):
'''
Implements ROI Pooling on multiple levels of the feature pyramid.
Attributes
---
pool_shape: (height, width) of the o... | [
"tensorflow.round",
"tensorflow.equal",
"tensorflow.shape",
"tensorflow.math.log",
"tensorflow.split",
"tensorflow.concat",
"tensorflow.stop_gradient",
"tensorflow.gather",
"tensorflow.image.crop_and_resize",
"tensorflow.sqrt",
"tensorflow.cast",
"tensorflow.gather_nd",
"tensorflow.squeeze"
... | [((1880, 1908), 'tensorflow.concat', 'tf.concat', (['rois_list'], {'axis': '(0)'}), '(rois_list, axis=0)\n', (1889, 1908), True, 'import tensorflow as tf\n'), ((2030, 2055), 'tensorflow.split', 'tf.split', (['rois', '(4)'], {'axis': '(1)'}), '(rois, 4, axis=1)\n', (2038, 2055), True, 'import tensorflow as tf\n'), ((442... |
""" find the Schwarzschild radius of the Sun in m using pint"""
import pint
class Sun:
""" Class to describe a star based on its mass in terms of solar masses """
def __init__(self, mass):
self.ureg = pint.UnitRegistry()
self.ureg.define("Msolar = 1.98855*10**30 * kilogram")
self.mass ... | [
"pint.UnitRegistry"
] | [((219, 238), 'pint.UnitRegistry', 'pint.UnitRegistry', ([], {}), '()\n', (236, 238), False, 'import pint\n')] |
from dsa.parsing.line_parsing import line_parser
from dsa.parsing.token_parsing import make_parser
_parser = line_parser(
'Huffman table entry',
make_parser(
'Huffman table entry data',
('integer', 'encoded bit sequence'),
('hexdump', 'decoded bytes')
)
)
class Huff... | [
"dsa.parsing.token_parsing.make_parser"
] | [((161, 271), 'dsa.parsing.token_parsing.make_parser', 'make_parser', (['"""Huffman table entry data"""', "('integer', 'encoded bit sequence')", "('hexdump', 'decoded bytes')"], {}), "('Huffman table entry data', ('integer', 'encoded bit sequence'),\n ('hexdump', 'decoded bytes'))\n", (172, 271), False, 'from dsa.pa... |
import argparse
import os.path as osp
from glob import glob
import cv2
import pandas as pd
from tqdm import tqdm
from gwd.converters import kaggle2coco
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--image-pattern", default="/data/SPIKE_images/*jpg")
parser.add_argument("--an... | [
"argparse.ArgumentParser",
"pandas.read_csv",
"tqdm.tqdm",
"os.path.basename",
"gwd.converters.kaggle2coco.main",
"pandas.concat",
"glob.glob",
"cv2.imread"
] | [((187, 212), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (210, 212), False, 'import argparse\n'), ((610, 634), 'glob.glob', 'glob', (['args.image_pattern'], {}), '(args.image_pattern)\n', (614, 634), False, 'from glob import glob\n'), ((676, 691), 'tqdm.tqdm', 'tqdm', (['img_paths'], {}), '... |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Tests the shell console
:author: <NAME>
"""
# Pelix
from pelix.utilities import to_str, to_bytes
# Standard library
import random
import string
import sys
import threading
import time
# Tests
try:
import unittest2 as unittest
except ImportError:
impo... | [
"random.shuffle",
"subprocess.Popen",
"threading.Timer",
"time.sleep",
"pelix.utilities.to_bytes",
"time.time"
] | [((1121, 1141), 'random.shuffle', 'random.shuffle', (['data'], {}), '(data)\n', (1135, 1141), False, 'import random\n'), ((1487, 1620), 'subprocess.Popen', 'subprocess.Popen', (["[sys.executable, '-m', 'pelix.shell']"], {'stdin': 'subprocess.PIPE', 'stdout': 'subprocess.PIPE', 'stderr': 'subprocess.STDOUT'}), "([sys.ex... |
"""
PEP 0484 ( https://www.python.org/dev/peps/pep-0484/ ) describes type hints
through function annotations. There is a strong suggestion in this document
that only the type of type hinting defined in PEP0484 should be allowed
as annotations in future python versions.
"""
import re
from parso import ParserSyntaxErro... | [
"jedi.evaluate.cache.evaluator_method_cache",
"jedi.debug.warning",
"jedi.evaluate.base_context.ContextSet",
"jedi.parser_utils.move",
"re.match",
"jedi._compatibility.force_unicode",
"jedi.evaluate.compiled.builtin_from_name",
"parso.parse",
"jedi.evaluate.gradual.typing.GenericClass",
"jedi.eval... | [((3310, 3334), 'jedi.evaluate.cache.evaluator_method_cache', 'evaluator_method_cache', ([], {}), '()\n', (3332, 3334), False, 'from jedi.evaluate.cache import evaluator_method_cache\n'), ((6407, 6431), 'jedi.evaluate.cache.evaluator_method_cache', 'evaluator_method_cache', ([], {}), '()\n', (6429, 6431), False, 'from ... |
# Copyright (c) OpenMMLab. All rights reserved.
import tempfile
from mmocr.utils import list_from_file, list_to_file
lists = [
[],
[' '],
['\t'],
['a'],
[1],
[1.],
['a', 'b'],
['a', 1, 1.],
[1, 1., 'a'],
['啊', '啊啊'],
['選択', 'noël', 'Информацией', 'ÄÆä'],
]
def test_list_t... | [
"tempfile.TemporaryDirectory",
"mmocr.utils.list_from_file",
"mmocr.utils.list_to_file"
] | [((339, 368), 'tempfile.TemporaryDirectory', 'tempfile.TemporaryDirectory', ([], {}), '()\n', (366, 368), False, 'import tempfile\n'), ((869, 898), 'tempfile.TemporaryDirectory', 'tempfile.TemporaryDirectory', ([], {}), '()\n', (896, 898), False, 'import tempfile\n'), ((485, 514), 'mmocr.utils.list_to_file', 'list_to_f... |
import cv2
from Text_Detection import detect_characters, detect_string, detect_words
import re
from live_recognition import facial_recognition
#
def rescale_frame(frame, percent=75):
width = int(frame.shape[1] * percent/ 100)
height = int(frame.shape[0] * percent/ 100)
dim = (width, height)
ret... | [
"cv2.rectangle",
"cv2.moveWindow",
"cv2.imshow",
"Text_Detection.detect_words",
"cv2.putText",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"cv2.cvtColor",
"live_recognition.facial_recognition",
"cv2.CascadeClassifier",
"cv2.resize",
"cv2.waitKey"
] | [((488, 565), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['"""../../Resources/haarcascade_russian_plate_number.xml"""'], {}), "('../../Resources/haarcascade_russian_plate_number.xml')\n", (509, 565), False, 'import cv2\n'), ((1123, 1157), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)', 'cv2.CAP_DSHOW'], {}), '... |
##! python3
##==============================================================================
## Copyright (c) 2021 COMPAL Electronic Inc. All rights reserved.
## This program contains proprietary and confidential information.
## All rights reserved except as may be permitted by prior written consent.
##
## ... | [
"time.localtime",
"os.listdir",
"configparser.ConfigParser",
"openpyxl.utils.dataframe.dataframe_to_rows",
"os.path.join",
"openpyxl.styles.Font",
"os.getcwd",
"re.fullmatch",
"openpyxl.Workbook",
"os.path.basename",
"sys.exit",
"pandas.DataFrame",
"openpyxl.formatting.rule.CellIsRule",
"c... | [((16446, 16495), 'codecs.open', 'codecs.open', (["(g_strFileName + '.log')", '"""a"""', '"""utf-8"""'], {}), "(g_strFileName + '.log', 'a', 'utf-8')\n", (16457, 16495), False, 'import codecs\n'), ((1950, 1973), 'os.listdir', 'os.listdir', (['g_strLogDir'], {}), '(g_strLogDir)\n', (1960, 1973), False, 'import os\n'), (... |
from wagtail.admin.edit_handlers import (
InlinePanel, HelpPanel, FieldPanel, FieldRowPanel, MultiFieldPanel,
PageChooserPanel,
)
from wagtail.documents.edit_handlers import DocumentChooserPanel
from wagtail.images.edit_handlers import ImageChooserPanel
from core.helpers import make_translated_interface
from c... | [
"wagtail.images.edit_handlers.ImageChooserPanel",
"wagtail.admin.edit_handlers.PageChooserPanel",
"wagtail.documents.edit_handlers.DocumentChooserPanel",
"core.helpers.make_translated_interface",
"core.panels.SearchEngineOptimisationPanel",
"wagtail.admin.edit_handlers.FieldPanel",
"wagtail.admin.edit_h... | [((5735, 5829), 'core.helpers.make_translated_interface', 'make_translated_interface', ([], {'content_panels': 'content_panels', 'settings_panels': 'settings_panels'}), '(content_panels=content_panels, settings_panels=\n settings_panels)\n', (5760, 5829), False, 'from core.helpers import make_translated_interface\n'... |
from floodsystem.geo import stations_within_radius
from floodsystem.stationdata import build_station_list
def run():
"""Requirements for Task 1C"""
# Build list of stations
stations = build_station_list()
# Store the coordinates of Cambridge City Centre
CambCoord = (52.2053, 0.1218)
#store the... | [
"floodsystem.stationdata.build_station_list",
"floodsystem.geo.stations_within_radius"
] | [((198, 218), 'floodsystem.stationdata.build_station_list', 'build_station_list', ([], {}), '()\n', (216, 218), False, 'from floodsystem.stationdata import build_station_list\n'), ((375, 426), 'floodsystem.geo.stations_within_radius', 'stations_within_radius', (['stations', 'CambCoord', 'radius'], {}), '(stations, Camb... |
from model.objects import Objects
import time
class ProjectHelper:
def __init__(self, app):
self.app = app
project_cache = None
def get_project_list(self):
if self.project_cache is None:
wd = self.app.wd
self.open_manage_project_page()
self.project_ca... | [
"model.objects.Objects",
"time.sleep"
] | [((1173, 1186), 'time.sleep', 'time.sleep', (['(4)'], {}), '(4)\n', (1183, 1186), False, 'import time\n'), ((609, 654), 'model.objects.Objects', 'Objects', ([], {'pname': 'pname', 'description': 'description'}), '(pname=pname, description=description)\n', (616, 654), False, 'from model.objects import Objects\n')] |
# Generated by Django 3.1.1 on 2020-09-09 12:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("carbon_quiz", "0009_auto_20200908_2201"),
]
operations = [
migrations.RemoveField(
model_name="mission",
name="descr... | [
"django.db.migrations.RemoveField",
"django.db.models.CharField",
"django.db.models.IntegerField"
] | [((239, 303), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""mission"""', 'name': '"""description"""'}), "(model_name='mission', name='description')\n", (261, 303), False, 'from django.db import migrations, models\n'), ((348, 407), 'django.db.migrations.RemoveField', 'migrations.R... |
import json
from ..webstack import run as webstack_run
def process(json_file_list):
for json_filename in json_file_list:
with open(json_filename) as json_file:
json_data = json.load(json_file)
webstack_data = json_data.get('webstack', None)
if webstack_data:
... | [
"json.load"
] | [((197, 217), 'json.load', 'json.load', (['json_file'], {}), '(json_file)\n', (206, 217), False, 'import json\n')] |
import trio
import os
import json
from itertools import count
# Experiment with generating Chrome Event Trace format, which can be browsed
# through chrome://tracing or other mechanisms.
#
# Screenshot: https://files.gitter.im/python-trio/general/fp6w/image.png
#
# Trace format docs: https://docs.google.com/document/d... | [
"trio.current_time",
"trio.run",
"trio.sleep",
"json.dumps",
"trio.open_nursery",
"trio.lowlevel.current_task",
"itertools.count",
"os.getpid"
] | [((4310, 4343), 'trio.run', 'trio.run', (['parent'], {'instruments': '[t]'}), '(parent, instruments=[t])\n', (4318, 4343), False, 'import trio\n'), ((1591, 1598), 'itertools.count', 'count', ([], {}), '()\n', (1596, 1598), False, 'from itertools import count\n'), ((3707, 3720), 'trio.sleep', 'trio.sleep', (['(1)'], {})... |
from zeep import Client
from models import RequestParameter
class Caller:
def __init__(self):
wsdl_url = "http://0.0.0.0:8080/?wsdl"
self._name = "dummy_name"
self._times = 3
self._client = Client(wsdl_url)
def call_say_hello_1(self):
result = self._client.service.say... | [
"models.RequestParameter",
"zeep.Client"
] | [((229, 245), 'zeep.Client', 'Client', (['wsdl_url'], {}), '(wsdl_url)\n', (235, 245), False, 'from zeep import Client\n'), ((667, 719), 'models.RequestParameter', 'RequestParameter', ([], {'name': 'self._name', 'times': 'self._times'}), '(name=self._name, times=self._times)\n', (683, 719), False, 'from models import R... |
# coding: utf-8
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | [
"oci.util.formatted_flat_dict"
] | [((6895, 6920), 'oci.util.formatted_flat_dict', 'formatted_flat_dict', (['self'], {}), '(self)\n', (6914, 6920), False, 'from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel\n')] |
import balanced
balanced.configure('ak-test-1o9QKwUCrwstHW<KEY>')
order = balanced.Order.fetch('/orders/OR7qAh5x1cFzX0U9hD628LPa') | [
"balanced.configure",
"balanced.Order.fetch"
] | [((17, 66), 'balanced.configure', 'balanced.configure', (['"""ak-test-1o9QKwUCrwstHW<KEY>"""'], {}), "('ak-test-1o9QKwUCrwstHW<KEY>')\n", (35, 66), False, 'import balanced\n'), ((76, 132), 'balanced.Order.fetch', 'balanced.Order.fetch', (['"""/orders/OR7qAh5x1cFzX0U9hD628LPa"""'], {}), "('/orders/OR7qAh5x1cFzX0U9hD628L... |
from __future__ import print_function
import tensorflow as tf
import numpy as np
from collections import namedtuple, OrderedDict
from subprocess import call
import scipy.io.wavfile as wavfile
import argparse
import codecs
import timeit
import struct
import toml
import re
import sys
import os
def _int64_feature(value)... | [
"os.path.exists",
"os.listdir",
"argparse.ArgumentParser",
"os.makedirs",
"timeit.default_timer",
"os.path.join",
"os.path.splitext",
"tensorflow.train.Int64List",
"os.path.split",
"tensorflow.train.BytesList",
"numpy.array",
"scipy.io.wavfile.read",
"os.unlink",
"tensorflow.python_io.TFRe... | [((1126, 1158), 'numpy.array', 'np.array', (['slices'], {'dtype': 'np.int32'}), '(slices, dtype=np.int32)\n', (1134, 1158), True, 'import numpy as np\n'), ((1238, 1260), 'scipy.io.wavfile.read', 'wavfile.read', (['filename'], {}), '(filename)\n', (1250, 1260), True, 'import scipy.io.wavfile as wavfile\n'), ((1660, 1687... |
import xNormal
xNormal.run("piano_high.obj", "piano_low.obj", "piano.png", width=256, height=256, gen_normals = True, gen_ao = True) | [
"xNormal.run"
] | [((15, 132), 'xNormal.run', 'xNormal.run', (['"""piano_high.obj"""', '"""piano_low.obj"""', '"""piano.png"""'], {'width': '(256)', 'height': '(256)', 'gen_normals': '(True)', 'gen_ao': '(True)'}), "('piano_high.obj', 'piano_low.obj', 'piano.png', width=256,\n height=256, gen_normals=True, gen_ao=True)\n", (26, 132),... |
from copy import deepcopy
from typing import Tuple
import jax.numpy as jnp
from jax.scipy.linalg import cho_factor, cho_solve
from multipledispatch import dispatch
from .types import Array
def I(n: int) -> Array:
"""
Compute an n x n identity matrix.
:param n: The size of of the matrix.
:return: An ... | [
"jax.numpy.eye",
"jax.numpy.std",
"multipledispatch.dispatch",
"copy.deepcopy",
"jax.numpy.mean"
] | [((1704, 1729), 'multipledispatch.dispatch', 'dispatch', (['jnp.DeviceArray'], {}), '(jnp.DeviceArray)\n', (1712, 1729), False, 'from multipledispatch import dispatch\n'), ((2222, 2281), 'multipledispatch.dispatch', 'dispatch', (['jnp.DeviceArray', 'jnp.DeviceArray', 'jnp.DeviceArray'], {}), '(jnp.DeviceArray, jnp.Devi... |
import os
def replace_version(old_version, new_version):
if not isinstance(old_version, tuple) or not isinstance(new_version, tuple):
raise ValueError("`old_version` and `new_version` must be a version tuple. Eg: (1.2.3)")
major, minor, micro = old_version[:3]
old_version = f'{major}.{minor}.{mic... | [
"os.path.join",
"os.walk"
] | [((481, 499), 'os.walk', 'os.walk', (['"""../caer"""'], {}), "('../caer')\n", (488, 499), False, 'import os\n'), ((637, 661), 'os.path.join', 'os.path.join', (['root', 'file'], {}), '(root, file)\n', (649, 661), False, 'import os\n'), ((818, 842), 'os.path.join', 'os.path.join', (['root', 'file'], {}), '(root, file)\n'... |
import argparse
import math
import matplotlib.pyplot as plt
import os
import numpy as np
import shutil
import pandas as pd
import seaborn as sns
sns.set()
sns.set_context("talk")
NUM_BINS = 100
path = '../Data/Video_Info/Pensieve_Info/PenieveVideo_video_info'
video_mappings = {}
video_mappings['300'] = '320x180x30_v... | [
"numpy.mean",
"seaborn.set",
"os.path.exists",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"argparse.ArgumentParser",
"os.makedirs",
"matplotlib.pyplot.xlabel",
"seaborn.set_context",
"os.path.join",
"os.path.getmtime",
"os.path.dirname",
"matplotlib.pyplot.figure",
"shutil.rmtree",
"... | [((146, 155), 'seaborn.set', 'sns.set', ([], {}), '()\n', (153, 155), True, 'import seaborn as sns\n'), ((156, 179), 'seaborn.set_context', 'sns.set_context', (['"""talk"""'], {}), "('talk')\n", (171, 179), True, 'import seaborn as sns\n'), ((798, 815), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (809... |