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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
538727202 | # -*- coding: utf-8 -*-
'''
Implements a correlated topic model, similar to that described by Blei
but using the Bouchard product of sigmoid bounds instead of Laplace
approximation.
Created on 17 Jan 2014
@author: bryanfeeney
'''
from math import log
from math import pi
from math import e
import time
from collecti... | null | sidetopics/model/ctm.py | ctm.py | py | 23,421 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.float32",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "math.log",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "math.log",
"line_number": 44,... |
500714832 | """`gen` tests under PEP 563."""
from __future__ import annotations
from attr import define
from cattr import GenConverter
from cattr.gen import make_dict_structure_fn, make_dict_unstructure_fn
# These need to be at the top level for `attr.resolve_types` to work.
@define
class Inner:
a: int
@define
class Oute... | null | tests/test_gen_dict_563.py | test_gen_dict_563.py | py | 897 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "attr.define",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "attr.define",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "attr.define",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "attr.define",
"line_number": ... |
602165233 | import cv2
import os
import numpy as np
import netCDF4 as nc
from matplotlib import pyplot as plt
import matplotlib
from matplotlib import cm
cdict = {'red': ((0.0, 0.0, 0.0),
(0.1, 0.5, 0.5),
(0.2, 0.0, 0.0),
(0.4, 0.2, 0.2),
(0.6, 0.0, 0... | null | head.py | head.py | py | 6,930 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.colors.LinearSegmentedColormap",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "matplotlib.colors",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 42,
"usage_type": "call"
},
{
"api_n... |
632842864 | """
PPO: Proximal Policy Optimization
Code used to load and test in an environment an already trained
agent (Policy)
Writen by David Alvarez Charris (david13.ing@gmail.com)
"""
import gym
import numpy as np
from gym import wrappers
from policy import Policy
from utils import Logger, Scaler
import os
import argparse
... | null | PPO_MTL_LunarLander/test.py | test.py | py | 8,592 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gym.make",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 59,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number":... |
570950428 | import torch
from models.mpcnn import MPCNN
class MPCNNCompHorizAbsOnlyVertU1(MPCNN):
def __init__(self, n_word_dim, n_holistic_filters, n_per_dim_filters, filter_widths, hidden_layer_units, num_classes, dropout, ext_feats, attention, wide_conv):
super(MPCNNCompHorizAbsOnlyVertU1, self).__init__(n_word_... | null | models/mpcnn_comp_horiz_abs_only_vert_u1.py | mpcnn_comp_horiz_abs_only_vert_u1.py | py | 1,812 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "models.mpcnn.MPCNN",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.cat",
"line_number": 33,
"usage_type": "call"
}
] |
507390853 | import builtins
import logging.config
from pathlib import Path
from flask import (
Flask,
request
)
from flask_admin import (
Admin,
AdminIndexView,
expose
)
from flask_basicauth import BasicAuth
##########################################################
# patch flask_admin, cause no support for pe... | null | webadmin/webadmin.py | webadmin.py | py | 12,852 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "peewee.Field.model_class",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "peewee.Field",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "core.utils.lo... |
531635741 | from django.contrib.gis.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
def create_user_profile(sender, instance, created, **kwargs):
if created:
UserProfile.objects.create(user=instance)
post_save.connect(create_user_profile, sender=User)
# Cre... | null | miss/models.py | models.py | py | 2,294 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.models.signals.post_save.connect",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.db.models.signals.post_save",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.models.User",
"line_number": 9,
"usage_ty... |
317742951 | from copy import copy
import json
def runtime(key, default_value=None):
with open('runtime.json', mode='r') as runtime_file:
_runtime = copy(json.load(runtime_file))
if key not in _runtime:
return default_value
return _runtime[key]
def set_runtime(key, value):
with open... | null | runtime.py | runtime.py | py | 568 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "copy.copy",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "copy.copy",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 17,
"u... |
446153267 | import pybullet as p
import time
import pybullet_data
import numpy as np
import sophus as sp
import matplotlib.pyplot as plt
from pybullet_utils import *
from particle_filter import *
from multiprocessing import Process, Value, Array, shared_memory
from renderer import *
def tau(x):
return (1 - (x - 1) ** 4) ** (... | null | visual_servo_pybullet.py | visual_servo_pybullet.py | py | 28,426 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pybullet.computeProjectionMatrixFOV",
"line_number": 89,
"usage_type": "call"
},
{
"api_name": "pybullet.connect",
"line_number": 96,
"usage_type": "call"
},
{
"api_name": "pybullet.GUI",
"line_number": 96,
"usage_type": "attribute"
},
{
"api_name":... |
4359838 | from collections import OrderedDict
import json
import io
import csv
import xlsxwriter
def load_json(season):
with io.open(season + ".json", 'r', encoding='utf8') as json_file:
json_data = json.load(json_file, parse_int=True)
return json_data
def collect_credit_types(json_data):
credit_type = []... | null | exporter.py | exporter.py | py | 5,178 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "io.open",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "io.open",
"line_number":... |
308024412 | import time
import pyodbc
import requests
import pandas as pd
from io import BytesIO
#
# SRT_20020_종목별공매도잔고현황
#
# 1. 목적
# - KRX 공매도 종합 포털 사이트 크롤링
# - 공매도 통계 -> 공매도 잔고 현황 -> 종목별 공매도 잔고 현황(기간: 2016.06.30-)
#
# 2. 코멘트
# 2.1
#
#
# 3. 개선해야될 사항
# 3.1 시장구분(mkt_dt) hard-coding
# -> 시... | null | SRT_20020_종목별공매도잔고현황.py | SRT_20020_종목별공매도잔고현황.py | py | 7,129 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.DataFrame",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_nu... |
35240400 | # This file is part of sner4 project governed by MIT license, see the LICENSE.txt file.
"""
controller portmap
"""
from socket import getservbyport
from flask import render_template, request
from sqlalchemy import desc, func
from sqlalchemy_filters import apply_filters
from sner.server.auth.core import role_required... | null | sner/server/visuals/views/portmap.py | portmap.py | py | 3,522 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sner.server.storage.models.Host",
"line_number": 29,
"usage_type": "argument"
},
{
"api_name": "sner.server.extensions.db.session.query",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "sner.server.extensions.db.session",
"line_number": 29,
"usage... |
312144633 | #views.py
from flask import request, session, redirect, url_for, abort, \
render_template, json, Blueprint
from app import app
from cache import cached, cache
from models import db, User, Article, like_table
from security import ts, random_str
v = Blueprint('views', __name__)
#SYNC
@v.route('/')
def index():
... | null | code/views.py | views.py | py | 2,936 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Blueprint",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.redirect",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.url_for",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.session.get",
"... |
481511763 | # import libraries
import argparse
import numpy as np
import pandas as pd
from sklearn.metrics.pairwise import cosine_similarity
def mean_similarity(file):
"""
Computes the average cosine similarity in sparse vectors.
Arguments:
'file' - sparse vectors computed from the "gendoc.py" script
... | null | simdoc.py | simdoc.py | py | 2,158 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.pairwise.cosine_similarity",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": ... |
573601525 | import datetime
import os
import pytest
import json
import virtool.analyses.migrate
from aiohttp.test_utils import make_mocked_coro
@pytest.mark.parametrize("skip", [True, False])
async def test_add_subtractions_to_analyses(skip, dbi):
"""
Test that function assigns subtraction fields to analyses by checking ... | null | tests/analyses/test_migrate.py | test_migrate.py | py | 11,145 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "virtool.analyses.migrate.analyses.migrate.add_subtractions_to_analyses",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "virtool.analyses.migrate.analyses",
"line_number": 78,
"usage_type": "attribute"
},
{
"api_name": "virtool.analyses.migrate",
"lin... |
191671163 | from urllib.parse import urlencode
from bs4 import BeautifulSoup
import grequests
import requests
# This is the maximum page size allowed. Don't change this
page_size = 100
max_concurrent = 20
max_attempts = 5
# Generate url to search for papers
def _get_search_url(term):
query = urlencode(dict(
db='pub... | null | fetch.py | fetch.py | py | 2,588 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "urllib.parse.urlencode",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "urllib.parse.urlencode",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "bs4.Beauti... |
467601692 | import re
from reportlab.lib.enums import TA_CENTER, TA_JUSTIFY, TA_LEFT, TA_RIGHT
from reportlab.lib.styles import ParagraphStyle, StyleSheet1
from reportlab.lib.colors import toColorOrNone, Color
from reportlab.lib.units import inch
from reportlab.platypus import Paragraph, SimpleDocTemplate, Table, TableStyle
from... | null | pdf/items.py | items.py | py | 10,176 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "reportlab.lib.colors.toColorOrNone",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "layout.models.TextStyle.Alignment",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "layout.models.TextStyle",
"line_number": 21,
"usage_type": "nam... |
561940068 | import gym
import math
import numpy as np
import numpy.random as nprnd
import matplotlib.pyplot as plt
#bounds inputted x between (-1,1)
def sigmoid(x):
return ( 1/(1 + np.exp(-x)) )
#selects a random output, favoring the largest one
def makeChoice(outputs):
return int( outputs[1] > nprnd.random()*(outputs[1]... | null | polecart.py | polecart.py | py | 4,038 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.exp",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.random.random",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "gym.make",
"line_number... |
407251117 | # Copyright (c) 2018- Xilinx, Inc (Alessandro Pappalardo)
# Copyright (c) 2016- Facebook, Inc (Adam Paszke)
# Copyright (c) 2014- Facebook, Inc (Soumith Chintala)
# Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert)
# Copyright (c) 2012-2014 Deepmind Techno... | null | src/brevitas/core/stats/stats_wrapper.py | stats_wrapper.py | py | 6,668 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "brevitas.jit",
"line_number": 56,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Module",
"line_number": 61,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 61,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"l... |
473002950 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import math
import numpy as np
import numpy.linalg as la
from torch.autograd import Variable
from sklearn.preprocessing import LabelBinarizer
## define all your models here so that they can be called/chosen by a simple f... | null | AIML_Game_updated/models/mymodel.py | mymodel.py | py | 2,262 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
618774783 | """
---------------------------------------------
License regarding portions of the code below:
get_params
set_params
_get_params
_set_params
_replace_estimator
New BSD License
Copyright (c) 2007–2019 The scikit-learn developers.
All rights reserved.
Redistribution and use in source and binary f... | null | leapy/dask/pipeline/FeaturePipeline.py | FeaturePipeline.py | py | 6,008 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sklearn.utils.metaestimators._BaseComposition",
"line_number": 50,
"usage_type": "name"
},
{
"api_name": "sklearn.externals.six.iteritems",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "sklearn.externals.six",
"line_number": 71,
"usage_type": "n... |
447812976 | from alarm.business.alarm_ping import reset_pings
from typing import List
from django.db import transaction
from alarm.use_cases.out_alarm import notify_alarm_status_factory
from alarm.models import AlarmStatus, AlarmSchedule
def alarm_status_changed(alarm_status: AlarmStatus, force=False):
"""
Call this met... | null | core/app/alarm/use_cases/alarm_status.py | alarm_status.py | py | 3,813 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "alarm.models.AlarmStatus",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "alarm.use_cases.out_alarm.notify_alarm_status_factory",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 24,
"usage_type": "name"
},
... |
147509157 | # coding: UTF-8
from __future__ import unicode_literals
import os, re
import requests
from bs4 import BeautifulSoup
class Scraper:
'''Класс для скрапинга веб-страниц.
Выделяет на странице:
- заголовок по тегу <h1> либо <meta name="title">
- основной текст по тегам <p> у блоков <div> с указанн... | null | minread_mod.py | minread_mod.py | py | 10,358 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 48,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number... |
50846042 | import os
import json
import time
import click
import parsers
import pkgutil
import threading
import parsers
import firebase_admin
from datetime import datetime, timedelta
from flask import Flask, Blueprint, render_template, request, redirect, abort, url_for
from werkzeug.utils import secure_filename
from flask_restful... | null | server.py | server.py | py | 6,983 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.Blueprint",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "flask.Blueprint",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "firebase_admin.credential... |
344279600 | import defineMagnets as magnets
import readData as read
import matplotlib.pyplot as pyplot
import numpy as np
import analysis_tools as tools
import sys
import fitFieldMap_v2 as fit
import fieldManipulation as fieldManip
import calculateField as field
from matplotlib.backends.backend_pdf import PdfPages
import polarMeas... | null | MakeSSUFromFittedFields.py | MakeSSUFromFittedFields.py | py | 3,702 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "readData.readFile",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "readData.readFile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "readData.readFile",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "readData.readFi... |
170462075 | # -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2017, 2018, 2020, 2021 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""REANA client ping tests."""
from click.testing import CliRunner
from moc... | null | tests/test_cli_ping.py | test_cli_ping.py | py | 2,348 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "click.testing.CliRunner",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "reana_client.cli.cli",
"line_number": 23,
"usage_type": "argument"
},
{
"api_name": "reana_client.config.ERROR_MESSAGES",
"line_number": 24,
"usage_type": "name"
},
{
... |
458524350 | from typing import Text, Iterable, Callable, Dict, Tuple
from django.db import connections
from rest_framework import status as st
from ..utils import BaseVstObject
class BaseBackend(BaseVstObject):
__slots__ = ('__health_methods',)
def __init__(self):
self.__health_methods = {} # typing: Dict
... | null | vstutils/api/health.py | health.py | py | 2,274 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "utils.BaseVstObject",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "rest_framework.status.HTTP_200_OK",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_nam... |
414040597 | from threading import Thread
import socket
import os, os.path
import logging
class VideoConversionUnixSocket(Thread) :
logging.basicConfig(format='%(asctime)s - %(levelname)s: %(message)s', level=logging.DEBUG)
def __init__(self):
Thread.__init__(self)
self.server = socket.socket(s... | null | back/videoconvunixsocket/videoconversionunixsocket.py | videoconversionunixsocket.py | py | 1,887 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "threading.Thread",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "logging.basicConfig",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "threading.Thread... |
478566429 | import decimal
from django.db.models import Avg
from django.shortcuts import get_object_or_404, render, redirect
from django.conf import settings
from watson_developer_cloud import AlchemyLanguageV1
from collections import Counter
from dishes.models import (
DishPost, Diner, Order, DishRequest, Chef, Bid,
Ord... | null | django-project/dishes/views.py | views.py | py | 26,586 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.settings",
"line_number": 26,
"usage_type": "argument"
},
{
"api_name": "watson_developer_cloud.AlchemyLanguageV1",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "dishes.models.DishPost.objects.filter",
"line_number": 32,
"usage_type"... |
134286775 | import time
import os
import json
def read_json(filename):
"""Returns the JSON string into memory only as READ obj (not for writing)"""
with open(filename) as obj:
data = json.load(obj)
return data
def write_json(data, filename):
"""Writes to the JSON File"""
with open(filename, 'w') as ... | null | notecard_modules.py | notecard_modules.py | py | 1,364 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 46,
... |
366913405 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from kivy.app import App
from kivy.uix.button import Button
from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
from kivy.clock import Clock... | null | speedRead.py | speedRead.py | py | 1,289 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "kivy.app.App",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "kivy.uix.boxlayout.BoxLayout",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "kivy.uix.button.Button",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "kivy... |
429735545 | import numpy as np
import pdb
A = [[0.6, 0.1, -0.3],
[0.5, -0.4, 0,2],
[1.0, -0.2, 1.1]]
b = [[12],
[10],
[-1]]
A, b = map(np.asarray, (A, b))
x = np.array(([1],[2],[3]))
dp = A.dot(x)
print(dp)
while True:
pdb.set_trace()
print(np.dot(A, x))
break
xn = np.add(np.dot(A,x), b)... | null | test.py | test.py | py | 365 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.asarray",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pdb.set_trace",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_nu... |
123320836 | import numpy as np
import pandas as pd
from sklearn.pipeline import make_pipeline
from sklearn.discriminant_analysis import QuadraticDiscriminantAnalysis
from sklearn.model_selection import RepeatedStratifiedKFold, cross_val_score
from sklearn.preprocessing import StandardScaler
from zipfile import ZipFile
# Load Dat... | null | src/models/quadratic_discriminant_analysis.py | quadratic_discriminant_analysis.py | py | 2,356 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "zipfile.ZipFile",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.factorize",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.model_select... |
491352435 | import numbers
import numpy as np
from itertools import groupby
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.utils import _pair
from hyperseg.models.layers.meta_conv import MetaConv2d
from hyperseg.models.layers.meta_sequential import MetaSequential
class HyperGen(nn.Module... | null | models/hyperseg_v1_0_unify.py | hyperseg_v1_0_unify.py | py | 31,622 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torch.flip",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "torch.flip",
"line_numbe... |
125755822 | from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
from builtins import map
import csv
import glob
import os
import re
import smtplib
import socket
import sys
import tempfile
import urllib.request, urllib.parse, urllib.error
from email.mime.text import MIMEText
... | null | fabfile.py | fabfile.py | py | 21,409 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "future.standard_library.install_aliases",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "future.standard_library",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "os.path.expanduser",
"line_number": 27,
"usage_type": "call"
},
{
"... |
199659630 | # fractal.py
import taichi as ti
import numpy as np
from mpm_solver import MPMSolver
ti.require_version(0, 5, 7)
ti.init(arch=ti.x64)
n = 320
m = 20
# pixels = ti.var(dt=ti.f32, shape=(n * 2, n))
pixels = ti.Vector(4, dt=ti.f32, shape=(n, n))
MAX_STEPS = 100
MAX_DIST = 100.0
SURF_DIST = 0.01
mpm = MPMSolver(res=(6... | null | SDFSphere.py | SDFSphere.py | py | 4,932 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "taichi.require_version",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "taichi.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "taichi.x64",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "taichi.Vector",
"... |
202789591 | from functools import wraps
from dagster import (
DependencyDefinition,
InputDefinition,
Output,
OutputDefinition,
PipelineDefinition,
SolidDefinition,
check,
)
from .asset import Asset
class Lakehouse:
'''A Lakehouse is a scheme for storing and retrieving assets across heterogeneous... | null | python_modules/libraries/lakehouse/lakehouse/house.py | house.py | py | 6,742 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "asset.computation",
"line_number": 95,
"usage_type": "attribute"
},
{
"api_name": "asset.path",
"line_number": 96,
"usage_type": "attribute"
},
{
"api_name": "dagster.check.failed",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "dagster.c... |
280073159 | import os
from setuptools import setup
from setuptools import find_packages
README = open(os.path.join(os.path.dirname(__file__), 'README')).read()
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name = 'django-embed',
version = '0.2.1',
packages = find_packages(),
... | null | pypi_install_script/django-embed-0.2.1.tar/setup.py | setup.py | py | 1,239 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": ... |
491140270 | from selenium import webdriver
import logging
logging.basicConfig(filename='test1.log',level=logging.DEBUG,format='%(asctime)s:%(levelname)s:%(message)s')
#class logtest:
# driver = webdriver.Chrome()
# driver.get("https://www.google.com/")
# driver.maximize_window()
# try:
# driver.find_element_by... | null | Exception_Handling.py | Exception_Handling.py | py | 1,414 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "logging.debug",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "logging.debug",
... |
306413989 | import wirc_drp.wirc_object as wo
from pathlib import Path
import pickle
def get_img_name(direc, number, style = 'wirc', img_type = ''):
"""Gets the image name in WIRC convention
This function will take an image directory and number and
gives the image name.
Args:
number (int): The image number.
direc (str): ... | null | wirc_spec/io_utils.py | io_utils.py | py | 6,050 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pathlib.Path",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_numbe... |
263396240 | from __future__ import print_function
import os
import sys
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import random
import pickle
import argparse
import csv
from PIL import Image
from tqdm import tqdm
import torch
import torch.optim as optim
import torch.nn as nn
import torch.nn.functional a... | null | MNIST Experiment/f_div_peer.py | f_div_peer.py | py | 8,459 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "torch.manual_seed",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "torchvision... |
39556186 | from collections import defaultdict
class TrieNode():
def __init__(self):
self.children = defaultdict(TrieNode)
self.isWord = False
class WordDictionary:
def __init__(self):
self.wordlist = defaultdict(list)
def addWord(self, word: str) -> None:
if word:
sel... | null | solutions-to-leetcode/211_add_and_search_words_data_structure_design.py | 211_add_and_search_words_data_structure_design.py | py | 1,856 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.defaultdict",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 13,
"usage_type": "call"
}
] |
33968718 | from openpyxl import Workbook
from openpyxl import load_workbook
from openpyxl.chart import (
AreaChart,
Reference,
Series,
)
import datetime
wb = load_workbook('d:/python-execl/log.xlsx')
ws = wb.active
#print(ws.max_row)
#print(ws.max_column)
#print(ws.cell(3,2).value)
#for row in ws.rows:
# for ce... | null | execl/log.py | log.py | py | 952 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "openpyxl.chart.AreaChart",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "openpyxl.chart.Reference",
"line_number": 37,
"usage_type": "call"
},
{
"api_name... |
140576325 | '''
Created on 3.5.2019
@author: ttesip
'''
import sys
from db_classes import Common
from db_classes import Postgres
import numpy as np
import math
import matplotlib.pyplot as plt
import json
from sqlalchemy.engine.url import make_url
c=Common()
params = c.parse_parameters(sys.argv)
ps_params = {}
ps_params["host"]... | null | src/main/resources/static/python/dailytest.py | dailytest.py | py | 2,060 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "db_classes.Common",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "sqlalchemy.engine.url.make_url",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "db_cla... |
540951463 | """
Code from Modeling and Simulation in Python.
Copyright 2020 Allen Downey
MIT License: https://opensource.org/licenses/MIT
"""
import logging
logger = logging.getLogger(name="modsim.py")
# make sure we have Python 3.6 or better
import sys
if sys.version_info < (3, 6):
logger.warning("modsim.py depends on P... | null | modsim/modsim.py | modsim.py | py | 22,794 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.version_info",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name"... |
640508906 | """Http related parsers and protocol."""
import asyncio
import collections
import http.server
import string
import sys
import zlib
from urllib.parse import SplitResult
from wsgiref.handlers import format_date_time
import yarl
from multidict import CIMultiDict, istr
import aiohttp
from . import hdrs
from .helpers im... | null | aiohttp/http_message.py | http_message.py | py | 13,031 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "string.printable",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "sys.version_info",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "aiohttp.__version__",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "... |
360400634 | #from slurm_info import info
from .ws_info import info
from infrastructure.configuration import configuration, param
import collections
import numpy as np
from pathlib2 import Path
params = collections.OrderedDict([
("num_cpgs", param(385730, name = 'num_cpgs')), # 150254
("kde_mask", param('siblings_mask', na... | null | src/configurations/config_down_GSE131752.py | config_down_GSE131752.py | py | 4,249 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.OrderedDict",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "infrastructure.configuration.param",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "infrastructure.configuration.param",
"line_number": 10,
"usage_type": "call"
}... |
73424988 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Filename : experiment_water_dgmp
# @Date : 01/17/2019 15:57:28
# @Poject : DGMP
# @Author : FEI, hfut_jf@aliyun.com
# @Desc : use test feature
from __future__ import print_function
import os
import sys
sys.path.append(os.path.abspath('/network/rit/lab/c... | null | share/experiment_water_dgmp.py | experiment_water_dgmp.py | py | 9,199 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
245948471 | """
The Skeleton classes to support strictly defined structures:
Structure, Field, StructureReference, ClassReference, TypedField
"""
from copy import deepcopy
from collections import OrderedDict
from inspect import Signature, Parameter
import sys
from typing import get_type_hints, Iterable
def make_signature(names,... | null | typedpy/structures.py | structures.py | py | 15,695 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.OrderedDict",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "inspect.Parameter",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "inspect.Parameter.POSITIONAL_OR_KEYWORD",
"line_number": 26,
"usage_type": "attribute"
},
{... |
205477525 | #####################################################################
# Utilities for file input/output and model loading
#####################################################################
import numpy as np
from sklearn import mixture
import xarray as xr
import joblib
#############################################... | null | src/file_io.py | file_io.py | py | 3,363 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "xarray.open_dataset",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "xarray.open_dataset",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "joblib.dump",
... |
242050212 | import logging
_logger = logging.getLogger(__name__)
class Subfsm(object):
SUB_EVENT_STOP = 0
SUB_EVENT_START = 1
SUB_EVENT_CONNECTED = 2
SUB_EVENT_DISCONNECTED = 3
SUB_STATE_WAITSTART = 0
SUB_STATE_CONNECTTING = 1
SUB_STATE_WORKING = 2
SUB_STATE_WAITSTOP = 3
SUB... | null | libs/mickey/subfsm.py | subfsm.py | py | 2,917 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 3,
"usage_type": "call"
}
] |
3834102 | from __future__ import print_function, division, absolute_import
import warnings
from collections import namedtuple
import numba
from numba import ir, ir_utils, types
from numba import compiler as numba_compiler
from numba.targets.registry import CPUDispatcher
from numba.ir_utils import (mk_unique_var, replace_vars_i... | null | hpat/hiframes.py | hiframes.py | py | 94,454 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numba.targets.registry.CPUDispatcher",
"line_number": 49,
"usage_type": "argument"
},
{
"api_name": "numba.stencilparfor",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "numba.ir_utils.remove_call_handlers.append",
"line_number": 80,
"usage_... |
88046075 | import pandas as pd
import numpy as np
from sklearn.metrics import mean_squared_error
import lightgbm as lgb
from sklearn.model_selection import KFold, StratifiedKFold, GroupKFold
from tqdm import tqdm
import joblib
# defining global variable
feature_path = "D:/Deployment/feature.csv"
label_path = "D:/Deploy... | null | Deployment_Code/train.py | train.py | py | 2,616 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.KFold",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "lightgbm.Dataset",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "lightg... |
461093282 | import sys
import keras
from keras.callbacks import ModelCheckpoint
from keras.utils import plot_model
from keras_model_robertawithdrmm import build_keras_model
from load_data_robertawithdrmm import *
from loss_function import *
import numpy as np
import os
# make sure the argument is good (0 = the python file, 1+ th... | null | Classifer_Roberta_DRMM/run_model_robertawithdrmm.py | run_model_robertawithdrmm.py | py | 1,679 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number... |
291276805 | import pymongo
from flask import Flask, render_template, request, redirect, url_for
app = Flask(__name__)
def queryArtistName(name, artists):
artist_list = list()
for i, artist in enumerate(artists.find({'name':name}).sort('rating.count', -1)):
artist_info = artist
artist_list.append(artist_in... | null | katsumata/chapter07/knock69.py | knock69.py | py | 1,870 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "flask.requ... |
371722513 | import os
import gspread
from collections import OrderedDict
from oauth2client.service_account import ServiceAccountCredentials
lkp_col_name_to_md_name = OrderedDict([
('Map Service URL', u'map_service'),
('Title', u'title'),
('Technical ... | null | utilities/google_sheet.py | google_sheet.py | py | 3,548 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.OrderedDict",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
... |
462103086 | from kombu.mixins import ConsumerMixin
from kombu import Exchange, Queue, Connection
class Worker(ConsumerMixin):
def __init__(self, connection, queues):
self.connection = connection
# queues 消费哪些队列的消息
self.queues = queues
def on_message(self, body, message):
# 收到消息后的处理逻辑
... | null | API_CALLER/Kombu_/demo02.py | demo02.py | py | 986 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "kombu.mixins.ConsumerMixin",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "kombu.Exchange",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "kombu.Queue",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "kombu.Connection... |
378144326 | import os
import glob
import sys
import numpy as np
sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages')
import cv2
sys.path.append('/opt/ros/kinetic/lib/python2.7/dist-packages')
from math import cos, sin, atan2, degrees, sqrt
path = '/home/varunharis/Desktop/Computer Vision/Project 1/FDDB-folds/'
pathToI... | null | Face-Detection/Face detection using Adaboost and haar feature extractio/dataset_preparation.py | dataset_preparation.py | py | 4,896 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.remove",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numbe... |
170251204 | import hazelcast
client = hazelcast.HazelcastClient(
cluster_name="dev",
cluster_members=[
"127.0.0.1:5701",
"127.0.0.1:5702",
"127.0.0.1:5703",
]
)
my_map = client.get_map("lab3_8dfddedrf")
key = '1'
my_map.put_if_absent(key, 0)
print('starting')
for i in range(10):
while True:... | null | optimistic_locking.py | optimistic_locking.py | py | 600 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "hazelcast.HazelcastClient",
"line_number": 3,
"usage_type": "call"
}
] |
472360427 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import image_cropping.fields
class Migration(migrations.Migration):
dependencies = [
('sito', '0009_auto_20150518_1458'),
]
operations = [
migrations.AddField(
model_name... | null | sito/migrations/0010_auto_20150519_0947.py | 0010_auto_20150519_0947.py | py | 1,399 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AddField",
"line_number": 15,
"usage_type": "call"
},
{
... |
309397803 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Fraunhofer Lines
================
Defines objects for the homemade spectroscope spectrum images of Fraunhofer
lines analysis.
References
==========
.. [1] http://en.wikipedia.org/wiki/Fraunhofer_lines
"""
from __future__ import division, unicode_literals
import bi... | null | colour_spectroscope/fraunhofer_lines.py | fraunhofer_lines.py | py | 6,119 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
448221453 | #-*- coding:utf-8 -*-
"""
get and send mails via POP3 and SMTP.
"""
from poplib import POP3, POP3_SSL
from smtplib import SMTP, SMTP_SSL
import logging
import sched
import time
import json
import argparse
from sys import argv
def get_key(d: dict, keys: list, default=None):
for key in keys:
if key in d:
... | null | tinymail/client.py | client.py | py | 5,632 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.debug",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "poplib.POP3_SSL",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "poplib.POP3",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "logging.debug",
"line_n... |
281151099 | from flask import Flask,url_for,redirect,render_template
import config
# 从flask这个框架中导入Falsk这个类
# 初始化一个Falsk对象
# Flask()需要传递一个参数__name__
# 1.方便flask框架去寻找资源
# 2.方便flask插件比如(Flask-Sqlalchemy)出现错误时,好去寻找问题所在
app = Flask(__name__)
app.config.from_object(config)
#装饰器(@开头,在函数上面)
# 作用:做一个url与视图函数的映射
# 127.0.0.1:5000/ -->去请求h... | null | flask/1_views_templates/first_project/first_project.py | first_project.py | py | 2,584 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "flask.render_t... |
615815679 | #!/usr/bin/python
import cherrypy
import wrapper
import json
from py2neo.neo4j import Direction
jsonContentType = [('Content-Type', 'application/json')]
class Api(object):
wrapper = wrapper.Wrapper()
@cherrypy.expose
def tag(self, *path, **args):
if self.wrapper.hasItemGotTag(int(args['item']), int(args['tag'... | null | api/server.py | server.py | py | 3,113 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "wrapper.Wrapper",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cherrypy.expose",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "cherrypy.expose",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "cherrypy.re... |
303600543 | from PIL import Image
import numpy as np
import cv2
import matplotlib.pyplot as plt
import argparse
import os
import shutil
import projectMethod as pm
import sys
import csv
def createFileList(myDir, format='.png'):
fileList = []
print(myDir)
for root, dirs, files in os.walk(myDir, topdown=F... | null | genunknownFile.py | genunknownFile.py | py | 1,913 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.walk",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 26,... |
302147766 | from flask import Flask, render_template, request, redirect, session, flash
app = Flask(__name__)
app.secret_key = 'ThisIsSecret'
@app.route('/')
def index():
return render_template('index.html', one=10, two=5)
@app.route('/survey', methods=['POST'])
def create():
errors = []
if not len(request.form['nam... | null | flask_answersheets/surveyFormValidations/server.py | server.py | py | 1,032 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.form",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "flask.request... |
154799001 | #!/usr/bin/env python
# std imports,
import subprocess
import sys
import os
# 3rd-party
import setuptools
import setuptools.command.develop
import setuptools.command.test
here = os.path.dirname(__file__)
class SetupDevelop(setuptools.command.develop.develop):
def run(self):
# ensure a virtualenv is load... | null | setup.py | setup.py | py | 2,607 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "setuptools.command",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.getenv",
... |
599896213 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('records', '0019_auto_20160404_2235'),
]
operations = [
migrations.AlterField(
model_name='point',
na... | null | apps/records/migrations/0020_auto_20160411_2250.py | 0020_auto_20160411_2250.py | py | 632 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterField",
"line_number": 14,
"usage_type": "call"
},
{... |
412492811 | import cgi, os.path
from sklearn.externals import joblib
pklfile=os.path.dirname(__file__)+"/freq.pkl"
clf=joblib.load(pklfile)
def show_form(text,msg=""):
print("Content-Type: text/jtml; charset=utf-8")
print("")
print("""
<html><body><form>
<textarea name="text" rows="8" cols="40">{0}</textarea>... | null | jjm_machineweb.py | jjm_machineweb.py | py | 447 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "sklearn.externals.joblib.... |
97688745 | from .gpt import GPT
import json
import torch
import random
import os
MAX_LEN = 64
def utts_to_tokens(utts: list, w2i: dict, last_sep=True, cls=True):
# 太多依赖了,不要该CLS和SEQ的标识
result = []
if cls:
result.append(w2i["[CLS]"])
for utt in utts:
temp = []
for char in list(utt):
... | null | nn/bi_model.py | bi_model.py | py | 5,779 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.tensor",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 73,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number":... |
226105575 | # -*- coding: utf-8 -*-
# Author: HaiNT
# https://leetcode.com/problems/reorder-list/
from typing import Optional, Tuple
from collections import deque
# Definition for singly-linked list.
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
de... | null | linkedList/143_reorder_list.py | 143_reorder_list.py | py | 2,842 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.Tuple",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 43,
"usage_type": "name"
}
] |
53133080 | import pandas as pd
from sqlalchemy import create_engine
import os
def execute_dc_query(reference_id):
# Creating database connection
engine = create_engine('mysql+mysqldb://cmauser:cma#2k16@150.236.10.40/cmadb_1_1')
# Fetching data from table
select_data_query = """select * from deviation_... | null | generate_dev_count.py | generate_dev_count.py | py | 1,418 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql_query",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql_query",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "o... |
599370847 | # Std libs
import glob
import logging
import os
from io import StringIO
# third party
import pandas as pd
import requests
from Bio import SeqIO, pairwise2
from Bio.Seq import Seq
from Bio.Data import CodonTable
from bs4 import BeautifulSoup
# from gspread_pandas import Spread, Client
# module level
from .settings im... | null | src/sadie/reference/imgt.py | imgt.py | py | 27,553 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "Bio.Data.CodonTable.standard_dna_table",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "Bio.Data.CodonTable",
"line_number": 28,
"usage_type": "name"
},
{
... |
19227338 | # Прочитайте содержимое файла moby_clean.txt, полученного в упражнении 10.3.
# Используйте словарь для подсчета вхождений каждого слова,
# выведите первые 5 самых частых и самых редких слов.
def read_file(file):
try:
with open(file, 'r') as file:
content = file.read()
return content
... | null | lesson_10/moby_stat.py | moby_stat.py | py | 834 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.Counter",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 25,
"usage_type": "call"
}
] |
77419548 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2016 Lenovo
#
# 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 ... | null | confluent_server/confluent/networking/macmap.py | macmap.py | py | 9,511 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.compile",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 55,
... |
152739262 | """
Produce metadata/content from an URL
"""
import bz2
import lzma
import zlib
import mimetypes
import urllib.request as urlreq
from io import BytesIO, StringIO
from re import findall
from urllib.error import HTTPError
from openpipe.pipeline.engine import ActionRuntime
from os.path import splitext
from .file_ import A... | null | openpipe/actions/read/from/url_.py | url_.py | py | 3,171 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "openpipe.pipeline.engine.ActionRuntime",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "file_.Action",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "mimetypes.guess_type",
"line_number": 45,
"usage_type": "call"
},
{
"api_name... |
451141708 | __author__ = 'matthew'
import numpy as np
from collections import defaultdict
from parse import *
def calc_rel(dwell_time):
if dwell_time < 50:
return 0
elif dwell_time < 400:
return 1
else:
return 2
def get_rel_map(eval_file):
f = open(eval_file)
fr = FileReader(f)
... | null | evaluation.py | evaluation.py | py | 3,144 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.defaultdict",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.log2",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 113,
"usage_type": "call"
}
] |
236643084 | """The process responsible for activating the espresso grinder."""
import argparse
import RPi.GPIO as GPIO
import six
import txaio
from autobahn.wamp.exception import ApplicationError
from autobahn.twisted.wamp import ApplicationSession
from autobahn.twisted.wamp import ApplicationRunner
from twisted.internet impor... | null | pybob/elektra/espresso_actuator.py | espresso_actuator.py | py | 5,034 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "RPi.GPIO.BCM",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "RPi.GPIO",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "autobahn.twisted.wamp.ApplicationSession",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "R... |
475385513 | # coding: utf-8
from inverse_k import inverse_k
from numpy import matrix
from mpl_toolkits.mplot3d import axes3d
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import animation
def k_phi(R):
""" Takes a 3x3 rotation matrix and returns
a 3x3 skew-symmetric K rotation matrix and
a rotati... | null | test.py | test.py | py | 2,636 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.arccos",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.trace",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.matrix",
"line_number": ... |
627436650 | import urllib
import csv
import pandas as pd
from bs4 import BeautifulSoup
def get_letter_pages():
base_url = 'https://www.baseball-reference.com/players/'
urls = []
letters = ['a/', 'b/', 'c/', 'd/', 'e/', 'f/', 'g/', 'h/', 'i/', 'j/', 'k/', 'l/', 'm/', 'n/',
'o/', 'p/', 'q/', 'r/', 's/', ... | null | build_datasets.py | build_datasets.py | py | 5,810 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "urllib.request",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "urllib.r... |
460250807 | #Import the required libraries
import altair as alt
import pandas as pd
import streamlit as st
import folium
from streamlit_folium import folium_static
from shapely.geometry import Point, Polygon
from geopy.geocoders import Nominatim
from geopy.extra.rate_limiter import RateLimiter
import json
from urllib.request imp... | null | app.py | app.py | py | 7,709 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
318910237 | import argparse
import gc
import json
import os
import pickle
import pprint
import sys
import time
from datetime import datetime
from timeit import default_timer as timer
from pathlib import Path
from pdb import set_trace as TT
from random import randint
import cv2
from typing import Tuple
import gym
import matplotli... | null | evolve.py | evolve.py | py | 139,628 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "warnings.warn",
"line_number": 112,
"usage_type": "call"
},
{
"api_name": "graphviz.Digraph",
"line_number": 131,
"usage_type": "call"
},
{
"api_name": "copy.copy",
"line_number": 154,
"usage_type": "call"
},
{
"api_name": "copy.copy",
"line_num... |
366956154 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render, redirect
from discounts_cart.utils import control_promo_codes, recalculation_payment
def payment(request):
if request.method == 'POST':
# Recalculation of payment
result = recalculation_payment... | null | examples/payments/views.py | views.py | py | 570 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "discounts_cart.utils.recalculation_payment",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "discounts_cart.utils.control_promo_codes",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 22,
"usage... |
136300265 | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns = patterns('',
url(r'^index/', 'core.views.home_page_view', name='homepage'),
url(r'^contact/', 'core.views.contact_view', name='contact'),
... | null | PipingScopeApplication/urls.py | urls.py | py | 695 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "djan... |
327767441 | import torch.nn as nn
class HorizontalMaxPool2d(nn.Module):
def __init__(self):
super(HorizontalMaxPool2d, self).__init__()
# params@x:输入x实际是经特征提取得到的特征图feature map
def forward(self, x):
inp_size = x.size()
# 水平特征的长度为特征图的宽winp_size[3],其高度为1
# 输出y y = nn.functional.max_pool2... | null | aligned/HorizontalMaxPool2D.py | HorizontalMaxPool2D.py | py | 807 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "torch.nn.functional.max_pool2d",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn.f... |
327786383 | import pybliometrics
from pybliometrics.scopus import ScopusSearch
from pybliometrics.scopus.exception import Scopus429Error
import pandas as pd
import numpy as np
from sklearn.utils import shuffle
import os
import multiprocessing
from os import system, name
import json
import time
from tqdm import trange
from IPython.... | null | modules/corpus_generation.py | corpus_generation.py | py | 17,542 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_excel",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "sklearn.utils.shuffle",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 148,
"usage_type": "call"
},
{
"api_name": "os.name",
"lin... |
89868060 | """Data Models module
This module declares Marshmallow Data Models of User and Group Resources,
as well as Query String Parameters.
ma, an instance of Marshmallow from Flask-Marshmallow is declared here and
is initialized in Application Factory function.
group_schema object provides serialization (dump), deserializa... | null | appusers/models.py | models.py | py | 12,462 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask_marshmallow.Marshmallow",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "marshmallow.Schema",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "marshmallow.fields.Integer",
"line_number": 53,
"usage_type": "call"
},
{
"api_n... |
44271692 | from sqlalchemy import (
Table, MetaData, Column, Integer, String, Date,
ForeignKey, Float, UniqueConstraint
)
from sqlalchemy.orm import mapper, relationship
from src.people.domain_models.models import Timezone, Coordinates, Location, \
Person, ContactInfo, PersonalId, Nat, User, LoginInfo
metadata = Met... | null | src/people/repository/orm.py | orm.py | py | 4,052 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlalchemy.MetaData",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Table",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Int... |
101461556 | # imports
import os
import mlflow
import argparse
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
# define functions
def main(args):
# enable auto logging
mlflow.autolog()
# setup parameters
pa... | null | cli/jobs/single-step/scikit-learn/diabetes/src/main.py | main.py | py | 1,859 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "mlflow.autolog",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 40,
"usage_type": "call"
},
{
"api_name"... |
163078506 | import pandas as pd
from common import config
from common.exception import UnsupportedFileFormatError
log = config.get_logger(__name__)
def readReviewData(filename: str) -> tuple:
"""
Read raw review data in CSV format.
:param filename:
:return: tuple of (reviews, posneg).
"""
fileExtension ... | null | BizrateDotCom/data_reader.py | data_reader.py | py | 1,028 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "common.config.get_logger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "common.config",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "common.exception.UnsupportedFileFormatError",
"line_number": 18,
"usage_type": "call"
},
{
"... |
290059063 | import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
data2013 = pd.read_excel("2013 - Election results all districts.xls", skiprows=90)
data2017 = pd.read_excel("2017 - Election results all districts.xls", skiprows=138)
data2013=data2013[1:17]
data2013=data2013.drop(data2013.columns[[1, 2,3,4,6,7,8,... | null | DataScience/LastAssignment/plot.py | plot.py | py | 1,572 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_excel",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotl... |
488670466 | #!/usr/bin/python
# Authors: Gaetano Carlucci
# Giuseppe Cofano
from .Monitor import MonitorThread
from .Controller import ControllerThread
from .ClosedLoopActuator import ClosedLoopActuator
from argparse import ArgumentParser
from multiprocessing import Process, cpu_count
from pyvirtualdisplay import Display... | null | cpu_loader/CPULoadGenerator.py | CPULoadGenerator.py | py | 1,918 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "Monitor.MonitorThread",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "Controller.ControllerThread",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "ClosedLoopActuator.ClosedLoopActuator",
"line_number": 20,
"usage_type": "call"
},
... |
35729629 | import numpy as np
from mpi4py import MPI
import shutil
comm = MPI.COMM_WORLD
size = comm.Get_size()
rank = comm.Get_rank()
from utility import Utility
class Particle:
def __init__(self, pars, temps):
self.dim = pars.get_dim()
self.tempdim = temps.get_dim()
self.pos = np.random.uniform(0.... | null | include/automated/particle.py | particle.py | py | 2,735 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "mpi4py.MPI.COMM_WORLD",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "mpi4py.MPI",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "numpy.random.uniform",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.random... |
460652155 | # -*- coding: utf-8 -*-
"""
Created on July 2016
@author: Jake Gale 2016
"""
from PIL import Image, ImageFilter
import pandas as pd
import random as rn
import math, os, json
from tkinter import Tk
from tkinter.filedialog import askopenfilename
#
#
# --------------
# HERE WE CAN DEFINE WHETHER WE WANT TO BLUR THE IM... | null | python/previous_code.py | previous_code.py | py | 18,868 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tkinter.Tk",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog.askopenfilename",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path.isdir... |
593368788 | from django.contrib.auth.models import User, Group
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponseBadRequest
from rest_framework import viewsets, permissions, status
from rest_framework.decorators import detail_route
from rest_framework.response import Response
from oauth2_pr... | null | api/views.py | views.py | py | 4,841 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "rest_framework.permissions.IsAuthenticated",
"line_number": 18,
"usage_... |
329468853 |
import codecs
import datetime
import random
speciesURL = "uca_species.html"
refURL = "uca_references.html"
refsumURL = "uca_refsummary.html"
systURL = "uca_systematics.html"
commonURL = "uca_common_names.html"
photoURL = "uca_photos.html"
videoURL = "uca_videos.html"
mapURL = "uca_ranges.html"
lifeCycleURL = "uca_lif... | null | Old Version/CreatePages.py | CreatePages.py | py | 166,936 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.randint",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": 630,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": 657,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_numb... |
534673217 | #!/usr/bin/python
import subprocess
import logging
import shlex
import fcntl
import select
import sys
import os
def start_process(child):
logging.info('launching %s' % child['name'])
child['popen'] = subprocess.Popen(shlex.split(child['cli']),
stdout=child['stdout'],
stderr=subprocess.PIPE)
... | null | scripts-fik1/launcher.py | launcher.py | py | 1,900 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.info",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "shlex.split",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line... |
166462388 | #!/usr/bin/env python3
import argparse
from LogLine import LogLine
from tasks import FiveUsersMaxRequest, FiveUsersMaxData, InfectedRequests, UsernameRegularRequests, IpRegularRequests, \
FiveNGram
__author__ = 'Trofimov Igor'
def error_exit(*args, **kwargs) -> None:
"""
Функция печатает сообщение об ош... | null | launcher.py | launcher.py | py | 4,029 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "tasks.FiveUsersMaxRequest",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "tasks.FiveUsersMaxData",
"line_number": 52,
"usage_type": "name"
},
{
"api_name... |
275354748 | import logging
import os
import sys
import click
if os.environ.get("BRS_DEBUG"):
LEVEL = logging.DEBUG
else:
level_name = os.environ.get("BRS_LOG_LEVEL", "INFO")
LEVEL = logging._nameToLevel.get(level_name, logging.INFO)
logging.basicConfig(format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", le... | null | src/brs/__main__.py | __main__.py | py | 666 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.environ.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "logging.DEBUG",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"... |
474258555 | # -*- coding: utf-8 -*-
# python爬取百度资讯, 字符为GBK
'''
out字段:
public_no bigint 20 编号
topic varchar 50 话题
sensitive_word varchar 50 敏感词
source varchar 10 来源
type varchar 10 类型
theme varchar 50 主题
content text 0 详细内容
public_time datetime 6 发布时间
is_publish tinyint ... | null | app/craw/Spider/topTen.py | topTen.py | py | 5,926 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.now",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "datetime.timedelta",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "datetime.d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.