seq_id
string
text
string
repo_name
string
sub_path
string
file_name
string
file_ext
string
file_size_in_byte
int64
program_lang
string
lang
string
doc_type
string
stars
int64
dataset
string
pt
string
api
list
126846414
from sklearn import cross_validation from sklearn.metrics import confusion_matrix from sklearn.metrics import precision_score from sklearn.metrics import recall_score from sklearn import metrics from Evaluation import MyEvaluation class Estimation(object): def __init__(self): return def evaluate_test...
null
Estimation.py
Estimation.py
py
3,574
python
en
code
null
code-starcoder2
83
[ { "api_name": "sklearn.metrics.accuracy_score", "line_number": 15, "usage_type": "call" }, { "api_name": "sklearn.metrics", "line_number": 15, "usage_type": "name" }, { "api_name": "sklearn.metrics.precision_score", "line_number": 16, "usage_type": "call" }, { "ap...
369563946
def setup(): import json #matches = json.load(open("matches.json")) events = json.load(open("events.json")) #juve_match = [match for match in matches if match["wyId"] == 2576302][0] juve_events = [event for event in events if event["matchId"] == 2576302] return juve_events if __name__ == "__m...
null
esercizio15.py
esercizio15.py
py
1,100
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.load", "line_number": 5, "usage_type": "call" } ]
259519256
import socket from PyQt5.QtCore import QSize from PyQt5.QtCore import pyqtSignal from PyQt5.QtGui import QColor from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QHBoxLayout from PyQt5.QtWidgets import QVBoxLayout from Source.GUI.Widgets.Label import MYLabel from Source.GUI.Widgets.ModuleButton import MYButto...
null
GUI/Server/States.py
States.py
py
7,022
python
en
code
null
code-starcoder2
83
[ { "api_name": "Source.GUI.Widgets.Widget.MYWidget", "line_number": 18, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 20, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 21, "usage_type": "call" }, { ...
264195170
# -*- coding: utf-8 -*- """ Created on Fri Mar 8 13:58:38 2019 @author: chonlatid.d """ # import the necessary packages import requests import base64 import json import glob import os import time import numpy as np from PIL import Image import io # initialize the Keras REST API endpoint URL along wi...
null
4connerwithsegment/rest_predict.py
rest_predict.py
py
1,883
python
en
code
null
code-starcoder2
83
[ { "api_name": "glob.glob", "line_number": 24, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 28, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 28, "usage_type": "name" }, { "api_name": "base64.b64encode", "line_numbe...
7882920
import sys import os import random pwd = os.path.dirname(os.path.realpath(__file__)) sys.path.append(pwd + "../") os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_app.settings") import django django.setup() from goods.models import Goods from users.models import UserProfile from user_operation....
null
db_tools/import_colection.py
import_colection.py
py
1,063
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path.append", "lin...
254563898
import random from matplotlib import pyplot as plt import matplotlib # windows和linux可以这样让其支持中文 font = { 'family': 'MicroSoft YaHei', 'weight': 'bold', } matplotlib.rc('font', **font) # 如果列表a表示10点到12点的每一分钟的气温,绘制折线图观察每分钟气温的变化 # a = [random.randint(20, 35) for i in range(120)] x = range(120) y = [random.randint...
null
01_data_analysis/matplotlib/02_matplotlib.py
02_matplotlib.py
py
1,115
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.rc", "line_number": 10, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.pypl...
454620627
import asyncio from clock import clock, time apple_num = 5 banana_num = 10 item = 5 @clock async def load_apple(num): await asyncio.sleep(num*0.1) return num async def buy_apple(num): global apple_num while num >= apple_num: load_apple_num = await load_apple(5) apple_num += load_apple...
null
FluentPython/深入理解异步编程/demo.py
demo.py
py
1,475
python
en
code
null
code-starcoder2
83
[ { "api_name": "asyncio.sleep", "line_number": 10, "usage_type": "call" }, { "api_name": "clock.clock", "line_number": 8, "usage_type": "name" }, { "api_name": "asyncio.sleep", "line_number": 23, "usage_type": "call" }, { "api_name": "asyncio.get_event_loop", "...
395587050
import pytest from rattlesnake.interval import Interval from rattlesnake.note import Note @pytest.mark.parametrize('bass_note, number, quality, expected_distance, expected_name, expected_note', [ (Note('C'), 1, Interval.perfect, 0, 'Perfect Unison', Note('C')), (Note('C'), 1, Interval.augmented, 1, 'Augmented...
null
rattlesnake/tests/pytest_interval.py
pytest_interval.py
py
3,192
python
en
code
null
code-starcoder2
83
[ { "api_name": "rattlesnake.interval.Interval", "line_number": 58, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 6, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 6, "usage_type": "attribute" }, { "api_name": "...
76267419
from flask import request from init_app import socketio, db from models import Status, Game from general_handlers.deck_handler import draw from general_handlers.game_handler import doubledown_valid from general_handlers.balance_handler import sufficent_funds from general_handlers.user_handler import identifier_to_st...
null
singleplayer/single_player_events.py
single_player_events.py
py
2,810
python
en
code
null
code-starcoder2
83
[ { "api_name": "init_app.db.session.query", "line_number": 22, "usage_type": "call" }, { "api_name": "models.Game", "line_number": 22, "usage_type": "argument" }, { "api_name": "init_app.db.session", "line_number": 22, "usage_type": "attribute" }, { "api_name": "in...
108477520
# -*-coding:utf-8-*- import json def per_map_to_pro(data): per_map_pro_times = {} for item in data: per_map_pro_times[item['repo']['id']] = {} for item in data: per_map_pro_times[item['repo']['id']][item['actor']['id']] = {} for item in data: if item['type'] in ['P...
null
code.py
code.py
py
3,751
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.loads", "line_number": 54, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 61, "usage_type": "call" } ]
326771020
from flask import Flask, render_template, request, redirect, session app = Flask(__name__) app.secret_key = "secret" @app.route('/') def count(): if len(session) == 0: session['tally'] = 1 else: session['tally'] += 1 return render_template("index.html", tally=session['tally']) @app.route('...
null
Python/Flask/Counter/server.py
server.py
py
411
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 2, "usage_type": "call" }, { "api_name": "flask.session", "line_number": 7, "usage_type": "argument" }, { "api_name": "flask.session", "line_number": 8, "usage_type": "name" }, { "api_name": "flask.session", "line_nu...
123980717
from multiprocessing import cpu_count import click variant_file = click.argument('variant_file', type=click.File('rb'), metavar='<vcf_file> or -') outfile = click.option('-o', '--outfile', type=click.File('w'), help='Specify the path to a file where results should be stored.') silent = click.option...
null
genmod/commands/utils.py
utils.py
py
963
python
en
code
null
code-starcoder2
83
[ { "api_name": "click.argument", "line_number": 4, "usage_type": "call" }, { "api_name": "click.File", "line_number": 5, "usage_type": "call" }, { "api_name": "click.option", "line_number": 8, "usage_type": "call" }, { "api_name": "click.File", "line_number": 9...
399779084
import time from collections import OrderedDict from itertools import tee from . import backends as be from . import metrics as M from . import schedules from .models.model_utils import State class Sampler(object): """Base class for the sequential Monte Carlo samplers""" def __init__(self, model, **kwargs): ...
null
paysage/fit.py
fit.py
py
19,119
python
en
code
null
code-starcoder2
83
[ { "api_name": "models.model_utils.State.from_visible", "line_number": 87, "usage_type": "call" }, { "api_name": "models.model_utils.State", "line_number": 87, "usage_type": "name" }, { "api_name": "models.model_utils.State.from_visible", "line_number": 88, "usage_type": "...
92703634
from typing import Optional, Dict import pandas as pd from mykaggle.feature.base import Feature from mykaggle.transform.groupby import BasicGroupByTransform COLUMNS = [ 'Platform', 'Year_of_Release', 'Genre', 'Rating' ] class TE(Feature): ''' Name 以外の全カテゴリのカウントエンコーディング ''' def __init...
null
mykaggle/feature/te.py
te.py
py
1,117
python
en
code
null
code-starcoder2
83
[ { "api_name": "mykaggle.feature.base.Feature", "line_number": 14, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 24, "usage_type": "attribute" }, { "api_name": "typing.Optional", "line_number": 25, "usage_type": "name" }, { "api_name": "t...
50953737
""" TFTTool by Max Zuidberg This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. """ import sys import struct import json import string import argparse from pathlib import Path ...
null
TFTTool.py
TFTTool.py
py
30,479
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.tracebacklimit", "line_number": 20, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 27, "usage_type": "call" }, { "api_name": "struct.unpack", "line_number": 149, "usage_type": "call" }, { "api_name": "struct.unpack", ...
92029190
import os os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'freelunch.settings') from sys import exit import django django.setup() import random from flapp import models from faker import Faker fake = Faker() sections = [] for i in models.Section: sections.append(i[0]) author_designations = [] for i in models.A...
null
populate_site.py
populate_site.py
py
3,310
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ.setdefault", "line_number": 2, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 2, "usage_type": "attribute" }, { "api_name": "django.setup", "line_number": 6, "usage_type": "call" }, { "api_name": "faker.Faker", "li...
204213768
#!/usr/bin/env python #-*-coding:utf-8-*- # @Time : 2020/6/3 14:05 # @Author : djc # @File : db_operate.py 数据库相关操作 from flask import Blueprint from app.models.models import db, User db_operate = Blueprint('dboperate', __name__) @db_operate.route('/create_db/') def create_db(): """ 创建user表 :return...
null
flask/flask_00/app/views/db_operate.py
db_operate.py
py
735
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Blueprint", "line_number": 9, "usage_type": "call" }, { "api_name": "app.models.models.db.create_all", "line_number": 18, "usage_type": "call" }, { "api_name": "app.models.models.db", "line_number": 18, "usage_type": "name" }, { "api_name": "a...
157783748
# -*- coding: utf-8 -*- from django.utils.six import text_type from rest_framework import exceptions from rest_framework import HTTP_HEADER_ENCODING from rest_framework.authentication import TokenAuthentication def get_authorization_header(request): """ Return request's 'Authorization:' or 'x-authorization:' ...
null
conference/attendees/authentication.py
authentication.py
py
1,583
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.utils.six.text_type", "line_number": 17, "usage_type": "argument" }, { "api_name": "rest_framework.HTTP_HEADER_ENCODING", "line_number": 19, "usage_type": "argument" }, { "api_name": "rest_framework.authentication.TokenAuthentication", "line_number": 23,...
387419713
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: build/bdist.macosx-10.15-x86_64/egg/foxylib/tools/database/mongodb/tests/test_foxylib_mongodb.py # Compiled at: 2020-01-15 23:57:40 # Size of source mod 2**32: 10...
null
pycfiles/foxylib-0.3.96-py3.7/test_foxylib_mongodb.cpython-37.py
test_foxylib_mongodb.cpython-37.py
py
1,351
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.TestCase", "line_number": 16, "usage_type": "name" }, { "api_name": "foxylib.tools.log.foxylib_logger.FoxylibLogger.attach_stderr2loggers", "line_number": 20, "usage_type": "call" }, { "api_name": "foxylib.tools.log.foxylib_logger.FoxylibLogger", "line...
331179964
import bpy import math from math import pi def run(origin): #Add a single chain link to the scene bpy.ops.mesh.primitive_torus_add( #major_radius = 1, #minor_radius = 0.25, major_segment = 12, minor_segment = 8, abso_major_rad = 1, abso_minor_rad = 0.6, l...
null
chain.py
chain.py
py
1,344
python
en
code
null
code-starcoder2
83
[ { "api_name": "bpy.ops.mesh.primitive_torus_add", "line_number": 7, "usage_type": "call" }, { "api_name": "bpy.ops", "line_number": 7, "usage_type": "attribute" }, { "api_name": "bpy.context", "line_number": 18, "usage_type": "attribute" }, { "api_name": "bpy.ops....
14164871
#!/usr/bin/env python # <<BEGIN-copyright>> # Copyright (c) 2016, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # Written by the LLNL Nuclear Data and Theory group # (email: mattoon1@llnl.gov) # LLNL-CODE-683960. # All rights reserved. # # This file is par...
null
bin/XMLtoHDF.py
XMLtoHDF.py
py
7,502
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.Counter", "line_number": 106, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 132, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 147, "usage_type": "call" }, { "api_name": "numpy.array", "lin...
391270564
from datetime import datetime as dt import numpy as np import os import pandas as pd import re import sys sys.path.append(os.path.dirname(os.path.realpath(__file__))) import smsclass import volatile.memory as mem import dynadb.db as db #------------------------------------------------------------------------------ c...
null
gsm/smsparser2/subsurface.py
subsurface.py
py
25,506
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number...
259632825
# Initialize connection with rest of lib from utils import * from DL_ClassifierModel import * import os import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from pathlib import Path data = 'data/mtb/protcase_1a.txt' model_path = 'pEmb_model_958.pkl' # # if data=="celegans" or data=="human": # ...
null
predict_mtb.py
predict_mtb.py
py
3,131
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.walk", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path", "line_number": 33, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 3...
339735720
#! /usr/bin/python # -*- coding: utf-8 -*- from collections import ChainMap from ..utils.constants import C __author__ = 'fyabc' class GameEntity: """The base class of all game entities.""" def __init__(self): # oop(Order Of Play). # All game entities have this attribute, and share the sam...
null
HearthStone2/HearthStone/game/game_entity.py
game_entity.py
py
1,605
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.ChainMap", "line_number": 36, "usage_type": "call" }, { "api_name": "utils.constants.C.Game", "line_number": 39, "usage_type": "attribute" }, { "api_name": "utils.constants.C", "line_number": 39, "usage_type": "name" } ]
36041535
from flask import Flask, request from crossdomain import crossdomain import db import config import json import logging from daemonizer import Daemon import time conf = config.getConfig() database = False app = Flask(__name__) secret=conf["karmaServer"]["secret"] karmaWaiting = {} karmaGivers = {} karmaTickets = {} ...
null
src/dk.py
dk.py
py
5,114
python
en
code
null
code-starcoder2
83
[ { "api_name": "config.getConfig", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 24, "usage_type": "call" }, { "api_name": "crossdomain.crossdomain", ...
516428227
# Author: R. C. Howell # Python 2.7.10 # Generating GLJ textual encodings of board positions # GLJ for the last names of Debasis Ganguly, Johannes Leveling, and Gareth J. F. Jones # Textual encoding based upon their 'Retrieval of Similar Chess Positions' paper written at Dublin City University School of Computing impo...
null
position_analysis/genGLJ.py
genGLJ.py
py
2,689
python
en
code
null
code-starcoder2
83
[ { "api_name": "chess.file_index", "line_number": 17, "usage_type": "call" }, { "api_name": "chess.rank_index", "line_number": 18, "usage_type": "call" }, { "api_name": "chess.file_index", "line_number": 19, "usage_type": "call" }, { "api_name": "chess.rank_index",...
205602357
# -*- coding:utf-8 -*- from __future__ import division #除数可以显示为float from six import StringIO #使用聚宽readfile函数 import time #使用time stamp import datetime import matplotlib.pyplot as plt import math import talib import numpy as np import pandas as pd # 功能:从聚宽函数库中提取数据 # 输入: # st...
null
Logit/QuantLib.py
QuantLib.py
py
21,248
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.DataFrame", "line_number": 32, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 49, "usage_type": "call" }, { "api_name": "numpy.array", "line...
422608195
import dgl import numpy as np import torch as th import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch.multiprocessing as mp from torch.utils.data import DataLoader import dgl.function as fn import dgl.nn.pytorch as dglnn import time import math import argparse from _thread impo...
null
GNS_sampling_prob.py
GNS_sampling_prob.py
py
22,810
python
en
code
null
code-starcoder2
83
[ { "api_name": "math.log", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 28, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 28, "usage_type": "name" }, { "api_name": "torch.nn.ModuleList", "lin...
106902593
from django.shortcuts import render from rest_framework import status from rest_framework.response import Response from shopify.models import Account, Products, Categories, AccountType, Vendor from .serializers import AccountSerializer, ProductsSerializer, CategoriesSerializer, AccountTypeSerializer, VendorSerializer f...
null
apis/views.py
views.py
py
10,677
python
en
code
null
code-starcoder2
83
[ { "api_name": "rest_framework.views.APIView", "line_number": 22, "usage_type": "name" }, { "api_name": "django.http.HttpResponse", "line_number": 27, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 27, "usage_type": "call" }, { "api_name": "merc...
77266114
from django.core.management.base import BaseCommand from django.db import transaction from guardian.shortcuts import assign_perm import factory.random from metaci import conftest as fact from metaci.users.models import User from metaci.testresults.models import TestResult from django.contrib.auth.models import Grou...
null
metaci/db/management/commands/populate_db.py
populate_db.py
py
2,980
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 19, "usage_type": "name" }, { "api_name": "metaci.users.models.User.objects.count", "line_number": 43, "usage_type": "call" }, { "api_name": "metaci.users.models.User.objects", "line_number": 43, "usa...
91058936
class TwoSum(object): def __init__(self): from collections import Counter self.num_counts = Counter() def add(self, number): self.num_counts[number] += 1 def find(self, value): for num in self.num_counts: comple = value - num min_multiplicity = 2 if num == comple else 1 if (sel...
null
solutions/170/hash_table_linear_space.py
hash_table_linear_space.py
py
525
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.Counter", "line_number": 4, "usage_type": "call" }, { "api_name": "{'Counter': 'collections.Counter'}", "line_number": 22, "usage_type": "call" } ]
37594897
# Copyright 2016 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
null
filesystems/vnx_rootfs_lxc_ubuntu64-16.04-v025-openstack-compute/rootfs/usr/lib/python2.7/dist-packages/oslo_messaging/_drivers/pika_driver/pika_connection.py
pika_connection.py
py
19,484
python
en
code
null
code-starcoder2
83
[ { "api_name": "oslo_utils.eventletutils.fetch_current_thread_functor", "line_number": 27, "usage_type": "call" }, { "api_name": "oslo_utils.eventletutils", "line_number": 27, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 29, "usage_type": "call...
367854056
import sys import argparse from sole import square_root # Разбор входных параметров. def argparser(): parser = argparse.ArgumentParser(description='Solving the systems of linear equations by square root method. Version 1.0.0.0.') # разбор файлов parser.add_argument('source', type=argparse.FileType(...
null
sole/test_sole_sqroot.py
test_sole_sqroot.py
py
2,733
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "argparse.FileType", "line_number": 9, "usage_type": "call" }, { "api_name": "sole.square_root", "line_number": 20, "usage_type": "call" } ]
629156770
from __future__ import annotations from collections import defaultdict from typing import Union, Collection, List, Dict, Tuple, Any from functools import total_ordering import networkx as nx from dere.taskspec import TaskSpecification, SpanType, FrameType from dere.corpus import Corpus, Instance, Frame, Span _SFType...
null
dere/evaluation.py
evaluation.py
py
14,192
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.Union", "line_number": 11, "usage_type": "name" }, { "api_name": "dere.taskspec.SpanType", "line_number": 11, "usage_type": "name" }, { "api_name": "dere.taskspec.FrameType", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Li...
262777599
import pinocchio as pio from example_robot_data import loadSolo import hppfcl import numpy as np import matplotlib.pyplot as plt import time from numpy.linalg import norm from solo12_legs_collisions_utils import initSolo, addCapsule robot, rmodel, rdata, gmodel, gdata = initSolo() robot_config = np.zeros(robot.q0.shap...
null
src/python/solo12_legs_collisions_main.py
solo12_legs_collisions_main.py
py
3,370
python
en
code
null
code-starcoder2
83
[ { "api_name": "solo12_legs_collisions_utils.initSolo", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 51, "usage_type": "call" }, { "api_name": "numpy.a...
508073139
from selenium import webdriver import os from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait import selenium.webdriver.support.expected_conditions as EC from selenium.common.exceptions import TimeoutException from selenium.common.exceptions import NoSuchElementException f...
null
tools/LexScrape.py
LexScrape.py
py
6,405
python
en
code
null
code-starcoder2
83
[ { "api_name": "selenium.webdriver.Firefox", "line_number": 36, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 36, "usage_type": "name" }, { "api_name": "os.system", "line_number": 101, "usage_type": "call" }, { "api_name": "selenium.web...
73310669
''' committeeScrape.py is used to scrape the static DC Gov committee webpages for the staff contact information. Libraries Used: Requests, bs4 |Signature-------------------------------------------| |Written for DC Policy Center by Michael Watson; 2017| |www.DCPolicyCenter.org / DC-Policy-Center.github.io | |github:M-...
null
committeeScrape.py
committeeScrape.py
py
5,711
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 54, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 55, "usage_type": "call" } ]
202433384
# -*- coding: utf-8 -*- from flask import Flask, render_template, request, abort, redirect, Response, url_for import json import requests import base64 import re from flask import stream_with_context from user_agents import parse from werkzeug.contrib.cache import SimpleCache from NEMbox.api import NetEase, geturl_new...
null
app.py
app.py
py
3,819
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "NEMbox.api.NetEase", "line_number": 14, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 45, "usage_type": "call" }, { "api_name": "NEMbox.api.geturl_new_api", ...
240099866
#!/venv/bin python import os from flask import Flask, Blueprint, current_app, render_template from torch.nn.functional import softmax from pnasnet import pnasnet5 from resnet import resnet50, resnet152 import utils image_classifier = Blueprint('image_classifier', __name__) app = Flask(__name__) model_links = { ...
null
webapp/pytorch_classifier.py
pytorch_classifier.py
py
3,747
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Blueprint", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 15, "usage_type": "call" }, { "api_name": "pnasnet.pnasnet5", "line_number": 28, "usage_type": "call" }, { "api_name": "resnet.resnet152", "...
530982196
"""This module implements an abstract base class (ABC) 'BaseDataset' for datasets. It also includes common transformation functions (e.g., get_transform, __scale_width), which can be later used in subclasses. """ import random import numpy as np import torch import librosa import audioread import soundfile as sf impo...
null
styletransfer/data/base_dataset.py
base_dataset.py
py
4,198
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.utils.data.Dataset", "line_number": 22, "usage_type": "attribute" }, { "api_name": "torch.utils.data", "line_number": 22, "usage_type": "name" }, { "api_name": "abc.ABC", "line_number": 22, "usage_type": "name" }, { "api_name": "abc.abstractme...
295620701
# Copyright 2020 CSIRO # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software ...
null
platipy/dicom/nifti_to_rtstruct/convert.py
convert.py
py
3,517
python
en
code
null
code-starcoder2
83
[ { "api_name": "loguru.logger.info", "line_number": 31, "usage_type": "call" }, { "api_name": "loguru.logger", "line_number": 31, "usage_type": "name" }, { "api_name": "loguru.logger.info", "line_number": 44, "usage_type": "call" }, { "api_name": "loguru.logger", ...
476869485
"""mysite3 URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based...
null
3-mouth04/day04/mysite3/mysite3/urls.py
urls.py
py
1,227
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.urls.path", "line_number": 22, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 22, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 22, "usage_type": "name" }, { "api_name": "...
284157046
""" (VERSION 1) User creation, deletion, update and query tests """ import pytest from unittest.mock import ANY from falcon import HTTP_200, HTTP_204, HTTP_404, HTTP_422 from users.tests.test_api import BaseUserTestCase VERSION_URL = 'v1' PATH = '/{}/users'.format(VERSION_URL) @pytest.mark.apiv1 class UserP...
null
api/users/tests/v1/test_api_v1.py
test_api_v1.py
py
4,591
python
en
code
null
code-starcoder2
83
[ { "api_name": "users.tests.test_api.BaseUserTestCase", "line_number": 19, "usage_type": "name" }, { "api_name": "falcon.HTTP_204", "line_number": 29, "usage_type": "name" }, { "api_name": "falcon.HTTP_200", "line_number": 40, "usage_type": "name" }, { "api_name": ...
550089785
# This program will take the data that is provided from the # Government of Alberta and put the data into .db file. # This data will later be used to create data visualizations. import os import sys import requests import sqlite3 as sql import pandas as pd def get_data_from_web(url): # This function ...
null
Alberta/createCovidDB.py
createCovidDB.py
py
6,009
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.exists", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.remove", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.get", "line_number...
421000478
# -*- coding:utf-8 -*- __author__ = 'yfj' __date__ = '2019/5/22 23:07' from matplotlib import pyplot as plt import numpy as np import mpl_toolkits.axisartist as axisartist from matplotlib.ticker import MultipleLocator, FuncFormatter import matplotlib.font_manager as fm import pandas as pd import math import numpy as n...
null
DNN/DeepCA-2C/A_draw.py
A_draw.py
py
1,516
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.font_manager.FontProperties", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.font_manager", "line_number": 15, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 17, "usage_type": "call" }, { "ap...
181700441
from typing import Any, Callable, List, Dict, Union, Optional, Sequence, Tuple from numpy import ndarray from collections import OrderedDict from scipy import sparse import os import sklearn import numpy import typing # Custom import commands if any import warnings import numpy as np from sklearn.utils import check_ar...
null
tods/detection_algorithm/PyodMoGaal.py
PyodMoGaal.py
py
10,021
python
en
code
null
code-starcoder2
83
[ { "api_name": "d3m.container.DataFrame", "line_number": 40, "usage_type": "name" }, { "api_name": "d3m.container.DataFrame", "line_number": 41, "usage_type": "name" }, { "api_name": "UODBasePrimitive.Params_ODBase", "line_number": 45, "usage_type": "name" }, { "ap...
23465603
import matplotlib.pyplot as plt import numpy as np data = np.genfromtxt('../Output/RF/RF_QuBit_AmpVSPhiBar_1.txt',delimiter=' ') x=data[:,0] y=data[:,1] z=data[:,2] x=np.unique(x) y=np.unique(y) X,Y = np.meshgrid(x,y) Z=z.reshape(len(y),len(x)) plt.pcolormesh(X,Y,Z) plt.show()
null
Legacy/src/plotting_Heatmap.py
plotting_Heatmap.py
py
282
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.genfromtxt", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.meshgrid", "line_...
571650902
import numpy as np from sklearn import svm from sklearn.metrics import roc_auc_score from makeData import getCVData # number of cross validation folds n = 5 # params kernels = ['linear', 'poly', 'rbf', 'sigmoid'] nus = np.round(np.arange(0.01,1.01,0.01),2) # create range from 0.01 to 1.00 with 0.01 step for kernel ...
null
Homeworks/hw3/p1.py
p1.py
py
1,350
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.round", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 14, "usage_type": "call" }, { "api_name": "makeData.getCVData", "line_n...
246077739
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier (Camptocamp) # Author: Vincent Renaville # Copyright 2012 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
null
__unported__/hr_timesheet_fulfill/wizard/timesheet_fulfill.py
timesheet_fulfill.py
py
6,768
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.strptime", "line_number": 29, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 29, "usage_type": "name" }, { "api_name": "datetime.datetime.strptime", "line_number": 30, "usage_type": "call" }, { "api_name"...
62886221
import pandas as pd import pickle from cili.util import * from cili.cleanup import * from os.path import isfile, join from os import listdir from pprint import pprint from copy import deepcopy import statistics as stat from random import random import matplotlib.pyplot as plt import math from scipy import stats from sk...
null
Old_Files/EyeLinkReader_OLD.py
EyeLinkReader_OLD.py
py
40,364
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.ExcelFile", "line_number": 57, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 87, "usage_type": "call" }, { "api_name": "pandas.ExcelFile", "line_number": 91, "usage_type": "call" }, { "api_name": "os.listdir", "li...
168823615
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import sys import string from z3 import * path = input() with open(path, 'r') as f: dieta = json.load(f) s = Solver() zmienne = [] for parametr in dieta["parametry"]: zmienne.clear() for skladnik in dieta[u"składniki"]: ZS = [Int(skladnik...
null
Zad3/zad3.py
zad3.py
py
1,617
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.load", "line_number": 11, "usage_type": "call" } ]
38891585
# -*- coding: utf-8 -*- from decimal import ROUND_DOWN from marshmallow import Schema, fields, validate, EXCLUDE class DIDSchema(Schema): """ Represents and handles a did interaction through api """ class Meta: unknown = EXCLUDE id = fields.UUID(dump_only=True) value = fields.Strin...
null
app/modules/dids/schemas.py
schemas.py
py
1,114
python
en
code
null
code-starcoder2
83
[ { "api_name": "marshmallow.Schema", "line_number": 8, "usage_type": "name" }, { "api_name": "marshmallow.EXCLUDE", "line_number": 14, "usage_type": "name" }, { "api_name": "marshmallow.fields.UUID", "line_number": 16, "usage_type": "call" }, { "api_name": "marshma...
46069114
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import logging import StringIO import re import locale import cgi import datetime import oauth import locale import calendar from email.utils import parseaddr from google.appengine.ext.webapp import template from google.appengine.ext import webapp from ...
null
main.py
main.py
py
11,197
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "google.appengine.ext.db.Model", "line_number": 34, "usage_type": "attribute" }, { "api_name": "googl...
388816882
#%% from matplotlib import use from tensorflow.python.keras.layers.core import Dropout from tensorflow.python.ops.gen_array_ops import Reshape import get_dataset from datetime import date import numpy as np from pandas import DataFrame from sklearn.model_selection import train_test_split device_keys_table = get_datase...
null
train.py
train.py
py
3,966
python
en
code
null
code-starcoder2
83
[ { "api_name": "get_dataset.get_device_keys_table", "line_number": 11, "usage_type": "call" }, { "api_name": "get_dataset.get_event_keys_table", "line_number": 12, "usage_type": "call" }, { "api_name": "get_dataset.get_XY_between_date", "line_number": 17, "usage_type": "ca...
236096244
import numpy as np import scipy.optimize as spo import scipy.stats as sps from myquant.derivative import * import time class EGarch(): def __init__(self, x, ar = 0, ma = 0, beta = 1, omega = 1, mid = True,seed = 1000): self.x = x self.ar = ar self.ma = ma self.beta ...
null
myquant/egarch.py
egarch.py
py
6,064
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.random.RandomState", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.std", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.max", ...
399528535
import RPi.GPIO as GPIO import time from itertools import cycle from flask import Flask, render_template app = Flask(__name__) state_cycle = cycle(['on', 'off']) GPIO.setmode(GPIO.BOARD) GPIO.setup(12, GPIO.OUT) @app.route('/') def index(): return render_template('index.html') @app.route('/<state>') def updat...
null
app.py
app.py
py
728
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "itertools.cycle", "line_number": 7, "usage_type": "call" }, { "api_name": "RPi.GPIO.setmode", "line_number": 10, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_numbe...
221890537
import sys import time import numpy as np from optparse import OptionParser from deep_sea_treasure import DeepSeaTreasure from agent import DCRACSAgent, DCRACAgent, DCRACSEAgent, DCRAC0Agent, CNAgent, CN0Agent from utils import mkdir_p, get_weights_from_json from stats import rebuild_log, print_stats, compute_log AGE...
null
main_dst.py
main_dst.py
py
6,086
python
en
code
null
code-starcoder2
83
[ { "api_name": "agent.DCRACAgent", "line_number": 12, "usage_type": "name" }, { "api_name": "agent.DCRACSAgent", "line_number": 13, "usage_type": "name" }, { "api_name": "agent.DCRACSEAgent", "line_number": 14, "usage_type": "name" }, { "api_name": "agent.DCRAC0Age...
416307661
import json import platform import tempfile from distutils import dir_util from pathlib import Path from typing import Any, Dict, Optional from docker.types import Mount from lean.components.docker_manager import DockerManager from lean.components.lean_config_manager import LeanConfigManager from lean.components.logg...
null
lean/components/lean_runner.py
lean_runner.py
py
10,331
python
en
code
null
code-starcoder2
83
[ { "api_name": "lean.components.logger.Logger", "line_number": 19, "usage_type": "name" }, { "api_name": "lean.components.lean_config_manager.LeanConfigManager", "line_number": 20, "usage_type": "name" }, { "api_name": "lean.components.docker_manager.DockerManager", "line_numb...
554372236
from src.utils import data_util import matplotlib.pyplot as plt util = data_util.DataUtil() i = 0 batch_size = 8 batches = util.batches_for_gen_with_label(batch_size) for batch in batches: if i < 1: for j in range(batch_size): batch[0][j, :, :, :] += 1 batch[0][j, :, :, :] *= 127...
null
src/model/test_input.py
test_input.py
py
732
python
en
code
null
code-starcoder2
83
[ { "api_name": "src.utils.data_util.DataUtil", "line_number": 4, "usage_type": "call" }, { "api_name": "src.utils.data_util", "line_number": 4, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.imshow", "line_number": 21, "usage_type": "call" }, { "api_name"...
102955627
#!/usr/bin/env pypy # -*- coding: utf-8 -*- # c.durr - swerc - 2017 """ Candy Stick ? (word_search) dynamic programming in time O(N^3 L) where N is the length of the candy stick and L is the total length over all words in the dictionary. = Definitions = A[i] = maximal score one can obtain from stick[i:] without nec...
null
SWERC/swerc2017/swerc/candychain/submissions/accepted/word_search.py
word_search.py
py
4,153
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.version_info", "line_number": 89, "usage_type": "attribute" }, { "api_name": "sys.version_info", "line_number": 90, "usage_type": "attribute" }, { "api_name": "collections.defaultdict", "line_number": 128, "usage_type": "call" } ]
245070938
import requests import json import pandas as pd from bs4 import BeautifulSoup import numpy as np otg_vendor_page = "http://offthegridsf.com/vendors#food" event_request_limit = 1000 def get_all_vendor_names(): r_otg_vendors = requests.get(otg_vendor_page) soup = BeautifulSoup(r_otg_vendors.text, 'html.parser...
null
foodtrucksite/foodtrucks/get_list_of_events.py
get_list_of_events.py
py
1,701
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "requests.get", "line_...
540724663
import scrapy from ..items import RealityItem import re from .. import utils class TalandaInvestSpider(scrapy.Spider): name = 'talanda_invest' start_urls = [ 'https://www.talanda-invest.cz/nemovitosti?start=0&limit=30', ] default_email = 'info@talanda-invest.cz' def parse(self, response):...
null
reality/reality/spiders/talanda_invest_spider.py
talanda_invest_spider.py
py
4,859
python
en
code
null
code-starcoder2
83
[ { "api_name": "scrapy.Spider", "line_number": 7, "usage_type": "attribute" }, { "api_name": "items.RealityItem", "line_number": 20, "usage_type": "call" }, { "api_name": "scrapy.Request", "line_number": 28, "usage_type": "call" }, { "api_name": "re.sub", "line...
292741934
from __future__ import absolute_import from __future__ import division from __future__ import print_function from six.moves import xrange import numpy as np from util import log from model import Model from input_ops import create_input_ops, check_data_id from PIL import Image import tensorflow as tf import time im...
null
evaler.py
evaler.py
py
16,606
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.sum", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.prod", "line_number": 36, "usage_type": "call" }, { "api_name": "util.log.info", "line_number": 39,...
572214319
#!/usr/bin/env python from label_db import LabelDB import os os.chdir("/home/cam/Documents/PHS3350") from utils import best_classifications os.chdir("bnn_for_seals") seal_db = LabelDB(label_db_file='seal_data/labels.db') seal_db.create_if_required() files = os.listdir("seal_data/all_images_seals") # add each coord...
null
bnn_for_seals/seal_label_db.py
seal_label_db.py
py
727
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.chdir", "line_number": 5, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 7, "usage_type": "call" }, { "api_name": "label_db.LabelDB", "line_number": 9, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 12, ...
288837107
import logging import os import pathlib import typing import itertools from graphql import ( GraphQLSchema, GraphQLUnionType, DocumentNode, parse, build_ast_schema, extend_schema, concat_ast, is_type_extension_node, is_type_system_extension_node, is_type_definition_node, ) LOG ...
null
cannula/schema.py
schema.py
py
3,629
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "graphql.parse", "line_number": 21, "usage_type": "call" }, { "api_name": "graphql.parse", "line_number": 22, "usage_type": "call" }, { "api_name": "graphql.DocumentNode", ...
405136826
from pyspark.sql import SparkSession from io import StringIO import csv import time import sys # Start counting execution time start_time = time.time() def split_complex(x): return list(csv.reader(StringIO(x), delimiter=','))[0] def split_year(x): return x[3].split("-")[0] def return_5years_period(year):...
null
deliverables/code/query_4_rdd.py
query_4_rdd.py
py
2,117
python
en
code
null
code-starcoder2
83
[ { "api_name": "time.time", "line_number": 8, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 12, "usage_type": "call" }, { "api_name": "io.StringIO", "line_number": 12, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder.appN...
396336052
import cv2 import numpy as np #/*! 为了绘制一个圆形,我们使用 cv2.circle 函数。我们传递 x,y,半径大小,RGB 颜色,深 */ #/*! 度作为参数*/ img = cv2.imread("image.jpg") print(img.shape) # cv2.circle(img,(x,y),radius,(R,G,B),THICKNESS) # x:距x轴的距离 # y:与y轴的距离 # radius:半径大小(整数) # R,G,B:RGB形式的颜色(255,255,0) # 厚度:矩形的厚度(整数) cv2.circle(img, (200, 130), 90, (255...
null
01_OpenCV常用的 7 个示例:从读取到人脸检测(Python版)/01_12_圆形/main.py
main.py
py
534
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.circle", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 20, ...
103549835
"""Model Wrapper """ import json import logging import os import threading import time import traceback import cv2 import numpy as np import onnxruntime import requests from shapely.geometry import Polygon from exception_handler import PrintGetExceptionDetails from object_detection import ObjectDetection from onnxru...
null
factory-ai-vision/EdgeSolution/modules/PredictModule/model_wrapper.py
model_wrapper.py
py
6,566
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ.get", "line_number": 28, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 29, "usage_type": "call" }, { "api_name": "os.environ", "line_...
218393524
from argparse import Namespace from helpers.checkpoint import Checkpoint from helpers import st_gumbel_softmax from torch.autograd import Variable from helpers.initialization import weights_init_xavier from helpers.logger import Logger from helpers import data_loader from datetime import datetime import torch.nn as n...
null
src/models/dcggan/dcggan.py
dcggan.py
py
7,418
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.abspath", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.getcwd", "line_numbe...
74834635
#! /usr/bin/env python # -*- coding: utf-8 -*- # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following...
null
test/unit/test_plate.py
test_plate.py
py
5,927
python
en
code
null
code-starcoder2
83
[ { "api_name": "xml.etree.ElementTree.register_namespace", "line_number": 31, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 31, "usage_type": "name" }, { "api_name": "ome_model.experimental.Plate", "line_number": 41, "usage_type": "call" }...
546730984
from datetime import datetime import random import string import mysql.connector class nodePresentSeeder: def __init__(self, db_client, node_count_per_floor, floor_count): self.db_client = db_client self.cursor = db_client.cursor self._node_count_per_floor = node_count_per_floor sel...
null
python/seeder/nodePresentSeeder.py
nodePresentSeeder.py
py
2,074
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.utcnow", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "name" }, { "api_name": "random.choice", "line_number": 15, "usage_type": "call" }, { "api_name": "string.ascii...
216766418
import os from PIL import Image import boto3 from boto3.s3.transfer import S3Transfer import tempfile from boto3.session import Session print("start") session = Session(aws_access_key_id='', aws_secret_access_key='', region_name='ap-northeast-1') print("s3") s3 = session.resource("s3") print("images-f...
null
image_resize/function.py
function.py
py
1,304
python
en
code
null
code-starcoder2
83
[ { "api_name": "boto3.session.Session", "line_number": 8, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 15, "usage_type": "call" }, { "api_name": "boto3.s3.transfer.S3Transfer", "line_number": 17, "usage_type": "call" }, { "api_name": "tempfi...
108059616
#!/usr/bin/env python3 import zmq from random import randint import threading SVR_ADDR = 'tcp://localhost:7150' BACKEND_ADDR = 'inproc://backend' def LOG(*args): with open("async_dealer2router.log", 'a') as fd: fd.write("%s: %s\n" % (threading.current_thread().name, str(args))) def run_client(): g...
null
tests/py/async_dealer2router.py
async_dealer2router.py
py
2,001
python
en
code
null
code-starcoder2
83
[ { "api_name": "threading.current_thread", "line_number": 13, "usage_type": "call" }, { "api_name": "zmq.Context", "line_number": 19, "usage_type": "call" }, { "api_name": "zmq.DEALER", "line_number": 20, "usage_type": "attribute" }, { "api_name": "zmq.IDENTITY", ...
141915038
from __future__ import print_function import ast import datetime import json import glob import locale import logging import operator as op import os import re import socket import select import shlex import sys import time from functools import wraps from subprocess import Popen, PIPE from itertools import chain imp...
null
lib/rcUtilities.py
rcUtilities.py
py
46,648
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path", "line_number": 31, "usage_type": "attribute" }, { "api_name": "rcGlobalEnv.rcEnv.paths", "line_number": 31, "usage_type": "attribute" }, { "api_name": "rcGlobalEnv.rc...
87162835
import enum import asyncio import websockets import traceback import pycommons.logger import maxwell.protocol.maxwell_protocol_pb2 as protocol_types import maxwell.protocol.maxwell_protocol as protocol from maxwell.listenable import Listenable logger = pycommons.logger.get_instance(__name__) class Code(enum.Enum): ...
null
maxwell/connection.py
connection.py
py
9,437
python
en
code
null
code-starcoder2
83
[ { "api_name": "pycommons.logger.logger.get_instance", "line_number": 10, "usage_type": "call" }, { "api_name": "pycommons.logger.logger", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pycommons.logger", "line_number": 10, "usage_type": "name" }, { ...
306859109
import numpy as np from textwrap import wrap import matplotlib.pyplot as plt import matplotlib.animation as animation from mpl_toolkits.basemap import Basemap from mpl_toolkits.axes_grid.inset_locator import inset_axes plt.clf() def dataloader(name = "signif.txt"): data = np.genfromtxt(name, delimiter="\t", usecol...
null
Unit 1_Earthquakes/What Can You Do With Python/DemoAnimation.py
DemoAnimation.py
py
2,458
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.clf", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 8, "usage_type": "name" }, { "api_name": "numpy.genfromtxt", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.where", ...
488535766
import os import sys import xml.etree.ElementTree as et def main(): filepath = 'save.txt' if not os.path.exists(filepath): print('Error: File does not exist') sys.exit() tree = et.parse('save.txt') root = tree.getroot() for item in root.findall('player/craftingRecip...
null
sv-crafting/crafting.py
crafting.py
py
694
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.exists", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 10, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree.parse", ...
97575059
#!/usr/bin/python3 import cv2 import imutils img = cv2.imread("../tmp/3.png", cv2.IMREAD_COLOR) cv2.imshow("before", img) gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) cv2.imshow("gray", gray) # 骨架化, size 为 结构元素内核大小 skeleton = imutils.skeletonize(gray, size=(3, 3)) cv2.imshow("after", skeleton) cv2.wai...
null
basics_raspberry/5-learn.py
5-learn.py
py
378
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.IMREAD_COLOR", "line_number": 6, "usage_type": "attribute" }, { "api_name": "cv2.imshow", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_num...
426724202
import base64 from mock import patch import unittest from stacker.lookups.handlers.kms import handler class TestKMSHandler(unittest.TestCase): def setUp(self): patcher = patch("botocore.session") self.addCleanup(patcher.stop) self.session = patcher.start() self.kms = self.session...
null
stacker/tests/lookups/handlers/test_kms.py
test_kms.py
py
998
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "mock.patch", "line_number": 11, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_number": 15, "usage_type": "call" }, { "api_name": "stacker.lookups.han...
594493367
import cv2 import numpy as np img = cv2.imread("imori.jpg") img = img.astype(np.float32) size = 8 for i in range(len(img)//size): for j in range(len(img[i])//size): s = np.array([0.0, 0.0, 0.0]) for k in range(size): for l in range(size): s += img[i*size+k, j*size+l] ...
null
Question_01_10/my_answer_07.py
my_answer_07.py
py
451
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 5, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_numbe...
489915240
""" Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to ...
null
src/cfnlint/rules/resources/properties/ImageId.py
ImageId.py
py
3,077
python
en
code
null
code-starcoder2
83
[ { "api_name": "cfnlint.rules.CloudFormationLintRule", "line_number": 21, "usage_type": "name" }, { "api_name": "cfnlint.rules.RuleMatch", "line_number": 56, "usage_type": "call" }, { "api_name": "cfnlint.rules.RuleMatch", "line_number": 60, "usage_type": "call" } ]
495013759
from mako.template import Template import os import subprocess from django.db.models import ProtectedError import configlet from constants import * import fabric from ignite.settings import REPO_PATH from models import Configlet, Profile from pool.pool import allocate_pool_entry, update_pool_ref_count from utils.exce...
null
config/profile.py
profile.py
py
5,988
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "models.Profile.objects.filter", "line_number": 22, "usage_type": "call" }, { "api_name": "models.Profile.objects", "line_number": 22, "usage_type": "attribute" }, { "api_n...
163102097
#------------------Bombermans Team---------------------------------# # Author : B3mB4m # Concat : b3mb4m@protonmail.com # Project : https://github.com/b3mb4m/Shellsploit # LICENSE : https://github.com/b3mb4m/Shellsploit/blob/master/LICENSE #------------------------------------------------------------------# import ...
null
shell/control.py
control.py
py
44,212
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.version_info", "line_number": 16, "usage_type": "attribute" }, { "api_name": "lib.base.framework.ShellsploitFramework", "line_number": 20, "usage_type": "name" }, { "api_name": "lib.base.framework.ShellsploitFramework.__init__", "line_number": 23, "usag...
16564188
import time import redis class RedisLock(object): def __init__(self, key): # redis的连接,官方推荐ssshi用StrictRedis,而不是Redis self.rdcon = redis.StrictRedis(host='127.0.0.1', port=6379, password="", db=1, decode_responses=True) print(id(self.rdcon)) # False代表未加锁,True代表加锁了 self._lock...
null
python_redis_lock.py
python_redis_lock.py
py
2,172
python
en
code
null
code-starcoder2
83
[ { "api_name": "redis.StrictRedis", "line_number": 8, "usage_type": "call" }, { "api_name": "time.time", "line_number": 20, "usage_type": "call" }, { "api_name": "time.time", "line_number": 26, "usage_type": "call" }, { "api_name": "time.time", "line_number": 2...
224378750
import streamlit as st import pandas as pd import numpy as np import matplotlib.pyplot as plt import pandas_datareader as web import datetime from datetime import date def annualized_return(Df, nb_of_year): Df = Df[::-1].reset_index() last_value = Df['Adj Close'][0] first_value = Df['Adj...
null
streamlit_test.py
streamlit_test.py
py
993
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.DataFrame", "line_number": 18, "usage_type": "call" }, { "api_name": "streamlit.number_input", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 24, "usage_type": "call" }, { "api_name": "datetim...
472644700
##load dataset from sklearn.datasets import load_digits digits = load_digits() data = digits.data labels = digits.target ## split data from sklearn.model_selection import train_test_split x_train, x_test, y_train, y_test = train_test_split(data, labels, test_size=0.25, random_state=0) ##model from sklearn.linear_mo...
null
machine_learning/logistic.py
logistic.py
py
501
python
en
code
null
code-starcoder2
83
[ { "api_name": "sklearn.datasets.load_digits", "line_number": 3, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 10, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LogisticRegression", "line_number": 14, "usage_...
365650328
# """ If you want to make a picture using a name """ from wordcloud import STOPWORDS as EN_STOPWORDS from wordcloud import ImageColorGenerator from stopword_persian import stopword_persian as STOPWORDS from wordcloud_fa import WordCloudFa from hazm import Normalizer ##import nltk # Natural Language ToolK...
null
Twitter/Back Up/cloudword.py
cloudword.py
py
3,489
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number": 29, "usage_type": "name" }, { "api_name": "os.getcwd", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 3...
75151630
#!/usr/bin/python from __future__ import print_function from lxml import etree import re import os import sys # xml parser for wiki species, using Xpath def xml_iter(context, func, f): # Liza Daly: High-performance XML parsing in Python with lxml article on IBM.com for event, node in context: func(n...
null
species_parser.py
species_parser.py
py
3,020
python
en
code
null
code-starcoder2
83
[ { "api_name": "re.sub", "line_number": 30, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 34, "usage_type": "call" }, { "api_name": "re.I", "line_number": 34, "usage_type": "attribute" }, { "api_name": "re.findall", "line_number": 58, "...
323881295
#!/usr/bin/env python ''' @author David Stuebe <dstuebe@asasscience.com> @file pystoch.py @date 03/11/13 @description Main program to calculate probability grids for stochastic oil model results. Max/Linux Command Line Examples (from the pystoch directory): ./pystoch_main.py -p ./trajectory_data/simap/3D_TEST1 -x 3D_T...
null
pystoch/pystoch/pystoch_main.py
pystoch_main.py
py
3,227
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 37, "usage_type": "call" }, { "api_name": "pystoch.command_line_arguments.get_command_line_arguments", "line_number": 52, "usage_type": "call" }, { "api_name": "pystoch.config.Config", "line_number": 55, "usage_type": "cal...
188478909
""" ResNet50 (C2D) for spatiotemporal task. Only ResNet50 backbone structure was implemented here. """ import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import math from functools import partial from models.non_local import NLBlockND class Bottleneck(nn.Module): ...
null
3D_experiment/models/resnet3D.py
resnet3D.py
py
5,695
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.nn.Module", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.nn.Conv3d", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
351648220
"""Code for the book PySpark in Action, Chapter 4.""" # tag::relevant-imports[] import os import numpy as np from pyspark.sql import SparkSession import pyspark.sql.functions as F spark = SparkSession.builder.getOrCreate() # end::relevant-imports[] # tag::ch04-grocery-list[] my_grocery_list = [ ["Banana", 2,...
null
code/Ch04/book_code.py
book_code.py
py
10,967
python
en
code
null
code-starcoder2
83
[ { "api_name": "pyspark.sql.SparkSession.builder.getOrCreate", "line_number": 11, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 11, "usage_t...
1393581
''' Created on January 31, 2021 @author: pashaa@mskcc.org ''' import os, sys import shutil import requests from pathlib import Path from luna_core.common.config import ConfigSet from luna_core.common.constants import DATA_CFG, CONFIG_LOCATION, PROJECT_LOCATION from luna_pathology.common.slideviewer_client import get_s...
null
tests/luna_pathology/common/test_slideviewer_client.py
test_slideviewer_client.py
py
5,539
python
en
code
null
code-starcoder2
83
[ { "api_name": "luna_core.common.config.ConfigSet", "line_number": 26, "usage_type": "call" }, { "api_name": "luna_core.common.constants.DATA_CFG", "line_number": 27, "usage_type": "name" }, { "api_name": "luna_core.common.config.ConfigSet", "line_number": 29, "usage_type"...
197404867
# coding:utf-8 import json import logging import pandas as pd import requests from variable import Constant """ 1. 查询股票代码和名称 """ def getStockInfo(): """ 查询stockInfo表中股票的代码,名称. :return: [('000001','平安银行'),...] """ stockInfo = [] try: api = Constant.SERVER_ROOT + 'stockSymbolAndNameI...
null
database/operateTool.py
operateTool.py
py
23,508
python
en
code
null
code-starcoder2
83
[ { "api_name": "variable.Constant.SERVER_ROOT", "line_number": 23, "usage_type": "attribute" }, { "api_name": "variable.Constant", "line_number": 23, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 24, "usage_type": "call" }, { "api_name": "var...
160798868
import boto3, datetime def getClusters(region): """ :return:dictionary of clusters in this account """ awsClient = boto3.client('redshift',region_name=region) clusters = awsClient.describe_clusters() clustersIdentifire={} for clusterIndex in range(len(clusters["Clusters"])): if clu...
null
Redshift/Check Redshift Cluster Automated Snapshots.py
Check Redshift Cluster Automated Snapshots.py
py
4,440
python
en
code
null
code-starcoder2
83
[ { "api_name": "boto3.client", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 23, "usage_type": "attribute" }, { "api_name": "datetime.tim...
621602
import numpy as np import scipy as sp import scipy.special def correlation_matern(rho, rho0, nu=2.5): """ Return correlation as evaluated by the Matern correlation function. https://en.wikipedia.org/wiki/Mat%C3%A9rn_covariance_function If nu = 0.5 then the Matern correlation function is equivalent to...
null
multi_loc/covariance.py
covariance.py
py
2,746
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.sqrt", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 29, "usage_type": "call" }, { "api_name": "scipy.special.kv", "line_number"...
281282667
import uuid from django.db import models from django.contrib.auth.models import User from django.core.exceptions import ValidationError class PizzaLover(models.Model): numberOfVotes = models.IntegerField(default=0) userID = models.ForeignKey(User, on_delete=models.CASCADE) def vote(self): ...
null
pizzaloversproject/back/models.py
models.py
py
955
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.models.Model", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 9, "usage_type": "name" }, { "api_name": "django.db.models.IntegerField", "line_number": 10, "usage_type": "call" }, { "api_name...
399300603
from django.conf.urls import include, url from . import views urlpatterns = [ url(r'^tasks$',views.list_tasks, name='list_tasks'), url(r'^tasks/<pk>$',views.edit_tasks, name='edit_tasks'), url(r'^tasks/add$',views.createTasks.as_view(), name='add_tasks'), url(r'^states/add$',views.add_states, name='add_states'), ...
null
tasks/urls.py
urls.py
py
1,663
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.urls.url", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.co...
344074181
from torch.nn.init import xavier_uniform_ from torch.nn import Module, ModuleList, Linear, ReLU, Sigmoid, Tanh, BatchNorm1d from torch.distributions import Normal import torch from GaussianLayer import GaussianLayer1 as GaussianLayer def init_weights(m): if type(m) == Linear: xavier_uniform_(m.weight, gai...
null
rl/models.py
models.py
py
4,154
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.nn.Linear", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.init.xavier_uniform_", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.nn...
576565368
import numpy as np import matplotlib.pyplot as plt import pandas as pd # Importing dataset dataset = pd.read_csv('diabetes.csv') X= dataset.iloc[:,:-1].values Y= dataset.iloc[:,-1].values # splitting the dataset into training set and test set from sklearn.model_selection import train_test_split X_train,X_test,Y_trai...
null
diabetes_SVM_random.py
diabetes_SVM_random.py
py
3,451
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 16, "usage_type": "call" ...
462789964
# encoding: utf-8 """ ROSE Lab's GTA ReID Dataset, v3 alpha. This is the train_long-full version, meaning that there is no separation between training set, query set and gallery set. The training set consists of all annotated images available. This is to facillitate cross domain experiments. """ from __future__ i...
null
idm/datasets/gta_long_2C_v2.py
gta_long_2C_v2.py
py
9,676
python
en
code
null
code-starcoder2
83
[ { "api_name": "utils.data.BaseImageDataset", "line_number": 12, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.path.join", ...