code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import os
import signal
from os.path import join
from sys import argv
from utils.csv_table import CsvTable
from utils.fasta_map import FastaMap
from utils.hierarchy_tree import HierarchyTree
signal.signal(signal.SIGTSTP, signal.SIG_IGN)
def main():
data_dir = argv[1]
csv_path = join(data_dir, "sequences.cs... | [
"utils.csv_table.CsvTable",
"signal.signal",
"os.kill",
"os.path.join",
"utils.fasta_map.FastaMap",
"utils.hierarchy_tree.HierarchyTree",
"os.wait",
"os.fork"
] | [((194, 239), 'signal.signal', 'signal.signal', (['signal.SIGTSTP', 'signal.SIG_IGN'], {}), '(signal.SIGTSTP, signal.SIG_IGN)\n', (207, 239), False, 'import signal\n'), ((292, 323), 'os.path.join', 'join', (['data_dir', '"""sequences.csv"""'], {}), "(data_dir, 'sequences.csv')\n", (296, 323), False, 'from os.path impor... |
import unittest
import k3ut
import k3handy
dd = k3ut.dd
class TestHandyCmd(unittest.TestCase):
def test_parse_flag(self):
cases = [
('', ()),
('x', ('raise', )),
('t', ('tty',)),
('n', ('none',)),
('p', ('pass',)),
('o', ('stdout',... | [
"k3handy.cmdf",
"k3handy.parse_flag",
"k3handy.cmdtty",
"k3handy.cmd0",
"k3handy.cmdout",
"k3handy.cmdx"
] | [((2897, 2969), 'k3handy.cmdtty', 'k3handy.cmdtty', (['"""python"""', '"""-c"""', '"""import sys; print(sys.stdout.isatty())"""'], {}), "('python', '-c', 'import sys; print(sys.stdout.isatty())')\n", (2911, 2969), False, 'import k3handy\n'), ((3251, 3315), 'k3handy.cmdx', 'k3handy.cmdx', (['"""python"""', '"""-c"""', '... |
import os
import numpy as np
import random
import numbers
import skimage
from skimage import io, color
import torch
# read uint8 image from path
def imread_uint8(imgpath, mode='RGB'):
'''
mode: 'RGB', 'gray', 'Y', 'L'.
'Y' and 'L' mean the Y channel of YCbCr.
'''
if mode == 'RGB':
img = io.... | [
"os.path.exists",
"os.makedirs",
"skimage.color.rgb2ycbcr",
"numpy.fliplr",
"skimage.img_as_float32",
"skimage.io.imread",
"numpy.rot90",
"skimage.img_as_ubyte",
"random.randint"
] | [((1733, 1758), 'random.randint', 'random.randint', (['(0)', '(h - ph)'], {}), '(0, h - ph)\n', (1747, 1758), False, 'import random\n'), ((1771, 1796), 'random.randint', 'random.randint', (['(0)', '(w - pw)'], {}), '(0, w - pw)\n', (1785, 1796), False, 'import random\n'), ((1988, 2015), 'skimage.img_as_float32', 'skima... |
# Generated by Django 3.2.9 on 2021-12-28 03:10
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Book',
fields=[
... | [
"django.db.models.IntegerField",
"django.db.models.ForeignKey",
"django.db.models.BigAutoField",
"django.db.models.DateTimeField",
"django.db.models.DecimalField",
"django.db.models.CharField"
] | [((333, 429), 'django.db.models.BigAutoField', 'models.BigAutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (352, 429), False, 'from django.db import migrations, m... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Routines related to the canonical Chandra ACA dark current model.
The model is based on smoothed twice-broken power-law fits of
dark current histograms from Jan-2007 though Aug-2017. This analysis
was done entirely with dark current maps scaled to -1... | [
"Chandra.Time.DateTime",
"numpy.convolve",
"numpy.random.poisson",
"numpy.searchsorted",
"numpy.flatnonzero",
"numpy.log",
"numpy.exp",
"numpy.sum",
"numpy.array",
"warnings.warn",
"mica.archive.aca_dark.get_dark_cal_image",
"numpy.arange",
"numpy.random.shuffle"
] | [((1034, 1087), 'numpy.arange', 'np.arange', (['(-2.5 * sigma)', '(2.5 * sigma)', 'dx'], {'dtype': 'float'}), '(-2.5 * sigma, 2.5 * sigma, dx, dtype=float)\n', (1043, 1087), True, 'import numpy as np\n'), ((1093, 1125), 'numpy.exp', 'np.exp', (['(-0.5 * (xg / sigma) ** 2)'], {}), '(-0.5 * (xg / sigma) ** 2)\n', (1099, ... |
import unittest
import ipaddress
from net_models.models import (
StaticRouteV4,
StaticRouteV6
)
from tests.BaseTestClass import TestVendorIndependentBase
class TestStaticRouteV4(TestVendorIndependentBase):
TEST_CLASS = StaticRouteV4
def test_valid_routes(self):
test_cases = [
{
... | [
"unittest.main",
"ipaddress.IPv4Network",
"ipaddress.IPv4Address"
] | [((2417, 2432), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2430, 2432), False, 'import unittest\n'), ((557, 591), 'ipaddress.IPv4Network', 'ipaddress.IPv4Network', (['"""0.0.0.0/0"""'], {}), "('0.0.0.0/0')\n", (578, 591), False, 'import ipaddress\n'), ((625, 657), 'ipaddress.IPv4Address', 'ipaddress.IPv4Addre... |
"""
This library provides a set of tools that can be used in chemometrics analysis.
These tools are:
- some pre-processing methods that can be applyed in the spectra.
- an function that make average of spectra in the case of there are more than one spectra by sample (e.g. triplicate or duplicate aquisitions)
"""
DOCL... | [
"setuptools.find_packages"
] | [((655, 681), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (679, 681), False, 'import setuptools\n')] |
"""Collection of DVC options
Based on ZnTrackOption python descriptors this gives access to them being used
to define e.g. dependencies
Examples
--------
>>> from zntrack import Node, dvc
>>> class HelloWorld(Node)
>>> vars = dvc.params()
"""
import logging
from zntrack import utils
from zntrack.core.zntrackopti... | [
"logging.getLogger",
"zntrack.utils.utils.load_node_dependency"
] | [((405, 432), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (422, 432), False, 'import logging\n'), ((1263, 1320), 'zntrack.utils.utils.load_node_dependency', 'utils.utils.load_node_dependency', (['value'], {'log_warning': '(True)'}), '(value, log_warning=True)\n', (1295, 1320), False, '... |
# coding: utf-8
"""Common Groups operations."""
from os.path import abspath, join as pjoin
import logging
import json
from commongroups.cmgroup import CMGroup
from commongroups.errors import MissingParamError, NoCredentialsError
from commongroups.googlesheet import SheetManager
from commongroups.hypertext import dir... | [
"logging.getLogger",
"commongroups.cmgroup.CMGroup",
"os.path.join",
"commongroups.errors.MissingParamError",
"commongroups.hypertext.directory",
"json.load",
"commongroups.googlesheet.SheetManager",
"os.path.abspath",
"json.dump"
] | [((402, 429), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (419, 429), False, 'import logging\n'), ((2413, 2426), 'os.path.abspath', 'abspath', (['path'], {}), '(path)\n', (2420, 2426), False, 'from os.path import abspath, join as pjoin\n'), ((3398, 3431), 'os.path.join', 'pjoin', (['en... |
# -*- coding: utf-8 -*-
# Copyright 2018 <NAME> All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | [
"unittest.main",
"pyotp.TOTP",
"merlink.browsers.dashboard.DashboardBrowser"
] | [((8352, 8367), 'unittest.main', 'unittest.main', ([], {}), '()\n', (8365, 8367), False, 'import unittest\n'), ((1951, 1969), 'merlink.browsers.dashboard.DashboardBrowser', 'DashboardBrowser', ([], {}), '()\n', (1967, 1969), False, 'from merlink.browsers.dashboard import DashboardBrowser\n'), ((2569, 2599), 'pyotp.TOTP... |
"""
mixcoatl.admin.user
-------------------
Implements access to the DCM User API
"""
from mixcoatl.resource import Resource
from mixcoatl.decorators.lazy import lazy_property
from mixcoatl.decorators.validations import required_attrs
from mixcoatl.utils import camelize, camel_keys, uncamel_keys
import json
import tim... | [
"mixcoatl.utils.uncamel_keys",
"mixcoatl.utils.camelize",
"json.dumps",
"mixcoatl.decorators.validations.required_attrs",
"mixcoatl.utils.camel_keys",
"mixcoatl.resource.Resource",
"mixcoatl.resource.Resource.__init__"
] | [((5697, 5724), 'mixcoatl.decorators.validations.required_attrs', 'required_attrs', (["['user_id']"], {}), "(['user_id'])\n", (5711, 5724), False, 'from mixcoatl.decorators.validations import required_attrs\n'), ((6762, 6858), 'mixcoatl.decorators.validations.required_attrs', 'required_attrs', (["['account', 'given_nam... |
from ldap3 import Server, Connection, ALL, NTLM, ALL_ATTRIBUTES, ALL_OPERATIONAL_ATTRIBUTES
class Simple_AD:
"""
A simple wrapper for ldap3 in an Active Directory Environment.
Examples:
0. Initilaize a connection
sad = Simple_AD(server_name="server1.mydomain.com", username="mydomain.com\... | [
"ldap3.Connection",
"ldap3.Server"
] | [((1692, 1742), 'ldap3.Server', 'Server', (['server_name'], {'use_ssl': 'use_ssl', 'get_info': 'ALL'}), '(server_name, use_ssl=use_ssl, get_info=ALL)\n', (1698, 1742), False, 'from ldap3 import Server, Connection, ALL, NTLM, ALL_ATTRIBUTES, ALL_OPERATIONAL_ATTRIBUTES\n'), ((1763, 1861), 'ldap3.Connection', 'Connection'... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | [
"django.db.models.TextField",
"django.db.models.IntegerField",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((2048, 2095), 'django.db.models.TextField', 'models.TextField', ([], {'default': '""""""', 'verbose_name': '"""草稿"""'}), "(default='', verbose_name='草稿')\n", (2064, 2095), False, 'from django.db import migrations, models\n'), ((2221, 2287), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'blank': '(Tr... |
# <NAME> 2014-2020
# mlxtend Machine Learning Library Extensions
# Author: <NAME> <<EMAIL>>
#
# License: BSD 3 clause
import random
import numpy as np
import pytest
from sklearn import exceptions
from sklearn.base import clone
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import Logist... | [
"mlxtend.data.iris_data",
"sklearn.model_selection.GridSearchCV",
"numpy.abs",
"numpy.testing.assert_equal",
"sklearn.base.clone",
"sklearn.neighbors.KNeighborsClassifier",
"sklearn.ensemble.RandomForestClassifier",
"random.seed",
"sklearn.linear_model.LogisticRegression",
"mlxtend.classifier.Ense... | [((631, 642), 'mlxtend.data.iris_data', 'iris_data', ([], {}), '()\n', (640, 642), False, 'from mlxtend.data import iris_data\n'), ((699, 718), 'numpy.random.seed', 'np.random.seed', (['(123)'], {}), '(123)\n', (713, 718), True, 'import numpy as np\n'), ((730, 787), 'sklearn.linear_model.LogisticRegression', 'LogisticR... |
from django import shortcuts
from django.db import models
# Create your models here.
class Link(models.Model):
url = models.CharField(max_length=1000)
shortUrl = models.CharField(max_length=20)
def __str__(self):
return self.shortUrl | [
"django.db.models.CharField"
] | [((123, 156), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(1000)'}), '(max_length=1000)\n', (139, 156), False, 'from django.db import models\n'), ((172, 203), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(20)'}), '(max_length=20)\n', (188, 203), False, 'from django.d... |
import re
from django.shortcuts import render
from django.utils.http import urlunquote, urlquote
from django.contrib import messages
from sequenceSearch.tasks import blast
from django.http import Http404
from model_utils.managers import InheritanceManager
from django.core.cache import cache
from pks.models import AT, K... | [
"django.shortcuts.render",
"sequenceSearch.tasks.blast.delay",
"django.utils.http.urlunquote",
"django.contrib.messages.error",
"os.path.join",
"django.contrib.messages.success",
"itertools.chain.from_iterable",
"pks.models.Subunit.objects.get",
"re.sub",
"re.findall",
"pks.models.Domain.objects... | [((7502, 7549), 'django.shortcuts.render', 'render', (['request', '"""sequenceresult.html"""', 'context'], {}), "(request, 'sequenceresult.html', context)\n", (7508, 7549), False, 'from django.shortcuts import render\n'), ((1404, 1451), 'django.shortcuts.render', 'render', (['request', '"""sequencesearch.html"""', 'con... |
import dash_core_components as dcc
import dash_html_components as html
def navbar(*args, **kwargs):
"""
"""
return html.Div(children=[
html.Div(children=[
dcc.Link(href="/", children=[
html.I(className="fab fa-earlybirds mr-3"),
html.Span(children='Tan... | [
"dash_html_components.Hr",
"dash_html_components.Nav",
"dash_html_components.Section",
"dash_html_components.I",
"dash_core_components.Link",
"dash_html_components.Span",
"dash_html_components.H2",
"dash_html_components.H1",
"dash_core_components.Input",
"dash_html_components.P"
] | [((1408, 1568), 'dash_core_components.Link', 'dcc.Link', ([], {'className': '"""flex items-center py-2 px-6 text-gray-500 hover:bg-gray-700 hover:bg-opacity-25 hover:text-gray-100"""', 'children': 'children'}), "(className=\n 'flex items-center py-2 px-6 text-gray-500 hover:bg-gray-700 hover:bg-opacity-25 hover:text... |
# Generated by Django 2.1.1 on 2018-10-04 12:35
import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL)... | [
"datetime.datetime",
"django.db.models.ForeignKey",
"django.db.models.FileField",
"django.db.models.AutoField",
"django.db.migrations.swappable_dependency",
"django.db.models.CharField"
] | [((263, 320), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (294, 320), False, 'from django.db import migrations, models\n'), ((450, 543), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)... |
from unittest import TestCase
from yawast.scanner.plugins.dns.caa import _get_cname
from dns import resolver
class TestGetCname(TestCase):
def test__get_cname(self):
resv = resolver.Resolver()
resv.nameservers = ["1.1.1.1", "8.8.8.8"]
name = _get_cname("cntest.adamcaudill.com", resv)
... | [
"yawast.scanner.plugins.dns.caa._get_cname",
"dns.resolver.Resolver"
] | [((187, 206), 'dns.resolver.Resolver', 'resolver.Resolver', ([], {}), '()\n', (204, 206), False, 'from dns import resolver\n'), ((273, 315), 'yawast.scanner.plugins.dns.caa._get_cname', '_get_cname', (['"""cntest.adamcaudill.com"""', 'resv'], {}), "('cntest.adamcaudill.com', resv)\n", (283, 315), False, 'from yawast.sc... |
from flask import *
import pdfsplitter
app=Flask(__name__)
@app.route("/")
def upload():
return render_template("file_upload.html")
@app.route("/success",methods=["POST"])
def success():
success.start_page=int(request.form['start'])
success.end_page=int(request.form['end'])
f=request.f... | [
"pdfsplitter.cropper"
] | [((587, 663), 'pdfsplitter.cropper', 'pdfsplitter.cropper', (['success.start_page', 'success.end_page', 'success.file_name'], {}), '(success.start_page, success.end_page, success.file_name)\n', (606, 663), False, 'import pdfsplitter\n')] |
from altair.vegalite.v4 import schema
from altair.vegalite.v4.schema.channels import Tooltip
import pandas as pd
import altair as alt
import numpy as np
from queries import Pomodoro
THEME = 'magma'
# TO DO: Add docstings where needed
def get_current_date():
"""
Gets the current date to perform default
... | [
"altair.selection_single",
"queries.Pomodoro",
"numpy.select",
"altair.Chart",
"altair.Axis",
"pandas.merge",
"altair.Scale",
"altair.themes.register",
"altair.Y",
"altair.X",
"altair.themes.enable",
"altair.Tooltip",
"altair.Column",
"altair.hconcat",
"altair.Size",
"altair.Color",
... | [((9347, 9388), 'altair.themes.register', 'alt.themes.register', (['"""my_theme"""', 'my_theme'], {}), "('my_theme', my_theme)\n", (9366, 9388), True, 'import altair as alt\n'), ((9389, 9418), 'altair.themes.enable', 'alt.themes.enable', (['"""my_theme"""'], {}), "('my_theme')\n", (9406, 9418), True, 'import altair as ... |
# Copyright (C) 2016 <NAME>. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# ========================================... | [
"os.listdir",
"argparse.ArgumentParser",
"os.path.join",
"os.path.splitext",
"collections.Counter",
"os.path.isfile",
"os.walk",
"os.path.relpath"
] | [((624, 633), 'collections.Counter', 'Counter', ([], {}), '()\n', (631, 633), False, 'from collections import Counter\n'), ((772, 804), 'os.walk', 'os.walk', (['data_dir'], {'topdown': '(False)'}), '(data_dir, topdown=False)\n', (779, 804), False, 'import os\n'), ((2015, 2024), 'collections.Counter', 'Counter', ([], {}... |
import numpy as np
from math_study.numpy_basics.statistics.statistics import random_data
if __name__ == '__main__':
print('Numpy - Statistic - min & max')
print('\nrandom multidimensional array:')
print(random_data)
print('\nget the min value from the array:')
print(random_data.min())
print... | [
"math_study.numpy_basics.statistics.statistics.random_data.min",
"math_study.numpy_basics.statistics.statistics.random_data.max"
] | [((291, 308), 'math_study.numpy_basics.statistics.statistics.random_data.min', 'random_data.min', ([], {}), '()\n', (306, 308), False, 'from math_study.numpy_basics.statistics.statistics import random_data\n'), ((395, 418), 'math_study.numpy_basics.statistics.statistics.random_data.min', 'random_data.min', ([], {'axis'... |
import os
import unittest
import tempfile
import fcntl
import struct
from ffrecord import checkFsAlign
FS_IOCNUM_CHECK_FS_ALIGN = 2147772004
def checkFsAlign2(fd):
buf = bytearray(4)
try:
fcntl.ioctl(fd, FS_IOCNUM_CHECK_FS_ALIGN, buf)
except OSError as err:
return False
fsAlign = s... | [
"os.path.exists",
"fcntl.ioctl",
"os.open",
"ffrecord.checkFsAlign",
"struct.unpack",
"tempfile.NamedTemporaryFile",
"unittest.main"
] | [((319, 342), 'struct.unpack', 'struct.unpack', (['"""i"""', 'buf'], {}), "('i', buf)\n", (332, 342), False, 'import struct\n'), ((990, 1005), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1003, 1005), False, 'import unittest\n'), ((209, 255), 'fcntl.ioctl', 'fcntl.ioctl', (['fd', 'FS_IOCNUM_CHECK_FS_ALIGN', 'bu... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import os, json
def main():
fp = 'vocab.json'
with open(fp, 'r') as f:
caption_token_to_idx = json.load(f)['question_token_to_idx']
caption_tokens = list(caption_token_to_idx.keys())
print(caption_tokens[5:])
with open("clevr-scene-nouns.t... | [
"json.load"
] | [((161, 173), 'json.load', 'json.load', (['f'], {}), '(f)\n', (170, 173), False, 'import os, json\n')] |
import re
from configparser import ConfigParser
from tadataka.camera.model import CameraModel
def parse_(line):
camera_id, model_params = re.split(r"\s+", line, maxsplit=1)
try:
camera_id = int(camera_id)
except ValueError:
raise ValueError("Camera ID must be integer")
return camera_id... | [
"re.split",
"tadataka.camera.model.CameraModel.fromstring"
] | [((144, 178), 're.split', 're.split', (['"""\\\\s+"""', 'line'], {'maxsplit': '(1)'}), "('\\\\s+', line, maxsplit=1)\n", (152, 178), False, 'import re\n'), ((322, 358), 'tadataka.camera.model.CameraModel.fromstring', 'CameraModel.fromstring', (['model_params'], {}), '(model_params)\n', (344, 358), False, 'from tadataka... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import cpro.models
class Migration(migrations.Migration):
dependencies = [
('cpro', '0002_auto_20160916_2110'),
]
operations = [
migrations.AddField(
model_name='card',
... | [
"django.db.models.DateTimeField",
"django.db.models.PositiveIntegerField",
"django.db.models.CharField"
] | [((627, 658), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'null': '(True)'}), '(null=True)\n', (647, 658), False, 'from django.db import models, migrations\n'), ((822, 865), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)', 'null': '(True)'}), '(max_length=100, null=True... |
import random
from typing import Any, Dict, List
import pytorch_lightning as pl
from sklearn.model_selection import train_test_split
from ..dataloaders.sequence_loader import SequenceLoader
from ..datasets.sequence_dataset import SequenceDataset, SequenceSubset
from neural_lifetimes.utils.data import FeatureDictionar... | [
"random.sample"
] | [((6641, 6684), 'random.sample', 'random.sample', (['indices', 'self.forecast_limit'], {}), '(indices, self.forecast_limit)\n', (6654, 6684), False, 'import random\n')] |
from django import forms
from django.contrib.auth.forms import UserCreationForm
# Current app module.
from .models import Account
class CreateUser(UserCreationForm):
"""Form for creating user account in the system."""
class Meta:
model = Account
first_... | [
"django.forms.TextInput",
"django.forms.ValidationError"
] | [((2524, 2599), 'django.forms.ValidationError', 'forms.ValidationError', (["('First name and Second name must be ' + 'different!')"], {}), "('First name and Second name must be ' + 'different!')\n", (2545, 2599), False, 'from django import forms\n'), ((3183, 3239), 'django.forms.ValidationError', 'forms.ValidationError... |
from django.shortcuts import render
from django.template import RequestContext
from django.shortcuts import render_to_response, redirect
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.backends import ModelBackend
def lo... | [
"django.http.HttpResponseRedirect",
"django.contrib.auth.authenticate",
"django.contrib.auth.login",
"django.template.RequestContext",
"django.contrib.auth.logout"
] | [((343, 358), 'django.contrib.auth.logout', 'logout', (['request'], {}), '(request)\n', (349, 358), False, 'from django.contrib.auth import authenticate, login, logout\n'), ((504, 548), 'django.contrib.auth.authenticate', 'authenticate', ([], {'email': 'email', 'password': 'password'}), '(email=email, password=password... |
#!/usr/bin/env python3
# Copyright (c) 2020 Bitcoin Association
# Distributed under the Open BSV software license, see the accompanying file LICENSE.
# Test mempool eviction based on transaction fee
# 1. Fill 90% of the mempool with transactions with a high fee
# 2. Fill 10% of the mempool with transactions with a lo... | [
"test_framework.util.bytes_to_hex_str",
"test_framework.util.satoshi_round",
"test_framework.util.create_confirmed_utxos",
"random.getrandbits",
"decimal.Decimal"
] | [((1086, 1111), 'test_framework.util.satoshi_round', 'satoshi_round', (['send_value'], {}), '(send_value)\n', (1099, 1111), False, 'from test_framework.util import bytes_to_hex_str, create_confirmed_utxos, satoshi_round\n'), ((1225, 1247), 'test_framework.util.bytes_to_hex_str', 'bytes_to_hex_str', (['data'], {}), '(da... |
import cv2
import os
import csv
import parzen.PARZEN as parzen
def extract_features(image_path, vector_size, label):
img = cv2.imread(image_path)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
small = cv2.resize(gray, (vector_size, vector_size))
small = small.flatten()
features = (small).tolist()
... | [
"os.listdir",
"csv.writer",
"os.path.join",
"cv2.cvtColor",
"cv2.resize",
"cv2.imread"
] | [((129, 151), 'cv2.imread', 'cv2.imread', (['image_path'], {}), '(image_path)\n', (139, 151), False, 'import cv2\n'), ((163, 200), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_BGR2GRAY'], {}), '(img, cv2.COLOR_BGR2GRAY)\n', (175, 200), False, 'import cv2\n'), ((213, 257), 'cv2.resize', 'cv2.resize', (['gray', '(... |
from flask import g
import re
'''
This is a helper class to parse
CloudWatch slow query log events
'''
regexPerformance = re.compile(
r"^# Query_time:\s+(\d+\.\d+)\s+Lock_time:\s+(\d+\.\d+)\s+Rows_sent:\s+(\d+)\s+Rows_examined:\s+(\d+)"
)
regexUserInfo = re.compile(
r"^# User@Host:\s+(\S+)\s+@\s+(.*)\s+Id:\s... | [
"re.match",
"re.compile"
] | [((124, 262), 're.compile', 're.compile', (['"""^# Query_time:\\\\s+(\\\\d+\\\\.\\\\d+)\\\\s+Lock_time:\\\\s+(\\\\d+\\\\.\\\\d+)\\\\s+Rows_sent:\\\\s+(\\\\d+)\\\\s+Rows_examined:\\\\s+(\\\\d+)"""'], {}), "(\n '^# Query_time:\\\\s+(\\\\d+\\\\.\\\\d+)\\\\s+Lock_time:\\\\s+(\\\\d+\\\\.\\\\d+)\\\\s+Rows_sent:\\\\s+(\\\\... |
"""
Copyright 2020 Google 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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
di... | [
"ffmpeg.get_ssim_data",
"ffmpeg.get_qp_data",
"graph.generate_line_graph",
"ffmpeg.get_packets_info"
] | [((1066, 1093), 'ffmpeg.get_packets_info', 'get_packets_info', (['file_path'], {}), '(file_path)\n', (1082, 1093), False, 'from ffmpeg import get_packets_info, get_qp_data, get_ssim_data\n'), ((1151, 1173), 'ffmpeg.get_qp_data', 'get_qp_data', (['file_path'], {}), '(file_path)\n', (1162, 1173), False, 'from ffmpeg impo... |
import pytest
from copy import deepcopy
import time
import os
import sys
sys.path.insert(0, os.path.abspath(
os.path.join(os.path.dirname(__file__), '..')))
from py_conway import Game, GameState, InitError # nopep8
from py_conway.threaded_game import ThreadedGame # nopep8
def create_zeros(x, y)... | [
"py_conway.Game",
"time.sleep",
"py_conway.threaded_game.ThreadedGame",
"os.path.dirname",
"pytest.raises",
"copy.deepcopy"
] | [((506, 518), 'py_conway.Game', 'Game', (['(12)', '(12)'], {}), '(12, 12)\n', (510, 518), False, 'from py_conway import Game, GameState, InitError\n'), ((701, 717), 'py_conway.Game', 'Game', (['(6)', '(6)', 'seed'], {}), '(6, 6, seed)\n', (705, 717), False, 'from py_conway import Game, GameState, InitError\n'), ((826, ... |
# Create your tests here.
from django.contrib.auth.models import User
from django.test import TestCase
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APIRequestFactory
class TestSignUpCustomerAPI(TestCase):
def setUp(self):
self.factory = APIRe... | [
"rest_framework.test.APIRequestFactory",
"django.contrib.auth.models.User.objects.create_superuser",
"rest_framework.reverse.reverse"
] | [((315, 334), 'rest_framework.test.APIRequestFactory', 'APIRequestFactory', ([], {}), '()\n', (332, 334), False, 'from rest_framework.test import APIRequestFactory\n'), ((355, 434), 'django.contrib.auth.models.User.objects.create_superuser', 'User.objects.create_superuser', ([], {'username': '"""root"""', 'password': '... |
#!/usr/bin/env python
import unittest
import xml.dom.minidom
from ternip.formats.timex3 import Timex3XmlDocument
from ternip.timex import Timex
class Timex3DocumentTest(unittest.TestCase):
def test_strip_timexes(self):
t = Timex3XmlDocument('<root>This is some <TIMEX3 attr="timex">annotat... | [
"ternip.formats.timex3.Timex3XmlDocument",
"ternip.timex.Timex"
] | [((254, 392), 'ternip.formats.timex3.Timex3XmlDocument', 'Timex3XmlDocument', (['"""<root>This is some <TIMEX3 attr="timex">annotated <TIMEX3>embedded annotated </TIMEX3>text</TIMEX3>.</root>"""'], {}), '(\n \'<root>This is some <TIMEX3 attr="timex">annotated <TIMEX3>embedded annotated </TIMEX3>text</TIMEX3>.</root>... |
from PIL import Image
import os
import glob
import argparse
from evaluation import QudrilateralFinder
from utils import mesh_imgs, draw_polygon_pil
def args_processor():
parser = argparse.ArgumentParser(description='demo for docscanner')
parser.add_argument("-i", "--imagePath", default="z_ref_doc_scanner/data/... | [
"PIL.Image.open",
"os.makedirs",
"argparse.ArgumentParser",
"evaluation.QudrilateralFinder",
"utils.draw_polygon_pil",
"os.path.isfile",
"utils.mesh_imgs",
"os.path.basename",
"glob.glob"
] | [((184, 242), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""demo for docscanner"""'}), "(description='demo for docscanner')\n", (207, 242), False, 'import argparse\n'), ((1007, 1050), 'os.makedirs', 'os.makedirs', (['args.outputPath'], {'exist_ok': '(True)'}), '(args.outputPath, exist_o... |
from django.contrib import admin
from .models import Vote, Blog
# Register your models here.
admin.site.register(Vote)
admin.site.register(Blog) | [
"django.contrib.admin.site.register"
] | [((93, 118), 'django.contrib.admin.site.register', 'admin.site.register', (['Vote'], {}), '(Vote)\n', (112, 118), False, 'from django.contrib import admin\n'), ((119, 144), 'django.contrib.admin.site.register', 'admin.site.register', (['Blog'], {}), '(Blog)\n', (138, 144), False, 'from django.contrib import admin\n')] |
# ====================================
# > Messaging and reporting utilities
# =================================
import textwrap
from collections import Counter
from datetime import datetime
from typing import Sequence, Tuple, cast
import rich
from rich.markup import escape
from rich.panel import Panel
from rich.prog... | [
"rich.text.Text.from_markup",
"rich.get_console",
"rich.progress.BarColumn",
"textwrap.dedent",
"rich.table.Table.grid",
"rich.panel.Panel",
"diff_shades.results.filter_results",
"rich.markup.escape",
"rich.table.Table",
"collections.Counter",
"diff_shades.results.diff_two_results",
"datetime.... | [((596, 614), 'rich.get_console', 'rich.get_console', ([], {}), '()\n', (612, 614), False, 'import rich\n'), ((1716, 1728), 'rich.table.Table.grid', 'Table.grid', ([], {}), '()\n', (1726, 1728), False, 'from rich.table import Table\n'), ((1747, 1759), 'rich.table.Table.grid', 'Table.grid', ([], {}), '()\n', (1757, 1759... |
#! /usr/bin/python3
import os
import sys
import json
import requests
import base64
from email.parser import Parser
from email import policy
email = Parser(policy=policy.SMTP).parse(sys.stdin)
secret = os.getenv('SECRET')
headers = {
'User-Agent': 'tempmail/service',
'Authorization': f'Bearer {secret}'
}
da... | [
"requests.post",
"email.parser.Parser",
"os.getenv"
] | [((205, 224), 'os.getenv', 'os.getenv', (['"""SECRET"""'], {}), "('SECRET')\n", (214, 224), False, 'import os\n'), ((480, 549), 'requests.post', 'requests.post', (['f"""http://server/api/email"""'], {'json': 'data', 'headers': 'headers'}), "(f'http://server/api/email', json=data, headers=headers)\n", (493, 549), False,... |
import os
import shutil
def ensure_folder_exists_and_is_clear(folder):
if not os.path.exists(folder):
os.makedirs(folder)
for the_file in os.listdir(folder):
file_path = os.path.join(folder, the_file)
try:
if os.path.isfile(file_path):
os.unlink(file_path)... | [
"os.path.exists",
"os.listdir",
"os.makedirs",
"os.path.join",
"os.path.isfile",
"os.path.isdir",
"os.unlink",
"shutil.rmtree"
] | [((158, 176), 'os.listdir', 'os.listdir', (['folder'], {}), '(folder)\n', (168, 176), False, 'import os\n'), ((85, 107), 'os.path.exists', 'os.path.exists', (['folder'], {}), '(folder)\n', (99, 107), False, 'import os\n'), ((117, 136), 'os.makedirs', 'os.makedirs', (['folder'], {}), '(folder)\n', (128, 136), False, 'im... |
from unittest import TestCase
from src.DiGraph import DiGraph
from src.GraphAlgo import GraphAlgo
class TestDiGraph(TestCase):
def test_v_size(self):
g = DiGraph()
ga = GraphAlgo()
ga.graph=g
ga.load_from_json('../data/A0.json')
self.assertEqual (g.v_size(),11)
def t... | [
"src.GraphAlgo.GraphAlgo",
"src.DiGraph.DiGraph"
] | [((169, 178), 'src.DiGraph.DiGraph', 'DiGraph', ([], {}), '()\n', (176, 178), False, 'from src.DiGraph import DiGraph\n'), ((192, 203), 'src.GraphAlgo.GraphAlgo', 'GraphAlgo', ([], {}), '()\n', (201, 203), False, 'from src.GraphAlgo import GraphAlgo\n'), ((350, 359), 'src.DiGraph.DiGraph', 'DiGraph', ([], {}), '()\n', ... |
from django.shortcuts import render, redirect
from carts.models import Cart
from .forms import (
ForWhomForm,
EventTypeForm,
GuestNumberForm,
DateInputForm,
)
from .models import (
ForWhom,
EventType,
Guest,
HelloDate
)
def selection(request):... | [
"django.shortcuts.render",
"carts.models.Cart.objects.new_or_get",
"django.shortcuts.redirect"
] | [((683, 738), 'django.shortcuts.render', 'render', (['request', '"""birthday/select.html"""', "{'form': form}"], {}), "(request, 'birthday/select.html', {'form': form})\n", (689, 738), False, 'from django.shortcuts import render, redirect\n'), ((1632, 1692), 'django.shortcuts.render', 'render', (['request', '"""birthda... |
# 引入日历模块
import calendar
import sys
# 打印我的工作日历
workDay = 0
restDay = 0
month = 8
weeks = calendar.monthcalendar(2021, month)
jobDays = [[] for i in range(6)]
jobDaysIndex = 0
print('# ' + str(month) + '月日报')
print()
print('## 一、日历')
print()
print('| 星期一 | 星期二 | 星期三 | 星期四 | 星期五 | <font color=red>星期六</font> | <font ... | [
"calendar.monthcalendar",
"sys.stdout.write"
] | [((92, 127), 'calendar.monthcalendar', 'calendar.monthcalendar', (['(2021)', 'month'], {}), '(2021, month)\n', (114, 127), False, 'import calendar\n'), ((947, 968), 'sys.stdout.write', 'sys.stdout.write', (['"""|"""'], {}), "('|')\n", (963, 968), False, 'import sys\n'), ((917, 942), 'sys.stdout.write', 'sys.stdout.writ... |
import numpy as np
import os
import sklearn.metrics
from scipy.optimize import curve_fit
def slice_lat(ds):
return ds.sel(lat=slice(-25, 25))
def ensure_dir(file_path):
"""Check if a directory exists and create it if needed"""
if not os.path.exists(file_path):
os.makedirs(file_path)
def days_p... | [
"scipy.optimize.curve_fit",
"os.path.exists",
"os.makedirs",
"numpy.exp",
"numpy.array",
"numpy.full"
] | [((250, 275), 'os.path.exists', 'os.path.exists', (['file_path'], {}), '(file_path)\n', (264, 275), False, 'import os\n'), ((285, 307), 'os.makedirs', 'os.makedirs', (['file_path'], {}), '(file_path)\n', (296, 307), False, 'import os\n'), ((1020, 1061), 'numpy.exp', 'np.exp', (['(-(x - x0) ** 2 / (2 * sigma ** 2))'], {... |
"""
Library Features:
Name: lib_dryes_downloader_geo
Author(s): <NAME> (<EMAIL>), <NAME> (<EMAIL>)
Date: '20210929'
Version: '1.0.0'
"""
#################################################################################
# Library
import os
import logging
from osgeo import gdal, gdalconst
imp... | [
"osgeo.gdal.Open",
"os.path.exists",
"logging.getLogger",
"rasterio.crs.CRS",
"osgeo.gdal.GetDriverByName",
"lib_dryes_downloader_hsaf_generic.create_darray_2d",
"osgeo.gdal.ReprojectImage",
"numpy.abs",
"numpy.flipud",
"rasterio.open",
"numpy.max",
"numpy.isnan",
"numpy.min",
"numpy.meshg... | [((1101, 1147), 'osgeo.gdal.Open', 'gdal.Open', (['file_name_in', 'gdalconst.GA_ReadOnly'], {}), '(file_name_in, gdalconst.GA_ReadOnly)\n', (1110, 1147), False, 'from osgeo import gdal, gdalconst\n'), ((1422, 1535), 'osgeo.gdal.ReprojectImage', 'gdal.ReprojectImage', (['dset_tiff_in', 'dset_tiff_out', 'dset_proj_in', '... |
import torch
import torch.nn as nn
import torchvision
# There is no pretrained model in torch.hub for mnasnet0_75, mnasnet1_3, shufflenetv2_x1.5, and shufflenetv2_x2.0
SUPPORTED_MODELS = {
'group1': [
'alexnet',
'vgg11', 'vgg11_bn', 'vgg13', 'vgg13_bn', 'vgg16', 'vgg16_bn', 'vgg19', 'vgg19_bn',
... | [
"torch.cat",
"torch.rand"
] | [((4684, 4708), 'torch.rand', 'torch.rand', (['(1)', '(1)', '(80)', '(80)'], {}), '(1, 1, 80, 80)\n', (4694, 4708), False, 'import torch\n'), ((3703, 3731), 'torch.cat', 'torch.cat', (['[x, x, x]'], {'axis': '(1)'}), '([x, x, x], axis=1)\n', (3712, 3731), False, 'import torch\n')] |
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: MIT
from __future__ import absolute_import, print_function, unicode_literals
from pymta.test_util import SMTPTestCase
from pythonic_testcase import *
from schwarz.mailqueue import SMTPMailer
from schwarz.mailqueue.compat import IS_PYTHON3
class SMTPMailerFullstack... | [
"schwarz.mailqueue.SMTPMailer"
] | [((394, 442), 'schwarz.mailqueue.SMTPMailer', 'SMTPMailer', (['self.hostname'], {'port': 'self.listen_port'}), '(self.hostname, port=self.listen_port)\n', (404, 442), False, 'from schwarz.mailqueue import SMTPMailer\n')] |
import os
import yaml
def main():
filename = 'scripts/portfolio.yml'
new_posts = yaml.load(open(filename))
for key in new_posts.keys():
target_filename = key.replace(':description','')
source_path = os.path.join('_posts', target_filename)
target_path = os.path.join('_new_posts', tar... | [
"os.path.join"
] | [((228, 267), 'os.path.join', 'os.path.join', (['"""_posts"""', 'target_filename'], {}), "('_posts', target_filename)\n", (240, 267), False, 'import os\n'), ((290, 333), 'os.path.join', 'os.path.join', (['"""_new_posts"""', 'target_filename'], {}), "('_new_posts', target_filename)\n", (302, 333), False, 'import os\n')] |
tags = set([
'Connected TV', 'Second Screen', 'Multimedia data analysis', 'Speech to Text', 'Social Networks', 'Smart City Services', 'Geo-localization', 'Geographical Information System', 'Point of Interest', 'Recommendation System', 'Open Data', 'App Development Tool', 'Mobile Services', 'User Interface Generator',... | [
"logging.warning",
"logging.info"
] | [((1105, 1157), 'logging.info', 'logging.info', (["('Checking remote resource at %s' % url)"], {}), "('Checking remote resource at %s' % url)\n", (1117, 1157), False, 'import logging\n'), ((1220, 1240), 'logging.warning', 'logging.warning', (['msg'], {}), '(msg)\n', (1235, 1240), False, 'import logging\n'), ((956, 985)... |
import alpaca_trade_api as tradeapi
import os
import config
import sys
class TradeSession:
def __init__(self):
self.api = tradeapi.REST(config.APCA_API_KEY_ID, config.APCA_API_SECRET_KEY,
base_url=config.APCA_API_BASE_URL,api_version='v2')
# Extract apca_api_ke... | [
"alpaca_trade_api.REST",
"sys.exit"
] | [((144, 267), 'alpaca_trade_api.REST', 'tradeapi.REST', (['config.APCA_API_KEY_ID', 'config.APCA_API_SECRET_KEY'], {'base_url': 'config.APCA_API_BASE_URL', 'api_version': '"""v2"""'}), "(config.APCA_API_KEY_ID, config.APCA_API_SECRET_KEY, base_url=\n config.APCA_API_BASE_URL, api_version='v2')\n", (157, 267), True, ... |
import numpy as np
import cv2
def ransac_align_points(
pA, pB, threshold, diagonal_constraint=0.75, default=np.eye(4)[:3],
):
"""
"""
# sensible requirement of 51 or more spots to compute ransac affine
if len(pA) <= 50 or len(pB) <= 50:
if default is not None:
print("Insuffici... | [
"numpy.eye",
"cv2.estimateAffine3D",
"numpy.diag"
] | [((554, 627), 'cv2.estimateAffine3D', 'cv2.estimateAffine3D', (['pA', 'pB'], {'ransacThreshold': 'threshold', 'confidence': '(0.999)'}), '(pA, pB, ransacThreshold=threshold, confidence=0.999)\n', (574, 627), False, 'import cv2\n'), ((114, 123), 'numpy.eye', 'np.eye', (['(4)'], {}), '(4)\n', (120, 123), True, 'import nu... |
# Credit - https://github.com/balajisrinivas/Detect-Face-and-Blur-OpenCV
# For blurface
from asyncio import TimeoutError, sleep
from calendar import timegm
from datetime import datetime, timedelta
from json import JSONDecodeError, dumps
from platform import system
from random import choice
from statistics import mean,... | [
"urllib.parse.urlencode",
"src.utils.funcs.dateToZodiac",
"cv2.dnn.readNetFromCaffe",
"src.utils.funcs.errorEmbed",
"platform.system",
"asyncio.sleep",
"src.utils.funcs.monthNameToNumber",
"src.utils.funcs.leapYear",
"src.utils.funcs.printError",
"cv2.imread",
"time.gmtime",
"src.utils.funcs.v... | [((2643, 2666), 'discord.ext.tasks.loop', 'tasks.loop', ([], {'seconds': '(2.0)'}), '(seconds=2.0)\n', (2653, 2666), False, 'from discord.ext import commands, tasks\n'), ((3899, 3948), 'discord.ext.commands.cooldown', 'commands.cooldown', (['(1)', '(5)', 'commands.BucketType.user'], {}), '(1, 5, commands.BucketType.use... |
#!/usr/bin/env python3
import subprocess
host_list = ['www.cisco.com', 'www.google.com', '192.168.2.1']
for host in host_list:
print('*' * 10)
print('host: ' + host)
p = subprocess.Popen(['ping', '-c', '1', host], stdout=subprocess.PIPE)
print(p.communicate())
| [
"subprocess.Popen"
] | [((185, 252), 'subprocess.Popen', 'subprocess.Popen', (["['ping', '-c', '1', host]"], {'stdout': 'subprocess.PIPE'}), "(['ping', '-c', '1', host], stdout=subprocess.PIPE)\n", (201, 252), False, 'import subprocess\n')] |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time : 2020/6/2 19:16
# @Author : dorom
# @File : indexPage.py
# @Software: PyCharm
from utils.filePath import FilePath
from utils.logger import MyLogger
from utils.readYaml import ReadYaml
from driverOption.baseApi import BaseApi
from errorExecption.eleNotFound import E... | [
"driverOption.baseApi.BaseApi",
"utils.readYaml.ReadYaml",
"errorExecption.eleNotFound.EleNotFound"
] | [((439, 459), 'driverOption.baseApi.BaseApi', 'BaseApi', (['self.driver'], {}), '(self.driver)\n', (446, 459), False, 'from driverOption.baseApi import BaseApi\n'), ((484, 494), 'utils.readYaml.ReadYaml', 'ReadYaml', ([], {}), '()\n', (492, 494), False, 'from utils.readYaml import ReadYaml\n'), ((1373, 1395), 'errorExe... |
import time
import os
import psycopg2
import psycopg2.extras
from pyinfraboxutils import get_logger
logger = get_logger('infrabox')
def connect_db():
while True:
try:
conn = psycopg2.connect(dbname=os.environ['INFRABOX_DATABASE_DB'],
user=os.environ['INFRABO... | [
"psycopg2.connect",
"time.sleep",
"pyinfraboxutils.get_logger"
] | [((110, 132), 'pyinfraboxutils.get_logger', 'get_logger', (['"""infrabox"""'], {}), "('infrabox')\n", (120, 132), False, 'from pyinfraboxutils import get_logger\n'), ((200, 438), 'psycopg2.connect', 'psycopg2.connect', ([], {'dbname': "os.environ['INFRABOX_DATABASE_DB']", 'user': "os.environ['INFRABOX_DATABASE_USER']",... |
import argparse
import multiprocessing
import os
import pickle
import subprocess
import sys
from random import randint
from time import sleep
import georasters as gr
import numpy as np
from osgeo import gdal, osr
def save_img(data, geotransform, proj, outPath, noDataValue=np.nan, split=False):
# Start the gdal d... | [
"os.path.exists",
"pickle.dump",
"argparse.ArgumentParser",
"osgeo.gdal.Warp",
"osgeo.osr.SpatialReference",
"os.path.join",
"pickle.load",
"multiprocessing.cpu_count",
"numpy.array",
"os.path.dirname",
"osgeo.gdal.Info",
"multiprocessing.Pool",
"os.path.basename",
"sys.exit",
"osgeo.gda... | [((2477, 2516), 'osgeo.gdal.Info', 'gdal.Info', (['raster_path'], {'options': '"""-json"""'}), "(raster_path, options='-json')\n", (2486, 2516), False, 'from osgeo import gdal, osr\n'), ((3684, 3718), 'osgeo.osr.SpatialReference', 'osr.SpatialReference', ([], {'wkt': 'dest_prj'}), '(wkt=dest_prj)\n', (3704, 3718), Fals... |
#==============================================================================
# ConfigManger_test.py
#==============================================================================
from pymtl import *
from pclib.test import TestVectorSimulator
from onehot import Mux, Demux
#--------------------------------... | [
"onehot.Mux",
"pclib.test.TestVectorSimulator",
"onehot.Demux"
] | [((868, 897), 'onehot.Mux', 'Mux', (['nports'], {'dtype': 'data_nbits'}), '(nports, dtype=data_nbits)\n', (871, 897), False, 'from onehot import Mux, Demux\n'), ((1292, 1347), 'pclib.test.TestVectorSimulator', 'TestVectorSimulator', (['model', 'test_vectors', 'tv_in', 'tv_out'], {}), '(model, test_vectors, tv_in, tv_ou... |
# copytrue (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# 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 applicab... | [
"cv2.rectangle",
"numpy.dstack",
"PIL.Image.open",
"xml.etree.ElementTree.parse",
"pycocotools.mask.decode",
"numpy.asarray",
"cv2.LUT",
"numpy.array",
"pycocotools.mask.merge",
"numpy.nonzero",
"cv2.getTextSize",
"numpy.load",
"cv2.imread"
] | [((1435, 1452), 'cv2.imread', 'cv2.imread', (['image'], {}), '(image)\n', (1445, 1452), False, 'import cv2\n'), ((1503, 1517), 'xml.etree.ElementTree.parse', 'ET.parse', (['anno'], {}), '(anno)\n', (1511, 1517), True, 'import xml.etree.ElementTree as ET\n'), ((2771, 2788), 'cv2.imread', 'cv2.imread', (['image'], {}), '... |
"""
@author <NAME>
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(PROJECT_ROOT)
import numpy as np
import tensorflow as tf # TF 1.x
c... | [
"tensorflow.shape",
"tensorflow.self_adjoint_eig",
"tensorflow.transpose",
"tensorflow.reduce_sum",
"tensorflow.nn.moments",
"numpy.log",
"tensorflow.multiply",
"tensorflow.reduce_mean",
"tensorflow.cast",
"sys.path.append",
"tensorflow.log",
"tensorflow.square",
"tensorflow.device",
"os.p... | [((233, 262), 'sys.path.append', 'sys.path.append', (['PROJECT_ROOT'], {}), '(PROJECT_ROOT)\n', (248, 262), False, 'import sys\n'), ((199, 224), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (214, 224), False, 'import os\n'), ((2690, 2701), 'tensorflow.shape', 'tf.shape', (['x'], {}), '(x)\n... |
import pandas as pd
cities = pd.read_csv("../Resources/cities.csv")
cities.set_index('City_ID', inplace=True)
cities.to_html("../Resources/cities.html") | [
"pandas.read_csv"
] | [((29, 67), 'pandas.read_csv', 'pd.read_csv', (['"""../Resources/cities.csv"""'], {}), "('../Resources/cities.csv')\n", (40, 67), True, 'import pandas as pd\n')] |
import os
import numpy as np
from pwtools.common import is_seq, file_write
from .testenv import testdir
def test_is_seq():
fn = os.path.join(testdir, 'is_seq_test_file')
file_write(fn, 'lala')
fd = open(fn , 'r')
for xx in ([1,2,3], (1,2,3), np.array([1,2,3])):
print(type(xx))
assert is... | [
"pwtools.common.is_seq",
"numpy.array",
"os.path.join",
"pwtools.common.file_write"
] | [((133, 174), 'os.path.join', 'os.path.join', (['testdir', '"""is_seq_test_file"""'], {}), "(testdir, 'is_seq_test_file')\n", (145, 174), False, 'import os\n'), ((179, 201), 'pwtools.common.file_write', 'file_write', (['fn', '"""lala"""'], {}), "(fn, 'lala')\n", (189, 201), False, 'from pwtools.common import is_seq, fi... |
# Save to HDF because cPickle fails with very large arrays
# https://github.com/numpy/numpy/issues/2396
import h5py
import numpy as np
import tempfile
import unittest
def dict_to_hdf(fname, d):
"""
Save a dict-of-dict datastructure where values are numpy arrays
to a .hdf5 file
"""
with h5py.File(fn... | [
"numpy.random.rand",
"h5py.File",
"tempfile.NamedTemporaryFile",
"unittest.main",
"numpy.random.randn"
] | [((2172, 2187), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2185, 2187), False, 'import unittest\n'), ((308, 329), 'h5py.File', 'h5py.File', (['fname', '"""w"""'], {}), "(fname, 'w')\n", (317, 329), False, 'import h5py\n'), ((753, 774), 'h5py.File', 'h5py.File', (['fname', '"""r"""'], {}), "(fname, 'r')\n", (7... |
#!/usr/bin/env python
""" pygame.examples.freetype_misc
Miscellaneous (or misc) means:
"consisting of a mixture of various things that are not
usually connected with each other"
Adjective
All those words you read on computers, magazines, books, and such over the years?
Probably a lot of them were constructe... | [
"pygame.init",
"pygame.quit",
"pygame.display.set_mode",
"pygame.display.flip",
"os.path.join",
"pygame.event.wait",
"os.path.abspath"
] | [((847, 856), 'pygame.init', 'pg.init', ([], {}), '()\n', (854, 856), True, 'import pygame as pg\n'), ((997, 1028), 'pygame.display.set_mode', 'pg.display.set_mode', (['(800, 600)'], {}), '((800, 600))\n', (1016, 1028), True, 'import pygame as pg\n'), ((3474, 3491), 'pygame.display.flip', 'pg.display.flip', ([], {}), '... |
#!/usr/bin/env python
import camera
print("taking a picture")
imagePath = camera.capture()
print("captured %s" % imagePath)
| [
"camera.capture"
] | [((76, 92), 'camera.capture', 'camera.capture', ([], {}), '()\n', (90, 92), False, 'import camera\n')] |
import argparse
from datetime import datetime as dt
from lightgbm import LGBMRegressor
import numpy as np
import pandas as pd
from sklearn.metrics import r2_score
from sklearn.model_selection import KFold
import yaml
# from models import lgbm as my_lgbm
from cv import r2_cv
from preprocessing import load_x, load_y
fr... | [
"pandas.read_feather",
"preprocessing.load_x",
"argparse.ArgumentParser",
"yaml.dump",
"lightgbm.LGBMRegressor",
"preprocessing.load_y",
"numpy.exp",
"yaml.safe_load",
"datetime.datetime.now",
"sklearn.metrics.r2_score"
] | [((543, 568), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (566, 568), False, 'import argparse\n'), ((972, 1001), 'preprocessing.load_x', 'load_x', (['features', 'dropped_ids'], {}), '(features, dropped_ids)\n', (978, 1001), False, 'from preprocessing import load_x, load_y\n'), ((1062, 1111),... |
"""Module for the interactive cmd prompt"""
from typing import Any, Dict
import attr
# Logger
from loguru import logger
# This is where we will import all sub-component modules
from pyentrez import entrez_scraper as SCRAPE
from pyentrez.db import mongo_entrez as MDB
from pyentrez.utils import string_utils as su
logg... | [
"pyentrez.db.mongo_entrez.DBLoader",
"pyentrez.utils.string_utils.InteractivePrompt",
"pyentrez.entrez_scraper.Scraper",
"loguru.logger.opt",
"attr.ib"
] | [((316, 339), 'loguru.logger.opt', 'logger.opt', ([], {'colors': '(True)'}), '(colors=True)\n', (326, 339), False, 'from loguru import logger\n'), ((701, 722), 'attr.ib', 'attr.ib', ([], {'default': 'None'}), '(default=None)\n', (708, 722), False, 'import attr\n'), ((733, 754), 'attr.ib', 'attr.ib', ([], {'default': 'N... |
import click
def split_list(a_list):
half = len(a_list)//2
return a_list[:half], a_list[half:]
def generate_string(inputString):
inputLength = len(inputString)
if inputLength > 25:
splitStr = inputString.split(" ")
lineOne, lineTwo = split_list(splitStr)
outp... | [
"click.argument",
"click.command"
] | [((1436, 1451), 'click.command', 'click.command', ([], {}), '()\n', (1449, 1451), False, 'import click\n'), ((1454, 1491), 'click.argument', 'click.argument', (['"""message"""'], {'default': '""""""'}), "('message', default='')\n", (1468, 1491), False, 'import click\n')] |
from difflib import SequenceMatcher
from discord import Embed
from discord.ext.commands import CommandNotFound
from src.utils.config import Prefix
async def commandSuggest(bot, message, commands):
similar_commands = []
if message.startswith(Prefix):
for command in commands:
similar_ratio =... | [
"difflib.SequenceMatcher"
] | [((321, 360), 'difflib.SequenceMatcher', 'SequenceMatcher', (['None', 'message', 'command'], {}), '(None, message, command)\n', (336, 360), False, 'from difflib import SequenceMatcher\n')] |
"""
Description
-----------
Implements variants of the MCC by composing cross-layer models, analysis engines, and steps.
:Authors:
- <NAME>
"""
from mcc.model import *
from mcc.framework import *
from mcc.analyses import *
from mcc.simulation import *
from mcc.complex_analyses import *
from mcc.importexport impo... | [
"mcc.extern.DependencyAnalysisEngine"
] | [((21467, 21600), 'mcc.extern.DependencyAnalysisEngine', 'extern.DependencyAnalysisEngine', (['model', 'model.by_order', "(outpath + 'model.pickle')", "(outpath + 'query.xml')", "(da_path + 'response.xml')"], {}), "(model, model.by_order, outpath +\n 'model.pickle', outpath + 'query.xml', da_path + 'response.xml')\n... |
from rest_framework import serializers
allow_blank = {'default': '', 'initial': '', 'allow_blank': True}
allow_null = {'default': None, 'initial': None, 'allow_null': True}
empty_list = {'default': [], 'initial': [], 'many': True}
class PersonSerializer(serializers.Serializer):
birth_date = serializers.DateField... | [
"rest_framework.serializers.IntegerField",
"rest_framework.serializers.CharField",
"rest_framework.serializers.NullBooleanField",
"rest_framework.serializers.DateField"
] | [((299, 334), 'rest_framework.serializers.DateField', 'serializers.DateField', ([], {}), '(**allow_null)\n', (320, 334), False, 'from rest_framework import serializers\n'), ((348, 398), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {'max_length': '(1)'}), '(max_length=1, **allow_blank)\n', (369,... |
"""
Name and sort the pictures uniformly
Example:
rename(Image_dir, Rename_dir, 'img')
Notes:
image_dir: Path to unnamed picture folder
rename_dir: Path to renamed picture folder
parent path:
dirnames: List of folders in this directory
filenames: List of files in this directory
filename[0]: Image_DataLoader'
filenam... | [
"PIL.Image.open",
"os.path.splitext",
"os.path.join",
"cv2.imread",
"os.walk"
] | [((488, 506), 'os.walk', 'os.walk', (['image_dir'], {}), '(image_dir)\n', (495, 506), False, 'import os\n'), ((679, 709), 'os.path.join', 'os.path.join', (['parent', 'filename'], {}), '(parent, filename)\n', (691, 709), False, 'import os\n'), ((732, 755), 'PIL.Image.open', 'Image.open', (['currentPath'], {}), '(current... |
#! /usr/bin/env python3
"""Disassemble MIPS binary to assembly"""
from inst import instructions as I
import unify as U
import functools as F
def rename(name, value, width):
if name in ['rs', 'rt', 'rd']:
return f'${int(value, 2)}'
if name in ['imm', 'offset']:
if value[0] == '1':
return str(int(value, 2) - ... | [
"unify.unify_binary",
"argparse.FileType",
"argparse.ArgumentParser",
"inst.instructions.items"
] | [((518, 527), 'inst.instructions.items', 'I.items', ([], {}), '()\n', (525, 527), True, 'from inst import instructions as I\n'), ((897, 984), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Disassemble MIPS machine code into assembly"""'}), "(description=\n 'Disassemble MIPS machine co... |
# Copyright (c) 2017, <NAME>
# 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 follow... | [
"rdflib.URIRef.__new__",
"rdflib.Namespace.__new__"
] | [((1762, 1791), 'rdflib.Namespace.__new__', 'Namespace.__new__', (['cls', 'value'], {}), '(cls, value)\n', (1779, 1791), False, 'from rdflib import Namespace, URIRef\n'), ((2378, 2410), 'rdflib.URIRef.__new__', 'URIRef.__new__', (['cls', 'value', 'base'], {}), '(cls, value, base)\n', (2392, 2410), False, 'from rdflib i... |
#!/usr/bin/python
# ------------------------------------------------------------------------------
# birdland_bootstrap.py - A program to startup Start-From_PYInstaller.py
# in the src directory, which will invoke the birdland.py program.
# This is used with the PyInstaller installation package.
# WRW 19 M... | [
"os.chdir",
"sys.path.append",
"src.birdland.main",
"pathlib.Path"
] | [((786, 807), 'sys.path.append', 'sys.path.append', (['path'], {}), '(path)\n', (801, 807), False, 'import sys\n'), ((810, 824), 'os.chdir', 'os.chdir', (['path'], {}), '(path)\n', (818, 824), False, 'import os\n'), ((869, 875), 'src.birdland.main', 'main', ([], {}), '()\n', (873, 875), False, 'from src.birdland import... |
# Generated by Django 3.2.7 on 2021-09-08 00:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('invites', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='invite',
name='invitee_email',
... | [
"django.db.models.EmailField"
] | [((332, 410), 'django.db.models.EmailField', 'models.EmailField', ([], {'db_index': '(True)', 'max_length': '(254)', 'verbose_name': '"""invitee email"""'}), "(db_index=True, max_length=254, verbose_name='invitee email')\n", (349, 410), False, 'from django.db import migrations, models\n')] |
from django.urls import reverse, resolve
def test_dashboard():
assert reverse('dashboards:dashboard') == '/'
assert resolve('/').view_name == 'dashboards:dashboard'
| [
"django.urls.resolve",
"django.urls.reverse"
] | [((76, 107), 'django.urls.reverse', 'reverse', (['"""dashboards:dashboard"""'], {}), "('dashboards:dashboard')\n", (83, 107), False, 'from django.urls import reverse, resolve\n'), ((126, 138), 'django.urls.resolve', 'resolve', (['"""/"""'], {}), "('/')\n", (133, 138), False, 'from django.urls import reverse, resolve\n'... |
from modules.search.wikipedia import Wiki
class RawGenerator:
def __init__(self, sentence: str):
self.sentence = sentence
self.res = {}
def results(self):
print(self.sentence)
for i in [self.sentence]:
wiki = Wiki(i)
search = wiki.search()
i... | [
"modules.search.wikipedia.Wiki"
] | [((264, 271), 'modules.search.wikipedia.Wiki', 'Wiki', (['i'], {}), '(i)\n', (268, 271), False, 'from modules.search.wikipedia import Wiki\n')] |
from model.contact import Contact
from model.group import Group
import random
def test_add_contact_to_group(app, db_orm):
if len(db_orm.get_contacts_without_group()) == 0:
app.contact.create(Contact(firstname="Tester"))
if len(db_orm.get_group_list() == 0):
app.group.create(Group(name="Test Gr... | [
"model.group.Group",
"random.choice",
"model.contact.Contact"
] | [((406, 443), 'random.choice', 'random.choice', (['contacts_not_in_groups'], {}), '(contacts_not_in_groups)\n', (419, 443), False, 'import random\n'), ((205, 232), 'model.contact.Contact', 'Contact', ([], {'firstname': '"""Tester"""'}), "(firstname='Tester')\n", (212, 232), False, 'from model.contact import Contact\n')... |
import pathlib
from typing import Any, Dict, MutableMapping
import toml
def IsSpecificPythonTool(toml_file_path: str, tool_name:str):
toml_loaded: MutableMapping[str,Any]=toml.load(toml_file_path)
if(toml_loaded.keys().__contains__("tool")):
toml_tool: Dict[str,Any]=toml_loaded["tool"]
if(toml_... | [
"toml.load",
"pathlib.Path"
] | [((176, 201), 'toml.load', 'toml.load', (['toml_file_path'], {}), '(toml_file_path)\n', (185, 201), False, 'import toml\n'), ((782, 810), 'pathlib.Path', 'pathlib.Path', (['toml_file_path'], {}), '(toml_file_path)\n', (794, 810), False, 'import pathlib\n'), ((954, 982), 'pathlib.Path', 'pathlib.Path', (['toml_file_path... |
import json
import pathlib
import urllib3
from functools import partial
import dash
from dash.dependencies import Input, Output, State
from dash.exceptions import PreventUpdate
from dash.dash import no_update
from flask import flash, get_flashed_messages
from flask_caching import Cache
from data import dev
import pr... | [
"preprocessing.prepare_scalars",
"data.dev.get_dummy_data",
"preprocessing.extract_colors",
"flask.get_flashed_messages",
"dash.dependencies.Input",
"preprocessing.extract_filters",
"graphs.get_empty_fig",
"models.Colors",
"layout.get_error_and_warnings_div",
"models.Labels",
"dash.Dash",
"lay... | [((569, 595), 'urllib3.disable_warnings', 'urllib3.disable_warnings', ([], {}), '()\n', (593, 595), False, 'import urllib3\n'), ((677, 786), 'dash.Dash', 'dash.Dash', (['__name__'], {'meta_tags': "[{'name': 'viewport', 'content': 'width=device-width, initial-scale=4.0'}]"}), "(__name__, meta_tags=[{'name': 'viewport', ... |
from autotest import AutoTest
from recorder import Recorder
autotest = AutoTest()
def test(args):
print("start test ...")
recorder = Recorder(args)
autotest.test_time_case(recorder, args)
recorder.output(AutoTest.error_log, -1)
print("test finish, cases: {0} errors: {1} accuracy: {2}%".format(
... | [
"autotest.AutoTest",
"recorder.Recorder"
] | [((73, 83), 'autotest.AutoTest', 'AutoTest', ([], {}), '()\n', (81, 83), False, 'from autotest import AutoTest\n'), ((144, 158), 'recorder.Recorder', 'Recorder', (['args'], {}), '(args)\n', (152, 158), False, 'from recorder import Recorder\n')] |
import CreadorDeMapa
import Mazmorra
import Tesoro
import Textura
import Mapa
class CreadorMapaJungla(CreadorDeMapa):
@property
def mapa(self):
return self.__mapa
def crearMapa(self):
mazmorra = Mazmorra()
tesoro = Tesoro(100, 10000)
textura = Textura("nieve.png", 100, 200... | [
"Mazmorra",
"Tesoro",
"Textura",
"Mapa"
] | [((226, 236), 'Mazmorra', 'Mazmorra', ([], {}), '()\n', (234, 236), False, 'import Mazmorra\n'), ((254, 272), 'Tesoro', 'Tesoro', (['(100)', '(10000)'], {}), '(100, 10000)\n', (260, 272), False, 'import Tesoro\n'), ((291, 321), 'Textura', 'Textura', (['"""nieve.png"""', '(100)', '(200)'], {}), "('nieve.png', 100, 200)\... |
import unittest
import pyxb.binding.datatypes as xsd
class Test_anyType (unittest.TestCase):
def testRange (self):
self.assertFalse("Datatype anyType test not implemented")
if __name__ == '__main__':
unittest.main()
| [
"unittest.main"
] | [((218, 233), 'unittest.main', 'unittest.main', ([], {}), '()\n', (231, 233), False, 'import unittest\n')] |
#!/usr/bin/env python3
from aws_cdk import core
from infra.infra_stack import InfraStack
app = core.App()
InfraStack(app, "infra")
app.synth()
| [
"infra.infra_stack.InfraStack",
"aws_cdk.core.App"
] | [((99, 109), 'aws_cdk.core.App', 'core.App', ([], {}), '()\n', (107, 109), False, 'from aws_cdk import core\n'), ((110, 134), 'infra.infra_stack.InfraStack', 'InfraStack', (['app', '"""infra"""'], {}), "(app, 'infra')\n", (120, 134), False, 'from infra.infra_stack import InfraStack\n')] |
import random
import os
files= os.listdir("data/VOC2007/Annotations")
files = [os.path.splitext(file)[0] for file in files]
random.shuffle(files)
train_perc = .8
thres = int(len(files) * train_perc)
train=files[:thres]
test=files[thres+1:]
outfolder = "data/VOC2007/ImageSets/Main"
with open(os.path.join(outfolder... | [
"os.path.join",
"os.listdir",
"os.path.splitext",
"random.shuffle"
] | [((32, 70), 'os.listdir', 'os.listdir', (['"""data/VOC2007/Annotations"""'], {}), "('data/VOC2007/Annotations')\n", (42, 70), False, 'import os\n'), ((126, 147), 'random.shuffle', 'random.shuffle', (['files'], {}), '(files)\n', (140, 147), False, 'import random\n'), ((81, 103), 'os.path.splitext', 'os.path.splitext', (... |
# authors: <NAME>, <NAME>, <NAME>, <NAME>
# date: 2020-11-20
"""Downloads a raw csv dataset from the web to a local filepath.
Usage: download_data.py --url=<url> --out_file=<out_file>
Options:
--url=<url> URL from where to download the data (must be in csv format)
--out_file=<out_file> Path a... | [
"os.path.dirname",
"docopt.docopt",
"pandas.read_csv"
] | [((432, 447), 'docopt.docopt', 'docopt', (['__doc__'], {}), '(__doc__)\n', (438, 447), False, 'from docopt import docopt\n'), ((540, 587), 'pandas.read_csv', 'pd.read_csv', (['url'], {'header': 'None', 'low_memory': '(False)'}), '(url, header=None, low_memory=False)\n', (551, 587), True, 'import pandas as pd\n'), ((674... |
import datetime
import pandas
from evidently.analyzers.utils import process_columns
from evidently.pipeline.column_mapping import ColumnMapping
def test_process_columns() -> None:
dataset = pandas.DataFrame.from_dict([
dict(datetime=datetime.datetime.now(),
target=1,
prediction... | [
"evidently.pipeline.column_mapping.ColumnMapping",
"datetime.datetime.now"
] | [((478, 493), 'evidently.pipeline.column_mapping.ColumnMapping', 'ColumnMapping', ([], {}), '()\n', (491, 493), False, 'from evidently.pipeline.column_mapping import ColumnMapping\n'), ((249, 272), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (270, 272), False, 'import datetime\n')] |
"""load cmat cmat10.
import matplotlib.pyplit as plt
import seaborn as sns
sns.set()
plt.ion() # interactive plot
plt.clf(); sns.heatmap(cmat, cmap="gist_earth_r").invert_yaxis()
plt.clf(); sns.heatmap(cmat, cmap="viridis_r").invert_yaxis()
"""
import pickle
from pathlib import Path
cdir = Path(__file__).parent.... | [
"pathlib.Path"
] | [((298, 312), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (302, 312), False, 'from pathlib import Path\n')] |
# https://www.jwz.org/doc/threading.html
# https://github.com/akuchling/jwzthreading
import re
from collections import deque
restrip_pat = re.compile("""(
(Re(\[\d+\])?:) | (\[ [^]]+ \])
\s*)+
""", re.IGNORECASE | re.VERBOSE)
class Container:
"""Contains a tree of messages.
Instance attributes:
.mes... | [
"sys.stdout.write",
"collections.deque",
"re.compile"
] | [((141, 240), 're.compile', 're.compile', (['"""(\n (Re(\\\\[\\\\d+\\\\])?:) | (\\\\[ [^]]+ \\\\])\n\\\\s*)+\n"""', '(re.IGNORECASE | re.VERBOSE)'], {}), '("""(\n (Re(\\\\[\\\\d+\\\\])?:) | (\\\\[ [^]]+ \\\\])\n\\\\s*)+\n""", re.\n IGNORECASE | re.VERBOSE)\n', (151, 240), False, 'import re\n'), ((8698, 8727), 'sys... |
import os
import shutil
import subprocess
from easygui import *
import time
folderPath = './picsNow'
registerNow = './RegisterNow'
for image in os.listdir(folderPath):
if os.path.exists(registerNow):
shutil.rmtree(registerNow)
os.makedirs(registerNow)
cmd = ["python2", "detect.py", os.path.join(folderPath, imag... | [
"os.path.exists",
"os.listdir",
"os.makedirs",
"subprocess.Popen",
"os.path.join",
"time.sleep",
"shutil.rmtree"
] | [((146, 168), 'os.listdir', 'os.listdir', (['folderPath'], {}), '(folderPath)\n', (156, 168), False, 'import os\n'), ((174, 201), 'os.path.exists', 'os.path.exists', (['registerNow'], {}), '(registerNow)\n', (188, 201), False, 'import os\n'), ((233, 257), 'os.makedirs', 'os.makedirs', (['registerNow'], {}), '(registerN... |
# math function
import math
# round number
x = 2.9
print(round(x))
# absolute value of number
y = -5
print(abs(y))
# make use of the math library
z = 2.5
print(math.ceil(z)) # round up the number
print(math.floor(z)) # round down the number
# for finding more math module just search "python math module"
| [
"math.ceil",
"math.floor"
] | [((166, 178), 'math.ceil', 'math.ceil', (['z'], {}), '(z)\n', (175, 178), False, 'import math\n'), ((208, 221), 'math.floor', 'math.floor', (['z'], {}), '(z)\n', (218, 221), False, 'import math\n')] |
'''tzinfo timezone information for America/Panama.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Panama(DstTzInfo):
'''America/Panama timezone definition. See datetime.tzinfo for details'''
zone = 'America/Panama'
... | [
"pytz.tzinfo.memorized_ttinfo",
"pytz.tzinfo.memorized_datetime"
] | [((346, 365), 'pytz.tzinfo.memorized_datetime', 'd', (['(1)', '(1)', '(1)', '(0)', '(0)', '(0)'], {}), '(1, 1, 1, 0, 0, 0)\n', (347, 365), True, 'from pytz.tzinfo import memorized_datetime as d\n'), ((362, 387), 'pytz.tzinfo.memorized_datetime', 'd', (['(1908)', '(4)', '(22)', '(5)', '(19)', '(36)'], {}), '(1908, 4, 22... |
from django.conf.urls import url
from . import views
app_name = 'gantt'
urlpatterns = [
# ex: /polls/
#url(r'^$', views.index, name='index'),
url(r'^$', views.index, name='index'),
url(r'^project/$', views.project),
url(r'^modify_project/$', views.modify_project),
#url(r'^(?P<question_id>[0-9... | [
"django.conf.urls.url"
] | [((156, 192), 'django.conf.urls.url', 'url', (['"""^$"""', 'views.index'], {'name': '"""index"""'}), "('^$', views.index, name='index')\n", (159, 192), False, 'from django.conf.urls import url\n'), ((199, 231), 'django.conf.urls.url', 'url', (['"""^project/$"""', 'views.project'], {}), "('^project/$', views.project)\n"... |
# <NAME> 2014-2020
# mlxtend Machine Learning Library Extensions
# Author: <NAME> <<EMAIL>>
#
# License: BSD 3 clause
from mlxtend.utils import assert_raises
from mlxtend.utils import check_Xy, format_kwarg_dictionaries
import numpy as np
import sys
import os
y = np.array([1, 2, 3, 4])
X = np.array([[1., 2.], [3., 4.... | [
"numpy.array",
"mlxtend.utils.format_kwarg_dictionaries",
"mlxtend.utils.assert_raises",
"mlxtend.utils.check_Xy"
] | [((266, 288), 'numpy.array', 'np.array', (['[1, 2, 3, 4]'], {}), '([1, 2, 3, 4])\n', (274, 288), True, 'import numpy as np\n'), ((293, 351), 'numpy.array', 'np.array', (['[[1.0, 2.0], [3.0, 4.0], [5.0, 6.0], [7.0, 8.0]]'], {}), '([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0], [7.0, 8.0]])\n', (301, 351), True, 'import numpy as n... |
# Generated by Django 3.2.7 on 2021-10-05 07:21
import json
from django.db import migrations
def update_fields_with_images(apps, schema_editor):
# We can't import the Person model directly as it may be a newer
# version than this migration expects. We use the historical version.
Programme = apps.get_mo... | [
"json.loads",
"django.db.migrations.RunPython"
] | [((7250, 7325), 'django.db.migrations.RunPython', 'migrations.RunPython', (['update_fields_with_images', 'rollback_field_with_images'], {}), '(update_fields_with_images, rollback_field_with_images)\n', (7270, 7325), False, 'from django.db import migrations\n'), ((519, 536), 'json.loads', 'json.loads', (['field'], {}), ... |
from _thread import start_new_thread
from hamcrest import assert_that, equal_to, is_in
from hamcrest.core.core.is_ import is_
from pandas.core.frame import DataFrame
from pytest import fail
from tanuki.data_store.column import Column
class TestColumn:
def test_type_casting(self) -> None:
data = [1, 2, 3... | [
"tanuki.data_store.column.Column",
"hamcrest.core.core.is_.is_",
"pytest.fail",
"pandas.core.frame.DataFrame",
"hamcrest.equal_to",
"_thread.start_new_thread"
] | [((339, 359), 'tanuki.data_store.column.Column', 'Column', (['"""test"""', 'data'], {}), "('test', data)\n", (345, 359), False, 'from tanuki.data_store.column import Column\n'), ((1053, 1078), 'tanuki.data_store.column.Column', 'Column', (['"""test"""', '[0, 1, 2]'], {}), "('test', [0, 1, 2])\n", (1059, 1078), False, '... |
import unittest
import hail as hl
from lib.model.seqr_mt_schema import SeqrVariantSchema
from tests.data.sample_vep import VEP_DATA, DERIVED_DATA
class TestSeqrModel(unittest.TestCase):
def _get_filtered_mt(self, rsid='rs35471880'):
mt = hl.import_vcf('tests/data/1kg_30variants.vcf.bgz')
mt = hl... | [
"lib.model.seqr_mt_schema.SeqrVariantSchema",
"hail.import_vcf"
] | [((254, 304), 'hail.import_vcf', 'hl.import_vcf', (['"""tests/data/1kg_30variants.vcf.bgz"""'], {}), "('tests/data/1kg_30variants.vcf.bgz')\n", (267, 304), True, 'import hail as hl\n'), ((552, 573), 'lib.model.seqr_mt_schema.SeqrVariantSchema', 'SeqrVariantSchema', (['mt'], {}), '(mt)\n', (569, 573), False, 'from lib.m... |
from flask_restplus import Api
from flask import Blueprint
from app.main.controller.user_controller import api as user_ns
from app.main.controller.auth_controller import api as auth_ns
blueprint = Blueprint('api', __name__)
api = Api(blueprint,
title='IT Jobs La Rioja',
version='1.0',
d... | [
"flask.Blueprint",
"flask_restplus.Api"
] | [((199, 225), 'flask.Blueprint', 'Blueprint', (['"""api"""', '__name__'], {}), "('api', __name__)\n", (208, 225), False, 'from flask import Blueprint\n'), ((233, 325), 'flask_restplus.Api', 'Api', (['blueprint'], {'title': '"""IT Jobs La Rioja"""', 'version': '"""1.0"""', 'description': '"""IT jobs La Rioja"""'}), "(bl... |