code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import numpy as np
import pybullet as p
import gym
import numpy as np
import roboverse.bullet as bullet
import os
from tqdm import tqdm
import argparse
import time
import roboverse
import datetime
# =========================================================
# Index corresponds to POSITION, ORIENTATION, BUTTTON etc
POSI... | [
"numpy.random.normal",
"numpy.clip",
"os.path.exists",
"pybullet.getVREvents",
"argparse.ArgumentParser",
"roboverse.make",
"os.makedirs",
"os.path.join",
"time.sleep",
"numpy.append",
"datetime.datetime.now",
"numpy.array",
"roboverse.bullet.deg_to_quat",
"roboverse.bullet.get_link_state"... | [((2696, 2711), 'time.sleep', 'time.sleep', (['(1.5)'], {}), '(1.5)\n', (2706, 2711), False, 'import time\n'), ((3948, 3971), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (3969, 3971), False, 'import datetime\n'), ((4128, 4153), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\... |
import datetime
from config.database import db
from dateutil import parser as DateParser
from utils.log import logger_set
from config.log import LOG_DATABASE_FILE
logger = logger_set(module=__name__, file=LOG_DATABASE_FILE)
class Message(db.Model):
__tablename__ = "messages"
id = db.Column(db.Inte... | [
"dateutil.parser.parse",
"config.database.db.String",
"config.database.db.relationship",
"utils.log.logger_set",
"datetime.datetime.now",
"config.database.db.session.commit",
"config.database.db.session.flush",
"config.database.db.session.add",
"config.database.db.ForeignKey",
"config.database.db.... | [((179, 230), 'utils.log.logger_set', 'logger_set', ([], {'module': '__name__', 'file': 'LOG_DATABASE_FILE'}), '(module=__name__, file=LOG_DATABASE_FILE)\n', (189, 230), False, 'from utils.log import logger_set\n'), ((303, 342), 'config.database.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Checking the mixing of trajectories - limits of number of trajectories and
the limits on running the network for long time. Plus, the contribution
of inserting the trajectories to the network.
For each number of trajectories (5, 20, 50, 100, 200, 1000, inf)
For eac... | [
"numpy.mean",
"mnist.MNIST",
"torch.nn.CrossEntropyLoss",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.fill_between",
"matplotlib.pyplot.figure",
"torch.cuda.is_available",
"scipy.stats.sem",
"pandas.DataFrame"
] | [((1620, 1634), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (1632, 1634), True, 'import pandas as pd\n'), ((1650, 1664), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (1662, 1664), True, 'import pandas as pd\n'), ((1688, 1702), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (1700, 1702), True, ... |
import vcr
from botocore.exceptions import ClientError
from service import get_entries, handler
@vcr.use_cassette()
def test_get_entries():
"""Reads from the `test_get_entries` cassette and processes the entries.
"""
entries = get_entries()
assert len(entries) == 633
print(entries[0])
expecte... | [
"vcr.use_cassette",
"botocore.exceptions.ClientError",
"service.handler",
"service.get_entries"
] | [((100, 118), 'vcr.use_cassette', 'vcr.use_cassette', ([], {}), '()\n', (116, 118), False, 'import vcr\n'), ((242, 255), 'service.get_entries', 'get_entries', ([], {}), '()\n', (253, 255), False, 'from service import get_entries, handler\n'), ((3793, 3812), 'service.handler', 'handler', (['None', 'None'], {}), '(None, ... |
from flask import Flask, render_template_string, Markup
from flask.ext.testing import TestCase, ContextVariableDoesNotExist
from flask.ext.cache import Cache
from flask.ext.twitter_oembedder import TwitterOEmbedder
import types
import httpretty
class FlaskStaticTest(TestCase):
def create_app(self):
app = ... | [
"flask.ext.cache.Cache",
"flask.ext.twitter_oembedder.TwitterOEmbedder",
"flask.render_template_string",
"flask.Flask"
] | [((320, 335), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (325, 335), False, 'from flask import Flask, render_template_string, Markup\n'), ((714, 724), 'flask.ext.cache.Cache', 'Cache', (['app'], {}), '(app)\n', (719, 724), False, 'from flask.ext.cache import Cache\n'), ((758, 791), 'flask.ext.twitter_o... |
from pikachu.fingerprinting.daylight import Daylight
from pikachu.fingerprinting.hashing import hash_32_bit_integer
from pikachu.chem.bond_properties import BOND_PROPERTIES
from pikachu.chem.chirality import find_chirality_from_nonh
class ECFP:
def __init__(self, structure, iterations=2):
self.structure =... | [
"pikachu.fingerprinting.daylight.Daylight",
"pikachu.chem.chirality.find_chirality_from_nonh",
"pikachu.fingerprinting.hashing.hash_32_bit_integer"
] | [((918, 948), 'pikachu.fingerprinting.daylight.Daylight', 'Daylight', (['atom', 'self.structure'], {}), '(atom, self.structure)\n', (926, 948), False, 'from pikachu.fingerprinting.daylight import Daylight\n'), ((986, 1035), 'pikachu.fingerprinting.hashing.hash_32_bit_integer', 'hash_32_bit_integer', (['daylight_propert... |
import boto3
import os
from botocore.exceptions import ClientError
from moto import mock_s3
from piprepo.models import S3Index
from piprepo.utils import get_project_name_from_file
from .conftest import PACKAGES
def assert_s3_bucket_contents(conn, bucket, prefix=''):
for package in PACKAGES:
package_obj = ... | [
"os.path.join",
"os.chdir",
"boto3.resource",
"piprepo.models.S3Index",
"piprepo.utils.get_project_name_from_file"
] | [((1011, 1031), 'boto3.resource', 'boto3.resource', (['"""s3"""'], {}), "('s3')\n", (1025, 1031), False, 'import boto3\n'), ((1509, 1538), 'os.chdir', 'os.chdir', (["tempindex['source']"], {}), "(tempindex['source'])\n", (1517, 1538), False, 'import os\n'), ((1878, 1907), 'os.chdir', 'os.chdir', (["tempindex['source']"... |
import numpy as np
import random
from collections import namedtuple, deque, defaultdict
import matplotlib.pyplot as plt
from mdp import *
import pdb
import util
import json
import pprint
import logging
import utils_nn as utils
BUFFER_SIZE = int(1e4)
BATCH_SIZE = 1
LR = 1e-3
class ReplayBuffer:
def __init__(self, bu... | [
"numpy.mean",
"random.sample",
"collections.deque",
"random.shuffle",
"json.dumps",
"random.seed",
"collections.defaultdict",
"utils_nn.set_logger",
"random.random"
] | [((7767, 7800), 'utils_nn.set_logger', 'utils.set_logger', (['"""qlearning.log"""'], {}), "('qlearning.log')\n", (7783, 7800), True, 'import utils_nn as utils\n'), ((366, 391), 'collections.deque', 'deque', ([], {'maxlen': 'buffer_size'}), '(maxlen=buffer_size)\n', (371, 391), False, 'from collections import namedtuple... |
import torch
import torch.nn as nn
import torch.nn.functional as F
class double_conv(nn.Module):
'''(conv => BN => ReLU) * 2'''
def __init__(self, in_ch, out_ch):
super(double_conv, self).__init__()
self.conv = nn.Sequential(
nn.Conv2d(in_ch, out_ch, 3, padding=1),
nn.B... | [
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.sigmoid",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.functional.interpolate",
"torch.nn.functional.pad",
"torch.nn.ConvTranspose2d",
"torch.cat"
] | [((1766, 1841), 'torch.nn.functional.pad', 'F.pad', (['x1', '(diffX // 2, diffX - diffX // 2, diffY // 2, diffY - diffY // 2)'], {}), '(x1, (diffX // 2, diffX - diffX // 2, diffY // 2, diffY - diffY // 2))\n', (1771, 1841), True, 'import torch.nn.functional as F\n'), ((2146, 2172), 'torch.cat', 'torch.cat', (['[x2, x1]... |
from django.conf.urls import patterns, url
import views
urlpatterns = patterns(
'',
)
| [
"django.conf.urls.patterns"
] | [((72, 84), 'django.conf.urls.patterns', 'patterns', (['""""""'], {}), "('')\n", (80, 84), False, 'from django.conf.urls import patterns, url\n')] |
import pandas as pd
import itertools
import numpy as np
import pickle
import os
import argparse
basePath=os.getcwd()
def get_file_list(file_folder):
# method one: file_list = os.listdir(file_folder)
for root, dirs, file_list in os.walk(file_folder):
return dirs,file_list
parser = argparse.ArgumentPars... | [
"os.path.exists",
"os.makedirs",
"argparse.ArgumentParser",
"pickle.load",
"os.getcwd",
"pandas.DataFrame",
"os.walk"
] | [((105, 116), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (114, 116), False, 'import os\n'), ((299, 324), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (322, 324), False, 'import argparse\n'), ((233, 253), 'os.walk', 'os.walk', (['file_folder'], {}), '(file_folder)\n', (240, 253), False, 'impo... |
import os, sys
import json
import zipfile
from os.path import dirname, join, abspath
from flask import Flask
from flask import Flask, jsonify, request, render_template,redirect,url_for,flash,send_file
from . import module
import common
from werkzeug.utils import secure_filename
import pathlib
import shutil
import base6... | [
"flask.render_template",
"common.ziper_dec",
"common.file_remove_for_videos",
"zipfile.ZipFile",
"flask.Flask",
"pathlib.Path",
"os.urandom",
"base64.b64encode",
"flask.flash",
"os.path.join",
"common.allowed_file",
"flask.redirect",
"common.file_remover",
"werkzeug.utils.secure_filename",... | [((389, 404), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (394, 404), False, 'from flask import Flask, jsonify, request, render_template, redirect, url_for, flash, send_file\n'), ((515, 544), 'flask.render_template', 'render_template', (['"""index.html"""'], {}), "('index.html')\n", (530, 544), False, '... |
from pandas.core.groupby.generic import DataFrameGroupBy
try:
# Import register decorators from pandas >= 0.23
from pandas.api.extensions import (register_dataframe_accessor,
register_series_accessor)
try:
# Define groupby register decorater from pandas >= 1.0... | [
"pandas.core.accessor._register_accessor",
"pandas.util._decorators.doc",
"pandas.core.base.AccessorProperty"
] | [((439, 488), 'pandas.util._decorators.doc', 'doc', (['_register_accessor'], {'klass': '"""DataFrameGroupBy"""'}), "(_register_accessor, klass='DataFrameGroupBy')\n", (442, 488), False, 'from pandas.util._decorators import doc\n'), ((618, 660), 'pandas.core.accessor._register_accessor', '_register_accessor', (['name', ... |
# -*- coding: utf-8 -*-
#
# spacegame.py
#
# Copyright (C) 2014 <NAME> <<EMAIL>>
#
# Based partially on PyGletSpace.py
# Copyright (C) 2007 <NAME> <<EMAIL>>
# http://www.learningpython.com
#
# SpaceGame is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Lic... | [
"random.randint",
"pyglet.clock.schedule_interval",
"pyglet.app.run",
"pyglet.image.load",
"math.sqrt",
"pyglet.font.load",
"pyglet.clock.tick",
"pyglet.window.Window.__init__",
"pyglet.clock.get_fps",
"pyglet.font.Text",
"pyglet.sprite.Sprite.__init__"
] | [((1058, 1104), 'math.sqrt', 'math.sqrt', (['((a.x - b.x) ** 2 + (a.y - b.y) ** 2)'], {}), '((a.x - b.x) ** 2 + (a.y - b.y) ** 2)\n', (1067, 1104), False, 'import random, math\n'), ((7192, 7208), 'pyglet.app.run', 'pyglet.app.run', ([], {}), '()\n', (7206, 7208), False, 'import pyglet\n'), ((1331, 1376), 'pyglet.window... |
import numpy as np
from aleph.consts import *
from reamber.algorithms.generate.sv.generators.svOsuMeasureLineMD import svOsuMeasureLineMD, SvOsuMeasureLineEvent
from reamber.osu.OsuMap import OsuMap
LINES = 20
amps, curves = np.random.rand(LINES), np.random.rand(LINES) + 3
def f319(m: OsuMap):
events = [*[SvOs... | [
"reamber.algorithms.generate.sv.generators.svOsuMeasureLineMD.SvOsuMeasureLineEvent",
"numpy.power",
"numpy.random.rand",
"reamber.algorithms.generate.sv.generators.svOsuMeasureLineMD.svOsuMeasureLineMD"
] | [((228, 249), 'numpy.random.rand', 'np.random.rand', (['LINES'], {}), '(LINES)\n', (242, 249), True, 'import numpy as np\n'), ((1349, 1472), 'reamber.algorithms.generate.sv.generators.svOsuMeasureLineMD.svOsuMeasureLineMD', 'svOsuMeasureLineMD', (['events'], {'scalingFactor': 'SCALE', 'firstOffset': '(125993)', 'lastOf... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
"""
About: Slow Python program to run the image preprocessor
"""
import os
import socket
import time
import sys
import preprocessor
kMaxUDSMTU = 65000
def warm_up(prep):
print("* Warm-up the preprocessor")
raw_img_data = prep.read_img_jpeg_by... | [
"socket.socket",
"preprocessor.Preprocessor",
"sys.exit",
"time.time",
"os.remove"
] | [((356, 367), 'time.time', 'time.time', ([], {}), '()\n', (365, 367), False, 'import time\n'), ((659, 707), 'socket.socket', 'socket.socket', (['socket.AF_UNIX', 'socket.SOCK_DGRAM'], {}), '(socket.AF_UNIX, socket.SOCK_DGRAM)\n', (672, 707), False, 'import socket\n'), ((1070, 1097), 'preprocessor.Preprocessor', 'prepro... |
from ipywidgets import interact
def myfunction(x):
return x
interact(myfunction, x=('red','green'));
| [
"ipywidgets.interact"
] | [((64, 104), 'ipywidgets.interact', 'interact', (['myfunction'], {'x': "('red', 'green')"}), "(myfunction, x=('red', 'green'))\n", (72, 104), False, 'from ipywidgets import interact\n')] |
# Copyright 2016-present CERN – European Organization for Nuclear Research
#
# 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... | [
"collections.defaultdict"
] | [((1097, 1114), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (1108, 1114), False, 'from collections import defaultdict\n')] |
import click
from pangea_api import *
descriptions = {
"megagenome::v1::mash": "compact sketches to quickly compare samples",
"metagenscope::reads_classified": "input for the metagenscope visualization engine",
"metagenscope::reads_classified": "input for the metagenscope visualization engine",
"meta... | [
"click.group",
"click.argument",
"click.option",
"click.echo"
] | [((3799, 3812), 'click.group', 'click.group', ([], {}), '()\n', (3810, 3812), False, 'import click\n'), ((3860, 3889), 'click.option', 'click.option', (['"""-e"""', '"""--email"""'], {}), "('-e', '--email')\n", (3872, 3889), False, 'import click\n'), ((3891, 3923), 'click.option', 'click.option', (['"""-p"""', '"""--pa... |
from django.db.models import get_model
from django.utils import simplejson as json
from django.core.urlresolvers import reverse
from webtest import AppError
from fancypages import test
PageType = get_model('fancypages', 'PageType')
FancyPage = get_model('fancypages', 'FancyPage')
Container = get_model('fancypages', ... | [
"django.utils.simplejson.loads",
"django.db.models.get_model",
"django.core.urlresolvers.reverse"
] | [((199, 234), 'django.db.models.get_model', 'get_model', (['"""fancypages"""', '"""PageType"""'], {}), "('fancypages', 'PageType')\n", (208, 234), False, 'from django.db.models import get_model\n'), ((247, 283), 'django.db.models.get_model', 'get_model', (['"""fancypages"""', '"""FancyPage"""'], {}), "('fancypages', 'F... |
"""Link serializer."""
# Django REST Framework
from rest_framework import serializers
# Models
from hrm_api.community.models import Link
from hrm_api.users.models import Profile
class LinkModelSerializer(serializers.ModelSerializer):
"""Read Link model serializer."""
class Meta:
"""Meta class."""
... | [
"hrm_api.community.models.Link.objects.create"
] | [((797, 841), 'hrm_api.community.models.Link.objects.create', 'Link.objects.create', ([], {'profile': 'profile'}), '(**data, profile=profile)\n', (816, 841), False, 'from hrm_api.community.models import Link\n')] |
"""
CUDA Python version of subgraphs.py to support parallel computations via
an Nvidia GPU.
Functions (Pure Python):
create_subgraphs_array, find_subgraphs
"""
from time import time
from math import factorial
from collections import Counter
from numpy import array, zeros, int64
int64_py = int64
zeros_py = zero... | [
"math.factorial",
"numba.cuda.grid",
"numba.cuda.jit",
"numba.cuda.local.array",
"numba.cuda.to_device",
"time.time"
] | [((13490, 13559), 'numba.cuda.jit', 'cuda.jit', (['"""int64[:](int64[:,:], int64, int64, int64[:])"""'], {'device': '(True)'}), "('int64[:](int64[:,:], int64, int64, int64[:])', device=True)\n", (13498, 13559), False, 'from numba import cuda\n'), ((13749, 13798), 'numba.cuda.jit', 'cuda.jit', (['"""int64(int64[:,:], in... |
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='django-oscar-mws',
version="0.1.0",
url='https://github.com/tangentlabs/django-oscar-mws',
author="<NAME>",
author_email="<EMAIL>",
description="Integrating Oscar with Amazon MWS",
long_description='\n\n'.join([
... | [
"setuptools.find_packages"
] | [((527, 572), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['sandbox*', 'tests*']"}), "(exclude=['sandbox*', 'tests*'])\n", (540, 572), False, 'from setuptools import setup, find_packages\n')] |
from __future__ import absolute_import, print_function
import numpy as np
import sys
import tensorflow as tf
from util.data_loader import *
from util.data_aug import *
from util.parse_config import parse_config
def test(config_file):
# 1, load configure file
config = parse_config(config_file)
config_data = config['... | [
"util.parse_config.parse_config"
] | [((271, 296), 'util.parse_config.parse_config', 'parse_config', (['config_file'], {}), '(config_file)\n', (283, 296), False, 'from util.parse_config import parse_config\n')] |
import azureml.dataprep as dprep
import azureml.core
import pandas as pd
import logging
import os
import datetime
import shutil
from azureml.core import Workspace, Datastore, Dataset, Experiment, Run
from sklearn.model_selection import train_test_split
from azureml.core.compute import ComputeTarget, AmlCompute
from az... | [
"azureml.core.Dataset.get",
"sklearn.tree.DecisionTreeClassifier",
"azureml.core.Run.get_context"
] | [((431, 448), 'azureml.core.Run.get_context', 'Run.get_context', ([], {}), '()\n', (446, 448), False, 'from azureml.core import Workspace, Datastore, Dataset, Experiment, Run\n'), ((529, 580), 'azureml.core.Dataset.get', 'Dataset.get', ([], {'workspace': 'workspace', 'name': 'dataset_name'}), '(workspace=workspace, nam... |
from django.contrib import admin
from models import \
AcknowledgmentType_model, \
AcknowledgmentType11_model, \
AcknowledgmentsType_model, \
AcknowledgmentsType10_model, \
AggregateSeverityType_model, \
AliasType_model, \
BranchType_model, \
CVSSScoreSetsType_model, \
CWEType_model, ... | [
"django.contrib.admin.site.register"
] | [((3325, 3370), 'django.contrib.admin.site.register', 'admin.site.register', (['AcknowledgmentType_model'], {}), '(AcknowledgmentType_model)\n', (3344, 3370), False, 'from django.contrib import admin\n'), ((3371, 3418), 'django.contrib.admin.site.register', 'admin.site.register', (['AcknowledgmentType11_model'], {}), '... |
#! /usr/bin/env python
##############################################################################################################################################
# METHODS
##################################################################################################################################... | [
"functions.build_dictionary",
"optparse.OptionParser"
] | [((694, 717), 'optparse.OptionParser', 'optparse.OptionParser', ([], {}), '()\n', (715, 717), False, 'import optparse\n'), ((1809, 1884), 'functions.build_dictionary', 'fn.build_dictionary', (['options.dictionary', 'options.key_col', 'options.value_col'], {}), '(options.dictionary, options.key_col, options.value_col)\n... |
import re
from spellchecker import SpellChecker
def countSpellError(file):
spell = SpellChecker(language='pt')
lines = []
with open(file, 'r') as f:
lines = [word.replace('.', '').replace(',','') for line in f for word in line.split()]
f.close()
count = 0
misspelled = spell.unknown(li... | [
"spellchecker.SpellChecker"
] | [((90, 117), 'spellchecker.SpellChecker', 'SpellChecker', ([], {'language': '"""pt"""'}), "(language='pt')\n", (102, 117), False, 'from spellchecker import SpellChecker\n')] |
"""
This module defines all the user endpoints
"""
import re
import json
import requests
from flask import (
jsonify, request, abort, make_response, json, Blueprint, render_template_string, url_for, redirect)
from flask_jwt_extended import (
jwt_required, create_access_token,
jwt_refresh_token_required, cre... | [
"itsdangerous.URLSafeTimedSerializer",
"flask_jwt_extended.get_jti",
"app.api.v1.models.vendor_model.Vendor",
"flask_jwt_extended.get_raw_jwt",
"re.compile",
"app.api.v1.utils.users_validator.UserValidator",
"app.api.v1.utils.email.confirm_verification_token",
"flask_jwt_extended.create_access_token",... | [((943, 994), 'flask.Blueprint', 'Blueprint', (['"""userv1"""', '__name__'], {'url_prefix': '"""/api/v1"""'}), "('userv1', __name__, url_prefix='/api/v1')\n", (952, 994), False, 'from flask import jsonify, request, abort, make_response, json, Blueprint, render_template_string, url_for, redirect\n'), ((1008, 1042), 'its... |
"""
An example script to migrate changes to a dataset attributes from one instance of Tamr to another
"""
import tamr_toolbox as tbox
# load example multi config
my_config = tbox.utils.config.from_yaml("examples/resources/conf/migrate_dataset.config.yaml")
# Create the source tamr client
source_client = tbox.utils.cl... | [
"tamr_toolbox.utils.config.from_yaml",
"tamr_toolbox.utils.client.create",
"tamr_toolbox.dataset.manage.create",
"tamr_toolbox.dataset.manage.exists",
"tamr_toolbox.dataset.manage.update"
] | [((175, 262), 'tamr_toolbox.utils.config.from_yaml', 'tbox.utils.config.from_yaml', (['"""examples/resources/conf/migrate_dataset.config.yaml"""'], {}), "(\n 'examples/resources/conf/migrate_dataset.config.yaml')\n", (202, 262), True, 'import tamr_toolbox as tbox\n'), ((307, 373), 'tamr_toolbox.utils.client.create',... |
import os
import re
import netaddr
from django.conf import settings
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from django.utils import timezone
TOOL_VERSION = 'v1.0'
BANNER = '\n'.join([
'=================== SPARCS SSO Log Inspection Report ==================... | [
"os.listdir",
"os.path.join",
"re.match",
"django.contrib.auth.models.User.objects.filter",
"django.utils.timezone.now",
"netaddr.valid_ipv4"
] | [((2197, 2251), 'django.contrib.auth.models.User.objects.filter', 'User.objects.filter', ([], {'username__contains': "options['uid']"}), "(username__contains=options['uid'])\n", (2216, 2251), False, 'from django.contrib.auth.models import User\n'), ((1943, 1992), 'netaddr.valid_ipv4', 'netaddr.valid_ipv4', (['target_va... |
#!/usr/bin/python
import argparse
import collections
import copy
import os
import pexpect
from pexpect import popen_spawn
import re
import signal
import shutil
from subprocess import check_output
import sys
import time
try:
basestring
except NameError:
basestring = str
os.environ['USE_DTLS'] = '0'
try:
i... | [
"subprocess.check_output",
"argparse.ArgumentParser",
"os.makedirs",
"os.path.join",
"re.match",
"os.environ.copy",
"os.getcwd",
"time.sleep",
"os.path.isdir",
"os.path.basename",
"shutil.rmtree",
"time.time"
] | [((448, 483), 'os.path.join', 'os.path.join', (['"""build"""', '"""dist"""', '"""py"""'], {}), "('build', 'dist', 'py')\n", (460, 483), False, 'import os\n'), ((510, 545), 'os.path.join', 'os.path.join', (['"""build"""', '"""dist"""', '"""js"""'], {}), "('build', 'dist', 'js')\n", (522, 545), False, 'import os\n'), ((6... |
import os
import six
import numpy as np
import pandas as pd
from math import pi
from copy import copy
from abc import ABCMeta
from functools import lru_cache
from collections import defaultdict
from scipy.spatial.qhull import ConvexHull
from amlearn.featurize.base import BaseFeaturize
from amlearn.featurize.nearest_nei... | [
"amlearn.utils.data.get_isometric_lists",
"amlearn.utils.packing.tetra_volume",
"amlearn.utils.data.read_imd",
"numpy.array",
"copy.copy",
"os.path.exists",
"amlearn.utils.packing.pbc_image_nn_coords",
"six.with_metaclass",
"amlearn.utils.data.read_lammps_dump",
"amlearn.utils.data.list_like",
"... | [((7291, 7312), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': '(10)'}), '(maxsize=10)\n', (7300, 7312), False, 'from functools import lru_cache\n'), ((8428, 8470), 'six.with_metaclass', 'six.with_metaclass', (['ABCMeta', 'BaseFeaturize'], {}), '(ABCMeta, BaseFeaturize)\n', (8446, 8470), False, 'import six\n'), (... |
import calendar
from collections import defaultdict
from datetime import date, timedelta
from flask import url_for
from slugify import slugify
from sqlalchemy import func
from trello.exceptions import TokenError
from application.cms.classification_service import classification_service
from application.cms.models impo... | [
"application.cms.models.MeasureVersion.published_updates_first_versions",
"application.dashboard.models.LatestPublishedMeasureVersionByGeography.query.filter",
"datetime.timedelta",
"application.cms.classification_service.classification_service.get_value_by_slug",
"application.dashboard.trello_service.trell... | [((4048, 4082), 'application.dashboard.models.EthnicGroupByDimension.query.all', 'EthnicGroupByDimension.query.all', ([], {}), '()\n', (4080, 4082), False, 'from application.dashboard.models import EthnicGroupByDimension\n'), ((5414, 5473), 'application.cms.classification_service.classification_service.get_value_by_slu... |
import itertools
import os
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../..")))
from modular_models.models.basic_models.interface import SyllogisticReasoningModel
class GeneralizedMatching(SyllogisticReasoningModel):
def __init__(self):
... | [
"os.path.abspath",
"itertools.permutations",
"itertools.product",
"modular_models.models.basic_models.interface.SyllogisticReasoningModel.__init__"
] | [((323, 363), 'modular_models.models.basic_models.interface.SyllogisticReasoningModel.__init__', 'SyllogisticReasoningModel.__init__', (['self'], {}), '(self)\n', (357, 363), False, 'from modular_models.models.basic_models.interface import SyllogisticReasoningModel\n'), ((649, 693), 'itertools.permutations', 'itertools... |
from colorfield.fields import ColorField
from django.db import models
from django.conf import settings
from django.core.validators import MaxValueValidator
from django.utils.translation import ugettext_lazy as _
from .constants import (
ALIGN_LEFT, VALIGN_TOP, ALIGN_CHOICES, EASE_OUT_CUBIC, EASING_CHOICES,
VA... | [
"django.utils.translation.ugettext_lazy",
"django.core.validators.MaxValueValidator"
] | [((733, 754), 'django.utils.translation.ugettext_lazy', '_', (['"""background color"""'], {}), "('background color')\n", (734, 754), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((979, 996), 'django.utils.translation.ugettext_lazy', '_', (['"""buttons role"""'], {}), "('buttons role')\n", (980, 9... |
import os
import time
import urllib.request
import redis
import tweepy
# This is stored as an `int`.
MAX_HEX = 0xffffff
auth = tweepy.OAuthHandler(os.environ["CONSUMER_TOKEN"], os.environ["CONSUMER_SECRET"])
auth.set_access_token(os.environ["ACCESS_TOKEN"], os.environ["ACCESS_TOKEN_SECRET"])
api = tweepy.API(auth)... | [
"tweepy.API",
"os.environ.get",
"time.sleep",
"tweepy.OAuthHandler"
] | [((132, 217), 'tweepy.OAuthHandler', 'tweepy.OAuthHandler', (["os.environ['CONSUMER_TOKEN']", "os.environ['CONSUMER_SECRET']"], {}), "(os.environ['CONSUMER_TOKEN'], os.environ['CONSUMER_SECRET']\n )\n", (151, 217), False, 'import tweepy\n'), ((304, 320), 'tweepy.API', 'tweepy.API', (['auth'], {}), '(auth)\n', (314, ... |
""" Generates an arff file with the classes A and B, 1000 features and 500 instances """
if __name__ == "__main__":
import random
features = 1000
instances = 500
arff_file = open("random.arff", "w")
arff_file.write("@relation 'random'\n")
for i in range(features):
arff_file.write("@attr... | [
"random.random",
"random.choice"
] | [((484, 513), 'random.choice', 'random.choice', (['["\'A\'", "\'B\'"]'], {}), '(["\'A\'", "\'B\'"])\n', (497, 513), False, 'import random\n'), ((583, 598), 'random.random', 'random.random', ([], {}), '()\n', (596, 598), False, 'import random\n')] |
from tkinter import Frame
from tkinter.ttk import Label
from gui.component.datagrid import DataGrid
from gui.component.enrollmentdictionary import EnrollmentDictionary
from gui.component.datasource import DataSource
from gui.component.listener import Listener
from gui.component.navigation_bar import NavigationBar... | [
"gui.component.enrollmentdictionary.EnrollmentDictionary",
"tkinter.Frame.__init__",
"tkinter.ttk.Label",
"gui.component.searchdialog.SearchDialog",
"gui.component.datasource.DataSource",
"gui.component.datagrid.DataGrid",
"gui.component.navigation_bar.NavigationBar",
"gui.component.text_box.TextBox"
... | [((570, 598), 'tkinter.Frame.__init__', 'Frame.__init__', (['self', 'parent'], {}), '(self, parent)\n', (584, 598), False, 'from tkinter import Frame\n'), ((664, 712), 'gui.component.enrollmentdictionary.EnrollmentDictionary', 'EnrollmentDictionary', (['self.school_db.enrollments'], {}), '(self.school_db.enrollments)\n... |
from io import BytesIO
import qrcode.image.svg
# Combined path factory, fixes white space that may occur when zooming
factory = qrcode.image.svg.SvgPathImage
def get_qr_code_svg(data_string, include_xml_declaration=False):
img = qrcode.make(data_string, image_factory=factory)
with BytesIO() as bytes_out:
... | [
"io.BytesIO"
] | [((296, 305), 'io.BytesIO', 'BytesIO', ([], {}), '()\n', (303, 305), False, 'from io import BytesIO\n')] |
import csv
from django.core.management.base import BaseCommand
from apps.recipes.models import Ingredient
class Command(BaseCommand):
help = 'Import data from ingredients.csv'
def handle(self, *args, **options):
with open('ingredients.csv', newline='', encoding='utf-8') as csvfile:
read... | [
"apps.recipes.models.Ingredient.objects.get_or_create",
"csv.reader"
] | [((325, 359), 'csv.reader', 'csv.reader', (['csvfile'], {'delimiter': '""","""'}), "(csvfile, delimiter=',')\n", (335, 359), False, 'import csv\n'), ((446, 512), 'apps.recipes.models.Ingredient.objects.get_or_create', 'Ingredient.objects.get_or_create', ([], {'title': 'title', 'dimension': 'dimension'}), '(title=title,... |
#!/usr/bin/env python
import sys
import random
if __name__ == '__main__':
try:
y0 = 0
while True:
fmax = 0
b = sys.stdin.readline()
width = int(b.split(" ")[0])
height = int(b.split(" ")[1])
for q in range(height):
a = sys... | [
"sys.stdin.readline",
"sys.stdout.flush",
"sys.stderr.flush"
] | [((157, 177), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n', (175, 177), False, 'import sys\n'), ((603, 621), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (619, 621), False, 'import sys\n'), ((692, 710), 'sys.stderr.flush', 'sys.stderr.flush', ([], {}), '()\n', (708, 710), False, 'import sys... |
import quandl
import pandas as pd
import numpy as np
import datetime
from sklearn.linear_model import LinearRegression
from sklearn import preprocessing, cross_validation
df = quandl.get("WIKI/AMZN")
df = df[['Adj. Close']]
# print(df)
#
# exit()
forecast_out = int(30) # predicting 30 days into future
df['Predi... | [
"numpy.array",
"quandl.get",
"sklearn.cross_validation.train_test_split",
"sklearn.linear_model.LinearRegression",
"sklearn.preprocessing.scale"
] | [((178, 201), 'quandl.get', 'quandl.get', (['"""WIKI/AMZN"""'], {}), "('WIKI/AMZN')\n", (188, 201), False, 'import quandl\n'), ((462, 484), 'sklearn.preprocessing.scale', 'preprocessing.scale', (['X'], {}), '(X)\n', (481, 484), False, 'from sklearn import preprocessing, cross_validation\n'), ((602, 628), 'numpy.array',... |
#!/usr/bin/env python3
import tempfile
import unittest
from thepipe import Provenance
class TestProvenance(unittest.TestCase):
def setUp(self):
p = Provenance()
p.reset()
def test_activity(self):
p = Provenance()
activity_uuid = p.start_activity("test")
assert p.curren... | [
"thepipe.Provenance",
"tempfile.NamedTemporaryFile"
] | [((162, 174), 'thepipe.Provenance', 'Provenance', ([], {}), '()\n', (172, 174), False, 'from thepipe import Provenance\n'), ((235, 247), 'thepipe.Provenance', 'Provenance', ([], {}), '()\n', (245, 247), False, 'from thepipe import Provenance\n'), ((606, 618), 'thepipe.Provenance', 'Provenance', ([], {}), '()\n', (616, ... |
import threading
import tensorflow as tf
# create a FIFOQueue that produces a range of numbers several times and register an associated QueueRunner
number_queue = tf.train.input_producer([i for i in range(20)], num_epochs=5, name='number_queue')
# manually build a FIFOQueue, and a QueueRunner
queue = tf.FIFOQueue(ca... | [
"tensorflow.local_variables_initializer",
"tensorflow.train.add_queue_runner",
"tensorflow.train.Coordinator",
"tensorflow.Session",
"tensorflow.FIFOQueue",
"tensorflow.train.start_queue_runners",
"tensorflow.global_variables_initializer",
"tensorflow.train.QueueRunner",
"threading.Thread"
] | [((305, 373), 'tensorflow.FIFOQueue', 'tf.FIFOQueue', ([], {'capacity': '(10)', 'dtypes': '[tf.string]', 'name': '"""consumer_queue"""'}), "(capacity=10, dtypes=[tf.string], name='consumer_queue')\n", (317, 373), True, 'import tensorflow as tf\n'), ((444, 489), 'tensorflow.train.QueueRunner', 'tf.train.QueueRunner', ([... |
#!/usr/bin/env python
__author__ = 'mworden'
"""
@package mi.dataset.parser.test.test_pco2w_abc_imodem
@author <NAME>
@brief Test code for the pco2w_abc_imodem parser
"""
from mi.logging import log
import os
from nose.plugins.attrib import attr
from mi.core.exceptions import RecoverableSampleException
from mi.data... | [
"nose.plugins.attrib.attr",
"mi.dataset.parser.pco2w_abc_imodem.Pco2wAbcImodemParser",
"os.path.join",
"mi.logging.log.debug",
"mi.idk.config.Config",
"mi.dataset.test.test_parser.ParserUnitTestCase.setUp"
] | [((1269, 1293), 'nose.plugins.attrib.attr', 'attr', (['"""UNIT"""'], {'group': '"""mi"""'}), "('UNIT', group='mi')\n", (1273, 1293), False, 'from nose.plugins.attrib import attr\n'), ((1432, 1462), 'mi.dataset.test.test_parser.ParserUnitTestCase.setUp', 'ParserUnitTestCase.setUp', (['self'], {}), '(self)\n', (1456, 146... |
import aiogram
from aiogram.dispatcher import FSMContext
from aiogram.types import CallbackQuery
from loader import dp
from markups.inline.calendar import InlineCalendar, calendar_cb
from states import Menus
@dp.callback_query_handler(calendar_cb.filter(), state=Menus.calendar)
async def calendar_selection(callback_... | [
"markups.inline.calendar.InlineCalendar",
"markups.inline.calendar.InlineCalendar.selection",
"markups.inline.calendar.calendar_cb.filter",
"states.Menus.calendar.set"
] | [((238, 258), 'markups.inline.calendar.calendar_cb.filter', 'calendar_cb.filter', ([], {}), '()\n', (256, 258), False, 'from markups.inline.calendar import InlineCalendar, calendar_cb\n'), ((436, 456), 'states.Menus.calendar.set', 'Menus.calendar.set', ([], {}), '()\n', (454, 456), False, 'from states import Menus\n'),... |
import os
import sys
from robot_server.service.protocol import contents
from contextlib import contextmanager
@contextmanager
def protocol_environment(protocol: contents.Contents):
"""
Context manager used for setting up an environment to run a
UploadProtocol.
"""
old_cwd = os.getcwd()
# Chan... | [
"os.chdir",
"sys.path.copy",
"sys.path.append",
"os.getcwd"
] | [((298, 309), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (307, 309), False, 'import os\n'), ((357, 390), 'os.chdir', 'os.chdir', (['protocol.directory.name'], {}), '(protocol.directory.name)\n', (365, 390), False, 'import os\n'), ((452, 467), 'sys.path.copy', 'sys.path.copy', ([], {}), '()\n', (465, 467), False, 'impo... |
from glob import glob
import os
from typing import List
from PIL import Image, ImageFilter
import numpy as np
import csv
import random
import shutil
from joblib import Parallel, delayed
import cv2
from preprocess.util import (
ImageInfo,
cal_new_size,
hex_to_rgb,
noisy,
printStats,
random_blur,
... | [
"os.path.exists",
"PIL.Image.open",
"preprocess.util.random_phase",
"preprocess.util.hex_to_rgb",
"os.path.join",
"joblib.delayed",
"joblib.Parallel",
"numpy.array",
"preprocess.util.printStats",
"preprocess.util.random_blur",
"preprocess.util.cal_new_size",
"numpy.empty",
"numpy.random.rand... | [((670, 692), 'os.path.exists', 'os.path.exists', (['output'], {}), '(output)\n', (684, 692), False, 'import os\n'), ((1340, 1357), 'preprocess.util.printStats', 'printStats', (['infos'], {}), '(infos)\n', (1350, 1357), False, 'from preprocess.util import ImageInfo, cal_new_size, hex_to_rgb, noisy, printStats, random_b... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Rec 200Khz
# GNU Radio version: 3.7.14.0
##################################################
from gnuradio import blocks
from gnuradio import eng_notation
from gnuradio import filter
... | [
"optparse.OptionParser",
"gnuradio.blocks.file_sink",
"gnuradio.filter.firdes.low_pass",
"gnuradio.eng_notation.num_to_str",
"gnuradio.gr.top_block.__init__"
] | [((2702, 2765), 'optparse.OptionParser', 'OptionParser', ([], {'usage': '"""%prog: [options]"""', 'option_class': 'eng_option'}), "(usage='%prog: [options]', option_class=eng_option)\n", (2714, 2765), False, 'from optparse import OptionParser\n'), ((592, 633), 'gnuradio.gr.top_block.__init__', 'gr.top_block.__init__', ... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^user/(?P<pk>\d+)$', views.SiteUserDetailView.as_view(), name='user-detail'),
url(r'^user/create$', views.SiteUserCreateView.as_view(), name='create-user'),
url(r'^user/create/temp$', vie... | [
"django.conf.urls.url"
] | [((76, 112), 'django.conf.urls.url', 'url', (['"""^$"""', 'views.index'], {'name': '"""index"""'}), "('^$', views.index, name='index')\n", (79, 112), False, 'from django.conf.urls import url\n')] |
import torch
from mmcv.runner import OptimizerHook
from mmdet.core.utils.dist_utils import allreduce_grads
from collections import OrderedDict
import torch.distributed as dist
from torch._utils import (_flatten_dense_tensors, _unflatten_dense_tensors,
_take_tensors)
class ArchOptimizerHook(... | [
"torch.tensor",
"torch.stack",
"torch.log",
"mmdet.core.utils.dist_utils.allreduce_grads"
] | [((4215, 4280), 'mmdet.core.utils.dist_utils.allreduce_grads', 'allreduce_grads', (['runner.model', 'self.coalesce', 'self.bucket_size_mb'], {}), '(runner.model, self.coalesce, self.bucket_size_mb)\n', (4230, 4280), False, 'from mmdet.core.utils.dist_utils import allreduce_grads\n'), ((1601, 1637), 'torch.log', 'torch.... |
import re
import requests
class TwitterSession:
def __init__(self):
self.session = requests.Session()
self.session.headers.update(
{
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0"
}
)
# used t... | [
"requests.Session",
"requests.Request",
"re.search"
] | [((98, 116), 'requests.Session', 'requests.Session', ([], {}), '()\n', (114, 116), False, 'import requests\n'), ((553, 595), 're.search', 're.search', (['"""\\\\("gt=(\\\\d+);"""', 'response.text'], {}), '(\'\\\\("gt=(\\\\d+);\', response.text)\n', (562, 595), False, 'import re\n'), ((420, 466), 'requests.Request', 're... |
from django.conf.urls import url, patterns
from .views import airport_list
urlpatterns = patterns('',
url(r'^airports/$', airport_list, name='airport_list'),
) | [
"django.conf.urls.url"
] | [((107, 160), 'django.conf.urls.url', 'url', (['"""^airports/$"""', 'airport_list'], {'name': '"""airport_list"""'}), "('^airports/$', airport_list, name='airport_list')\n", (110, 160), False, 'from django.conf.urls import url, patterns\n')] |
import numpy as np
import theano
import theano.tensor as T
from theano.sandbox.rng_mrg import MRG_RandomStreams
from mlp import HiddenLayer, LogisticRegression
from rbm import RBM
class DBN(object):
"""Deep Belief Network
A deep belief network is obtained by stacking several RBMs on top of each
other. Th... | [
"theano.tensor.lscalar",
"theano.function",
"rbm.RBM",
"theano.tensor.matrix",
"theano.In",
"theano.tensor.ivector",
"mlp.LogisticRegression",
"mlp.HiddenLayer",
"theano.tensor.scalar",
"theano.tensor.grad"
] | [((1105, 1118), 'theano.tensor.matrix', 'T.matrix', (['"""x"""'], {}), "('x')\n", (1113, 1118), True, 'import theano.tensor as T\n'), ((1201, 1215), 'theano.tensor.ivector', 'T.ivector', (['"""y"""'], {}), "('y')\n", (1210, 1215), True, 'import theano.tensor as T\n'), ((3795, 3900), 'mlp.LogisticRegression', 'LogisticR... |
"""Clowder API
This module provides simple wrappers around the clowder Collections API
"""
import json
import logging
import requests
from pyclowder.utils import StatusMessage
def create_empty(connector, host, key, collectionname, description, parentid=None, spaceid=None):
"""Create a new collection in Clowder... | [
"logging.getLogger",
"json.loads",
"requests.post",
"json.dumps",
"requests.get"
] | [((771, 798), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (788, 798), False, 'import logging\n'), ((3219, 3288), 'requests.get', 'requests.get', (['url'], {'verify': '(connector.ssl_verify if connector else True)'}), '(url, verify=connector.ssl_verify if connector else True)\n', (3231,... |
# -*- coding: utf-8 -*-
from ..db import db
from structlog import get_logger
from .background_job import BackgroundJob
from ..models import PeopleSynchronization
from ..core.model import JobStatuses
logger = get_logger()
class SynchronizePeopleJob(BackgroundJob):
ignore_result = True
timeout = 10
def r... | [
"structlog.get_logger",
"traceback.format_exc"
] | [((209, 221), 'structlog.get_logger', 'get_logger', ([], {}), '()\n', (219, 221), False, 'from structlog import get_logger\n'), ((1116, 1138), 'traceback.format_exc', 'traceback.format_exc', ([], {}), '()\n', (1136, 1138), False, 'import traceback\n')] |
import json
import logging
import requests
import os
from text_analytics.abstract_nlp_service import NLPService
from text_analytics.enhance import *
from text_analytics.quickUMLS.semtype_lookup import lookup
from text_analytics.quickUMLS.semtype_lookup import get_semantic_type_list
logger = logging.getLogger()
class... | [
"logging.getLogger",
"json.loads",
"requests.post",
"text_analytics.quickUMLS.semtype_lookup.get_semantic_type_list"
] | [((294, 313), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (311, 313), False, 'import logging\n'), ((892, 915), 'json.loads', 'json.loads', (['json_string'], {}), '(json_string)\n', (902, 915), False, 'import json\n'), ((1317, 1369), 'requests.post', 'requests.post', (['self.quickUMLS_url'], {'json': 're... |
#
# AbstractReporter Class
#
import os
import logging
class AbstractReporter:
"""Abstract class for Data Reporters.
"""
def __init__(self, folder: str, clear_folder: bool = True):
"""Constructor method for reporter. Makes a new folder
in specified location if one does not already exist.
... | [
"os.path.exists",
"os.scandir",
"os.makedirs",
"os.remove"
] | [((660, 682), 'os.path.exists', 'os.path.exists', (['folder'], {}), '(folder)\n', (674, 682), False, 'import os\n'), ((1110, 1129), 'os.makedirs', 'os.makedirs', (['folder'], {}), '(folder)\n', (1121, 1129), False, 'import os\n'), ((766, 784), 'os.scandir', 'os.scandir', (['folder'], {}), '(folder)\n', (776, 784), Fals... |
#!/usr/bin/env python3
import datetime
import glob
import json
import multiprocessing
import os
import requests
import sys
import tempfile
# Describes whether or not existing files will be overwritten
OVERWRITE = True
# How many threads to use to download GTFS feeds in parallel (use 1 for no
# multiprocessing)
THREA... | [
"os.path.exists",
"tempfile.TemporaryDirectory",
"os.listdir",
"requests.get",
"os.path.isdir",
"os.mkdir",
"multiprocessing.Pool",
"os.stat",
"sys.stdout.flush",
"tempfile.mkstemp"
] | [((4605, 4622), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (4617, 4622), False, 'import requests\n'), ((992, 1022), 'requests.get', 'requests.get', (['url'], {'stream': '(True)'}), '(url, stream=True)\n', (1004, 1022), False, 'import requests\n'), ((1622, 1648), 'os.path.isdir', 'os.path.isdir', (['outpu... |
# Generated by Django 2.0.3 on 2018-07-11 19:41
import apps.core.fields
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Channel',
... | [
"django.db.migrations.AlterUniqueTogether",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.models.URLField",
"django.db.models.CharField"
] | [((2583, 2672), 'django.db.migrations.AlterUniqueTogether', 'migrations.AlterUniqueTogether', ([], {'name': '"""rssfeed"""', 'unique_together': "{('link', 'channel')}"}), "(name='rssfeed', unique_together={('link',\n 'channel')})\n", (2613, 2672), False, 'from django.db import migrations, models\n'), ((2713, 2792), ... |
# coding: utf-8
import plugins.tools as tl
import time
import datetime
import subprocess
import shutil
from slackbot.bot import respond_to
from slackbot.bot import listen_to
from slackbot.bot import default_reply
import os
import sys
sys.path.append("{}/gametools".format(os.getcwd()))
import ggssapi_gameresult as ggss... | [
"slackbot.bot.listen_to",
"plugins.tools.confirmSetting",
"plugins.tools.getBranch",
"plugins.tools.getSetting",
"plugins.tools.getOpponent",
"ggssapi_gameresult.writeResults",
"subprocess.run",
"plugins.tools.getLoadPath",
"time.sleep",
"os.getcwd",
"datetime.datetime.now",
"plugins.tools.upd... | [((326, 345), 'slackbot.bot.listen_to', 'listen_to', (['"""^game$"""'], {}), "('^game$')\n", (335, 345), False, 'from slackbot.bot import listen_to\n'), ((516, 534), 'slackbot.bot.listen_to', 'listen_to', (['"""^new$"""'], {}), "('^new$')\n", (525, 534), False, 'from slackbot.bot import listen_to\n'), ((806, 825), 'sla... |
"""Views for generating reports."""
from django.contrib.auth import get_user_model
from django.db.models import Count, Sum, Q
from django.http import HttpResponse
from django.views.generic import ListView
from pure_pagination import PaginationMixin
from tablib import Dataset
from open_connect.accounts.views import Sup... | [
"django.contrib.auth.get_user_model",
"tablib.Dataset",
"django.db.models.Count",
"django.http.HttpResponse",
"open_connect.groups.utils.groups_tags_string",
"django.db.models.Q",
"django.db.models.Sum"
] | [((860, 876), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (874, 876), False, 'from django.contrib.auth import get_user_model\n'), ((3641, 3650), 'tablib.Dataset', 'Dataset', ([], {}), '()\n', (3648, 3650), False, 'from tablib import Dataset\n'), ((4405, 4452), 'django.http.HttpResponse', '... |
"""
This module uses Python to query different endpoints using the
NiFi REST API.
"""
import requests
import pprint
# System Diagnostics
r = requests.get('http://localhost:9300/nifi-api/system-diagnostics')
data = r.json()
print('Aggregte Snapshot:\n'
'==================')
print('Max Heap: {0}'.format(
dat... | [
"requests.post",
"pprint.pprint",
"requests.get"
] | [((143, 208), 'requests.get', 'requests.get', (['"""http://localhost:9300/nifi-api/system-diagnostics"""'], {}), "('http://localhost:9300/nifi-api/system-diagnostics')\n", (155, 208), False, 'import requests\n'), ((626, 734), 'requests.get', 'requests.get', (['"""http://localhost:9300/nifi-api/process-groups/01761002-6... |
import json
from celery.result import AsyncResult
from django.http.response import HttpResponse
from django.shortcuts import render
from django.views.decorators.cache import never_cache
from .backend import ProgressReceive
from .tasks import progress_test_task
# Create your views here.
@never_cache
def get_progress(r... | [
"django.shortcuts.render",
"celery.result.AsyncResult"
] | [((562, 653), 'django.shortcuts.render', 'render', (['request', '"""progressui/progressbartest.html"""'], {'context': "{'task_id': result.task_id}"}), "(request, 'progressui/progressbartest.html', context={'task_id':\n result.task_id})\n", (568, 653), False, 'from django.shortcuts import render\n'), ((369, 389), 'ce... |
"""
Binance exchange implementation.
"""
from __future__ import annotations
from typing import Any
from mcookbook.exchanges.abc import Exchange
from mcookbook.utils import merge_dictionaries
class BinanceFutures(Exchange):
"""
Binance futures exchange implementation.
"""
_name: str = "binance"
... | [
"mcookbook.utils.merge_dictionaries"
] | [((465, 540), 'mcookbook.utils.merge_dictionaries', 'merge_dictionaries', (['ccxt_config', "{'options': {'defaultType': self._market}}"], {}), "(ccxt_config, {'options': {'defaultType': self._market}})\n", (483, 540), False, 'from mcookbook.utils import merge_dictionaries\n')] |
import tkinter
fenetre = tkinter.Tk()
# fonction appellée lorsque l'utilisateur presse une touche
def clavier(event):
global coords
touche = event.keysym
if touche == "Up":
coords = (coords[0], coords[1] - 10)
elif touche == "Down":
coords = (coords[0], coords[1] + 10)
elif touch... | [
"tkinter.Canvas",
"tkinter.Tk"
] | [((26, 38), 'tkinter.Tk', 'tkinter.Tk', ([], {}), '()\n', (36, 38), False, 'import tkinter\n'), ((610, 668), 'tkinter.Canvas', 'tkinter.Canvas', (['fenetre'], {'width': '(250)', 'height': '(250)', 'bg': '"""ivory"""'}), "(fenetre, width=250, height=250, bg='ivory')\n", (624, 668), False, 'import tkinter\n')] |
import matplotlib.pyplot as plt
import math
import numpy as np
a = 0
b = math.pi/2
N = 10
h = (b-a)/N
x = []
def arrangeStuetz(a,N):
for i in range(0,N):
x.append(a+i*h)
x.append(a+N*h)
return x
def trapezsumme(x, N, h) -> float:
result = 0
for i in range(1,N):
result += math.cos... | [
"math.cos"
] | [((636, 650), 'math.cos', 'math.cos', (['x[0]'], {}), '(x[0])\n', (644, 650), False, 'import math\n'), ((665, 679), 'math.cos', 'math.cos', (['x[N]'], {}), '(x[N])\n', (673, 679), False, 'import math\n'), ((312, 326), 'math.cos', 'math.cos', (['x[i]'], {}), '(x[i])\n', (320, 326), False, 'import math\n'), ((600, 625), ... |
from django.contrib.auth.models import Group
from rest_framework import viewsets
from dateflix_api.serializers import GroupSerializer
class GroupViewSet(viewsets.ModelViewSet):
"""
API endpoint that allows groups to be viewed or edited.
"""
queryset = Group.objects.all()
serializer_class = Group... | [
"django.contrib.auth.models.Group.objects.all"
] | [((272, 291), 'django.contrib.auth.models.Group.objects.all', 'Group.objects.all', ([], {}), '()\n', (289, 291), False, 'from django.contrib.auth.models import Group\n')] |
'''
Author: <NAME>
Date: 2021-07-08 10:50:22
LastEditTime: 2021-07-08 14:10:04
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath: /genetic-drawing/mask.py
'''
import cv2
import numpy as np
def main():
# 1.导入图片
img_src = cv2.imread("03.jpg")
# 2.灰度化,二值化
img_gray = cv2.cv... | [
"cv2.imwrite",
"numpy.ones",
"cv2.threshold",
"numpy.array",
"cv2.cvtColor",
"cv2.findContours",
"cv2.dilate",
"cv2.Canny",
"cv2.imread"
] | [((261, 281), 'cv2.imread', 'cv2.imread', (['"""03.jpg"""'], {}), "('03.jpg')\n", (271, 281), False, 'import cv2\n'), ((314, 355), 'cv2.cvtColor', 'cv2.cvtColor', (['img_src', 'cv2.COLOR_BGR2GRAY'], {}), '(img_src, cv2.COLOR_BGR2GRAY)\n', (326, 355), False, 'import cv2\n'), ((370, 398), 'cv2.Canny', 'cv2.Canny', (['img... |
# (c) Continuum Analytics, Inc. / http://continuum.io
# (c) <NAME>
# All Rights Reserved
#
# conda is distributed under the terms of the BSD 3-clause license.
# Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
from locale import getpreferredencoding
import sys
from os import environ as os_environ
f... | [
"tarfile.open",
"conda_build_wheel.build_wheel.build",
"locale.getpreferredencoding",
"shutil.rmtree",
"os.path.isfile",
"conda_build.metadata.MetaData",
"os.path.isdir",
"tempfile.mkdtemp",
"sys.exit",
"os.path.abspath",
"conda.lock.Locked"
] | [((2853, 2873), 'conda.lock.Locked', 'Locked', (['config.croot'], {}), '(config.croot)\n', (2859, 2873), False, 'from conda.lock import Locked\n'), ((3032, 3046), 'os.path.isfile', 'isfile', (['recipe'], {}), '(recipe)\n', (3038, 3046), False, 'from os.path import abspath, isdir, isfile\n'), ((4077, 4193), 'conda_build... |
#!/usr/bin/python
#-*-coding:utf-8-*-
import wx
import gettext
#nickname对话框
class NicknameDlg(wx.Dialog):
nickname = None
def __init__(self, *args, **kwds):
# begin wxGlade: LoginDlg.__init__
kwds["style"] = wx.RESIZE_BORDER | wx.CLOSE_BOX | wx.THICK_FRAME
wx.Dialog.__init__(self, *a... | [
"wx.TextCtrl",
"wx.GridSizer",
"wx.Dialog.__init__"
] | [((293, 332), 'wx.Dialog.__init__', 'wx.Dialog.__init__', (['self', '*args'], {}), '(self, *args, **kwds)\n', (311, 332), False, 'import wx\n'), ((432, 464), 'wx.TextCtrl', 'wx.TextCtrl', (['self', 'wx.ID_ANY', '""""""'], {}), "(self, wx.ID_ANY, '')\n", (443, 464), False, 'import wx\n'), ((1228, 1252), 'wx.GridSizer', ... |
import torch
import numpy as np
from sklearn.covariance import ShrunkCovariance
from collections import defaultdict
from tqdm import tqdm
def get_penultimate_feature_params(model, num_classes, data_loader, device, cov=ShrunkCovariance()):
if model.training:
model.eval()
penultimate_feature_each_class... | [
"torch.topk",
"sklearn.covariance.ShrunkCovariance",
"collections.defaultdict",
"torch.bmm",
"torch.no_grad"
] | [((220, 238), 'sklearn.covariance.ShrunkCovariance', 'ShrunkCovariance', ([], {}), '()\n', (236, 238), False, 'from sklearn.covariance import ShrunkCovariance\n'), ((323, 340), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (334, 340), False, 'from collections import defaultdict\n'), ((383, 401),... |
from starlette.applications import Starlette
from starlette.responses import UJSONResponse
import gpt_2_simple as gpt2
import uvicorn
import os
app = Starlette(debug=False)
sess = gpt2.start_tf_sess(threads=1)
gpt2.load_gpt2(sess)
@app.route('/', methods=['GET', 'POST'])
async def homepage(request):
if request.... | [
"starlette.applications.Starlette",
"os.environ.get",
"gpt_2_simple.start_tf_sess",
"starlette.responses.UJSONResponse",
"gpt_2_simple.load_gpt2"
] | [((151, 173), 'starlette.applications.Starlette', 'Starlette', ([], {'debug': '(False)'}), '(debug=False)\n', (160, 173), False, 'from starlette.applications import Starlette\n'), ((182, 211), 'gpt_2_simple.start_tf_sess', 'gpt2.start_tf_sess', ([], {'threads': '(1)'}), '(threads=1)\n', (200, 211), True, 'import gpt_2_... |
import mock
import unittest
from nsq.sockets.base import SocketWrapper
class TestSocketWrapper(unittest.TestCase):
'''Test the SocketWrapper class'''
def setUp(self):
self.socket = mock.Mock()
self.wrapped = SocketWrapper.wrap_socket(self.socket)
def test_wrap_socket(self):
'''Pa... | [
"mock.Mock",
"mock.patch.object",
"nsq.sockets.base.SocketWrapper.wrap_socket"
] | [((200, 211), 'mock.Mock', 'mock.Mock', ([], {}), '()\n', (209, 211), False, 'import mock\n'), ((235, 273), 'nsq.sockets.base.SocketWrapper.wrap_socket', 'SocketWrapper.wrap_socket', (['self.socket'], {}), '(self.socket)\n', (260, 273), False, 'from nsq.sockets.base import SocketWrapper\n'), ((376, 420), 'mock.patch.ob... |
import numpy as np
import tensorflow as tf
from tensorflow.keras import layers
from tensorflow.keras import activations
import os
class NN(tf.keras.Model):
def __init__(self, tf_inputs, learning_rate = 1e-4, decay_steps = 10000, decay_rate = 0.96, staircase = 0, drop_prob = 0):
super(NN, self).__init__()... | [
"tensorflow.train.Checkpoint",
"tensorflow.keras.layers.Reshape",
"tensorflow.keras.layers.Conv2D",
"tensorflow.shape",
"tensorflow.keras.Sequential",
"tensorflow.keras.optimizers.schedules.ExponentialDecay",
"tensorflow.keras.layers.LeakyReLU",
"tensorflow.keras.layers.BatchNormalization",
"tensorf... | [((586, 687), 'tensorflow.keras.optimizers.schedules.ExponentialDecay', 'tf.keras.optimizers.schedules.ExponentialDecay', (['learning_rate', 'decay_steps', 'decay_rate', 'staircase'], {}), '(learning_rate, decay_steps,\n decay_rate, staircase)\n', (632, 687), True, 'import tensorflow as tf\n'), ((710, 738), 'tensorf... |
import pandas
from lux.vis.VisList import VisList
from lux.vis.Vis import Vis
from lux.core.frame import LuxDataFrame
from lux.executor.Executor import Executor
from lux.utils import utils
class PandasExecutor(Executor):
'''
Given a Vis objects with complete specifications, fetch and process data using Pandas d... | [
"pandas.Series",
"numpy.histogram",
"numpy.array",
"lux.utils.utils.get_filter_specs",
"numpy.isnan",
"numpy.vstack",
"pandas.DataFrame"
] | [((9142, 9186), 'lux.utils.utils.get_filter_specs', 'utils.get_filter_specs', (['vis._inferred_intent'], {}), '(vis._inferred_intent)\n', (9164, 9186), False, 'from lux.utils import utils\n'), ((8511, 8560), 'numpy.histogram', 'np.histogram', (['series'], {'bins': 'bin_attribute.bin_size'}), '(series, bins=bin_attribut... |
#!/usr/bin/python2.4
import base64
import binascii
import random
import sys
import unittest
import cbson
# These values were generated by test_random_segfaults and used to
# crash the decoder, before we fixed the issues.
# Only base64 encoded so they aren't a million characters long and/or full
# of escape sequences... | [
"cbson.loads",
"cbson.dumps",
"binascii.hexlify",
"base64.b64decode",
"unittest.main",
"sys.stdout.flush",
"random.randint",
"sys.stdout.write"
] | [((1768, 1783), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1781, 1783), False, 'import unittest\n'), ((863, 923), 'cbson.dumps', 'cbson.dumps', (["{'A': [1, 2, 3, 4, 5, '6', u'7', {'C': u'DS'}]}"], {}), "({'A': [1, 2, 3, 4, 5, '6', u'7', {'C': u'DS'}]})\n", (874, 923), False, 'import cbson\n'), ((1250, 1310),... |
from collections import deque
n, z = map(int,
input().split())
p, e, q = [[] for _ in range(n)], [0] * n, deque([0])
e[0] = 1
for i in range(n - 1):
a, b = map(int,
input().split())
p[a - 1].append(b - 1)
p[b - 1].append(a - 1)
while len(q):
m = q.popleft()
for i in p[m]:
... | [
"collections.deque"
] | [((118, 128), 'collections.deque', 'deque', (['[0]'], {}), '([0])\n', (123, 128), False, 'from collections import deque\n')] |
from ics.utils import parse_duration
from datetime import timedelta
def test_simple():
s = "PT30M"
assert parse_duration(s) == timedelta(minutes=30)
def test_negative():
s = "-PT30M"
assert parse_duration(s) == timedelta(minutes=-30)
def test_no_sign():
s = "P0DT9H0M0S"
assert parse_durati... | [
"ics.utils.parse_duration",
"datetime.timedelta"
] | [((116, 133), 'ics.utils.parse_duration', 'parse_duration', (['s'], {}), '(s)\n', (130, 133), False, 'from ics.utils import parse_duration\n'), ((137, 158), 'datetime.timedelta', 'timedelta', ([], {'minutes': '(30)'}), '(minutes=30)\n', (146, 158), False, 'from datetime import timedelta\n'), ((210, 227), 'ics.utils.par... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------
# Archivo: geolocator_ip.py
# Capitulo: 4 Patron Pipes and Filters
# Autor(es): <NAME> & <NAME>.
# Version: 2.0 Febrero 2018
# Descripción:
#
# Ésta clase define el rol de un Procesador, es decir, ... | [
"luigi.run",
"csv.DictWriter",
"json.loads",
"reducer_ip.ReducerIP",
"os.path.abspath",
"luigi.LocalTarget",
"urllib.urlopen"
] | [((4261, 4321), 'luigi.run', 'luigi.run', (["['--local-scheduler']"], {'main_task_cls': 'GeolocatorIP'}), "(['--local-scheduler'], main_task_cls=GeolocatorIP)\n", (4270, 4321), False, 'import luigi\n'), ((2640, 2661), 'os.path.abspath', 'os.path.abspath', (['""".."""'], {}), "('..')\n", (2655, 2661), False, 'import os\... |
#loading all of the images
import os
import pygame
game_folder=os.path.dirname(__file__)
#background image
bgimage_folder=os.path.join(game_folder,"img")
bg=pygame.image.load(os.path.join(bgimage_folder,"BG.png"))
bgl=pygame.image.load(os.path.join(bgimage_folder,"BG.png"))
#ninjas
ninja_imag... | [
"os.path.dirname",
"os.path.join"
] | [((76, 101), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (91, 101), False, 'import os\n'), ((141, 173), 'os.path.join', 'os.path.join', (['game_folder', '"""img"""'], {}), "(game_folder, 'img')\n", (153, 173), False, 'import os\n'), ((195, 233), 'os.path.join', 'os.path.join', (['bgimage_f... |
import click
import simplejson as json
from ermaket.api.database import DBConn
from ermaket.api.erd import ERD, Algorithm
from ermaket.api.generation import Generator
from ermaket.api.models import Dumper, Faker, Models, Seeder
__all__ = ['db']
@click.group(help='Models management')
def db():
pass
@db.command... | [
"ermaket.api.models.Models",
"ermaket.api.models.Faker",
"ermaket.api.generation.Generator",
"click.confirm",
"ermaket.api.models.Dumper",
"click.group",
"click.option",
"ermaket.api.erd.Algorithm",
"ermaket.api.database.DBConn",
"ermaket.api.models.Seeder",
"simplejson.load",
"click.echo",
... | [((250, 287), 'click.group', 'click.group', ([], {'help': '"""Models management"""'}), "(help='Models management')\n", (261, 287), False, 'import click\n'), ((441, 488), 'click.option', 'click.option', (['"""--schema"""'], {'help': '"""Schema to drop"""'}), "('--schema', help='Schema to drop')\n", (453, 488), False, 'i... |
# Tests for the Data Analysis Designer (DAD)
import pytest
from django.urls import reverse
from surveys import models
@pytest.fixture
def survey_submitted_setup(survey, survey_row, survey_component):
# Set up necessary fixtures for the surveys-submitted-detail view
pass
def create_formset_data(initial, tot... | [
"surveys.models.SurveyChart.objects.create",
"surveys.models.SurveyChart.objects.get",
"django.urls.reverse"
] | [((1332, 1419), 'django.urls.reverse', 'reverse', (['"""surveys-submitted-detail"""'], {'kwargs': "{'form_entry_id': survey_form_entry.id}"}), "('surveys-submitted-detail', kwargs={'form_entry_id':\n survey_form_entry.id})\n", (1339, 1419), False, 'from django.urls import reverse\n'), ((1727, 1763), 'surveys.models.... |
# -*- coding: utf-8 -*-
"""Module providing stuff for plugin handling
"""
# import basic stuff
import logging
import abc
import sys
import argparse
from typing import List, Optional, Type, Any
# import own stuff
import tlsmate.config as conf
import tlsmate.structs as structs
# import other stuff
class Args(object):... | [
"sys.stderr.write",
"sys.stderr.flush",
"logging.debug",
"argparse.ArgumentParser"
] | [((6129, 6375), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""tlsmate is an application for testing and analyzing TLS servers. Test scenarios can be defined in a simple way with great flexibility. A TLS server configuration and vulnerability scan is built in."""'}), "(description=\n ... |
# Copyright (c) 2020, MD2K Center of Excellence
# - <NAME> <<EMAIL>>
# 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, th... | [
"cerebralcortex.core.data_manager.raw.data.RawData",
"cerebralcortex.core.data_manager.sql.data.SqlData",
"cerebralcortex.core.datatypes.DataStream",
"cerebralcortex.core.util.spark_helper.get_or_create_sc",
"cerebralcortex.core.metadata_manager.stream.metadata.Metadata",
"os.getenv",
"pyspark.sql.types... | [((5673, 5688), 'cerebralcortex.core.log_manager.logging.CCLogging', 'CCLogging', (['self'], {}), '(self)\n', (5682, 5688), False, 'from cerebralcortex.core.log_manager.logging import CCLogging\n'), ((5713, 5723), 'cerebralcortex.core.log_manager.log_handler.LogTypes', 'LogTypes', ([], {}), '()\n', (5721, 5723), False,... |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.1
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (3,0,0):
new_instancemethod = lambda func, inst, cls: _BOPToo... | [
"_BOPTools.BOPTools_ShapeSet_Shape",
"new.instancemethod",
"_BOPTools.BOPTools_AlgoTools3D_MinStepIn2d",
"_BOPTools.new_BOPTools_AlgoTools",
"_BOPTools.BOPTools_EdgeSet_SetShape",
"_BOPTools.BOPTools_AlgoTools3D_PointNearEdge",
"_BOPTools.BOPTools_EdgeSet_AddEdge",
"_BOPTools.BOPTools_Set_IsEqual",
... | [((2995, 3067), 'new.instancemethod', 'new_instancemethod', (['_BOPTools.SwigPyIterator_value', 'None', 'SwigPyIterator'], {}), '(_BOPTools.SwigPyIterator_value, None, SwigPyIterator)\n', (3013, 3067), True, 'from new import instancemethod as new_instancemethod\n'), ((3088, 3159), 'new.instancemethod', 'new_instancemet... |
"""
dav_template.py
Copyright 2012 <NAME>
This file is part of w3af, http://w3af.org/ .
w3af 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 version 2 of the License.
w3af is distributed in the hope that it wil... | [
"w3af.core.data.options.opt_factory.opt_factory",
"w3af.core.data.options.option_list.OptionList",
"w3af.core.data.parsers.doc.url.URL"
] | [((1185, 1208), 'w3af.core.data.parsers.doc.url.URL', 'URL', (['"""http://host.tld/"""'], {}), "('http://host.tld/')\n", (1188, 1208), False, 'from w3af.core.data.parsers.doc.url import URL\n'), ((1492, 1504), 'w3af.core.data.options.option_list.OptionList', 'OptionList', ([], {}), '()\n', (1502, 1504), False, 'from w3... |
import pygame
_colors = []
for r in range(4):
for g in range(4):
for b in range(4):
_colors.append(pygame.Color(r * 64, g * 64, b * 64))
def color(index):
return _colors[index]
if __name__ == "__main__":
import sys
from itertools import groupby
pygame.display.init()
pygam... | [
"sys.exit",
"pygame.display.init",
"pygame.event.get",
"pygame.display.set_mode",
"pygame.display.flip",
"pygame.time.Clock",
"pygame.font.init",
"pygame.display.set_caption",
"pygame.Color",
"pygame.font.Font",
"pygame.Rect"
] | [((289, 310), 'pygame.display.init', 'pygame.display.init', ([], {}), '()\n', (308, 310), False, 'import pygame\n'), ((315, 333), 'pygame.font.init', 'pygame.font.init', ([], {}), '()\n', (331, 333), False, 'import pygame\n'), ((338, 375), 'pygame.display.set_caption', 'pygame.display.set_caption', (['"""palette"""'], ... |
from discord.ext import commands, tasks
import aiomysql
class level(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.now = {}
self.pool = bot.pool
#self.guilds = []
@commands.Cog.listener()
async def on_full_ready(self):
async with self.pool.acquire() as ... | [
"discord.ext.commands.Cog.listener",
"discord.ext.commands.command"
] | [((219, 242), 'discord.ext.commands.Cog.listener', 'commands.Cog.listener', ([], {}), '()\n', (240, 242), False, 'from discord.ext import commands, tasks\n'), ((546, 571), 'discord.ext.commands.command', 'commands.command', (['"""level"""'], {}), "('level')\n", (562, 571), False, 'from discord.ext import commands, task... |
# Copyright: <NAME> <<EMAIL>>
# -*- coding: utf-8 -*-
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
from aqt.qt import *
import os, time
from aqt.utils import saveGeom, restoreGeom, maybeHideClose, addCloseShortcut, \
tooltip, getSaveFile
import aqt
# Deck Stats
##################... | [
"aqt.utils.addCloseShortcut",
"aqt.dialogs.markClosed",
"aqt.utils.maybeHideClose",
"aqt.forms.stats.Ui_Dialog",
"aqt.utils.restoreGeom",
"aqt.utils.saveGeom",
"time.time"
] | [((603, 630), 'aqt.forms.stats.Ui_Dialog', 'aqt.forms.stats.Ui_Dialog', ([], {}), '()\n', (628, 630), False, 'import aqt\n'), ((783, 811), 'aqt.utils.restoreGeom', 'restoreGeom', (['self', 'self.name'], {}), '(self, self.name)\n', (794, 811), False, 'from aqt.utils import saveGeom, restoreGeom, maybeHideClose, addClose... |
import typing
from argparse import Namespace
import tensorflow as tf
import tensorflow_estimator as tfe
from hedgedog.tf.io.dataset import Dataset
from hedgedog.tf.models.multitask_bert_model import MultitaskBertModel
from hedgedog.tf.typing import TensorOrTensorDict
from hedgedog.logging import get_logger
from el.dat... | [
"el.data.dataset.NerDataset",
"el.model.normalization.NormalizationModule",
"tensorflow.group",
"hedgedog.logging.get_logger",
"el.model.boundary.BoundaryModule"
] | [((584, 606), 'hedgedog.logging.get_logger', 'get_logger', (['"""el.model"""'], {}), "('el.model')\n", (594, 606), False, 'from hedgedog.logging import get_logger\n'), ((2934, 2946), 'el.data.dataset.NerDataset', 'NerDataset', ([], {}), '()\n', (2944, 2946), False, 'from el.data.dataset import NerDataset\n'), ((972, 10... |
from sundry import is_main
assert not is_main()
| [
"sundry.is_main"
] | [((39, 48), 'sundry.is_main', 'is_main', ([], {}), '()\n', (46, 48), False, 'from sundry import is_main\n')] |
import struct
from ctypes import c_void_p, c_int32, cast, string_at
from socket import htonl, htons
from socket import inet_ntop
from typing import Union
from migi.decorators import stdcall
from migi.structs.inet import sockaddr_p, AF_INET, AF_INET6, sockaddr_in_p, sockaddr_in6_p
from migi.utils import dump_bytes
@s... | [
"migi.utils.dump_bytes",
"ctypes.string_at",
"socket.htonl",
"socket.htons",
"migi.decorators.stdcall",
"ctypes.cast"
] | [((319, 371), 'migi.decorators.stdcall', 'stdcall', (['"""connect"""', '"""Ws2_32.dll"""'], {'interceptable': '(True)'}), "('connect', 'Ws2_32.dll', interceptable=True)\n", (326, 371), False, 'from migi.decorators import stdcall\n'), ((1270, 1319), 'migi.decorators.stdcall', 'stdcall', (['"""send"""', '"""Ws2_32.dll"""... |
from airbnb_priceforecaster.features.amenities import amenities
from airbnb_priceforecaster.features.bed_type import bed_type
from airbnb_priceforecaster.features.beds import beds
from airbnb_priceforecaster.features.cleaning_fee import cleaning_fee
from airbnb_priceforecaster.features.extra_people import extra_people
... | [
"ml_tooling.transformers.DFFeatureUnion"
] | [((1293, 1933), 'ml_tooling.transformers.DFFeatureUnion', 'DFFeatureUnion', (["[('amenities', amenities), ('host_response_time', host_response_time), (\n 'house_rules_len', house_rules_len), ('host_acceptance_rate',\n host_acceptance_rate), ('cleaning_fee', cleaning_fee), ('square_feet',\n square_feet), ('secu... |
import os
dirpath = os.getcwd()
print("Current working directory is : %s" % dirpath)
APP_NAME = 'OSINT SAN Геолокация'
#------<IMAGES PATH>-------------------------------------------------------------
IMG_FD = 'img'
ICO_PATH = os.path.join(dirpath, IMG_FD, "geoIcon.ico")
BGIMG_PATH = os.path.join(dirpath, IMG_FD, "ba... | [
"os.path.join",
"os.getcwd"
] | [((21, 32), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (30, 32), False, 'import os\n'), ((229, 273), 'os.path.join', 'os.path.join', (['dirpath', 'IMG_FD', '"""geoIcon.ico"""'], {}), "(dirpath, IMG_FD, 'geoIcon.ico')\n", (241, 273), False, 'import os\n'), ((287, 334), 'os.path.join', 'os.path.join', (['dirpath', 'IMG_... |
from blockchain import BlockChain
from threading import Thread
from transaction import Transaction
from block import Block
import json
import time
import hashlib
from tool import getNextHash, valid_proof_of_work, checkValid
import requests
import random
NUM_TRANS_PER_BLOCK= 1
"""
Initialize the node.
address: addr... | [
"transaction.Transaction",
"blockchain.BlockChain",
"block.Block",
"json.dumps",
"tool.getNextHash",
"requests.get",
"tool.checkValid",
"threading.Thread",
"tool.valid_proof_of_work",
"time.time",
"random.randint"
] | [((1552, 1576), 'blockchain.BlockChain', 'BlockChain', (['self.address'], {}), '(self.address)\n', (1562, 1576), False, 'from blockchain import BlockChain\n'), ((3366, 3457), 'transaction.Transaction', 'Transaction', (['self.address'], {'to': 'to', 'inlist': 'inputlist', 'outlist': '[]', 'header': 'msg', 'value': 'valu... |
import unittest
import hcl2
from checkov.terraform.checks.resource.azure.FunctionAppsEnableAuthentication import check
from checkov.common.models.enums import CheckResult
class TestFunctionAppsEnableAuthentication(unittest.TestCase):
def test_failure_missing_authentication_block(self):
hcl_res = hcl2.l... | [
"unittest.main",
"checkov.terraform.checks.resource.azure.FunctionAppsEnableAuthentication.check.scan_resource_conf",
"hcl2.loads"
] | [((2994, 3009), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3007, 3009), False, 'import unittest\n'), ((314, 915), 'hcl2.loads', 'hcl2.loads', (['"""\n resource "azurerm_function_app" "example" {\n name = "test-azure-functions"\n location ... |
from io import BytesIO
from urllib.request import urlopen
from zipfile import ZipFile
import numpy as np
import pandas as pd
from sklearn.utils.testing import assert_array_equal
from sktime.classifiers.example_classifiers import TSExampleClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.lin... | [
"sklearn.utils.testing.assert_array_equal",
"numpy.ones",
"sklearn.metrics.make_scorer",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.linear_model.LogisticRegression",
"sktime.model_selection.GridSearchCV",
"sktime.datasets.load_gunpoint",
"pandas.DataFrame"
] | [((524, 554), 'sktime.datasets.load_gunpoint', 'load_gunpoint', ([], {'return_X_y': '(True)'}), '(return_X_y=True)\n', (537, 554), False, 'from sktime.datasets import load_gunpoint\n'), ((567, 620), 'pandas.DataFrame', 'pd.DataFrame', (["{'ts': Xsf_train, 'ts_copy': Xsf_train}"], {}), "({'ts': Xsf_train, 'ts_copy': Xsf... |
from imdb.Movie import Movie
from typing import Dict, Union
from startrek.script import Script
from startrek.utils import sorted_dict
from startrek.episode_mixins import IMDbMixin
# TODO: Convert all this to a database
class Season:
def __init__(self, season_number: int, episodes: Dict[int, Movie]):
self... | [
"startrek.script.Script",
"startrek.utils.sorted_dict"
] | [((798, 824), 'startrek.utils.sorted_dict', 'sorted_dict', (['self.episodes'], {}), '(self.episodes)\n', (809, 824), False, 'from startrek.utils import sorted_dict\n'), ((1299, 1324), 'startrek.utils.sorted_dict', 'sorted_dict', (['self.seasons'], {}), '(self.seasons)\n', (1310, 1324), False, 'from startrek.utils impor... |