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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
204602637 | """
49. Group Anagrams
Given an array of strings strs, group the anagrams together. You can return the answer in any order.
An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.
"""
class Solution(object):
def groupA... | null | Python/C49.py | C49.py | py | 1,177 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.Counter",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 23,
"usage_type": "call"
}
] |
101373763 | import tensorflow as tf
import numpy as np
import keras
y = tf.Variable(np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1], [1, 0, 0], [0, 1, 0]]), dtype=tf.float32) # 每一行只有一个1
logits = tf.Variable(np.array([[12, 3, 2], [3, 10, 1], [1, 2, 5], [4, 6.5, 1.2], [3, 6, 1]]), dtype=tf.float32)
softmax_logits = tf.nn.softmax(logits)... | null | test.py | test.py | py | 850 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tensorflow.Variable",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "tensorflow.float32",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.Varia... |
523702599 | import pytest
@pytest.fixture
def fish_completer(tmpdir, xession, load_xontrib, fake_process):
"""vox Alias function"""
load_xontrib("fish_completer")
xession.env.update(
dict(
XONSH_DATA_DIR=str(tmpdir),
XONSH_SHOW_TRACEBACK=True,
)
)
fake_process.register... | null | tests/xontribs/test_fish_completer.py | test_fish_completer.py | py | 699 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pytest.fixture",
"line_number": 4,
"usage_type": "attribute"
}
] |
627905293 | #!/usr/bin/env python3
import os
import subprocess
import sys
import logging
import json
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
dns_names = json.loads(sys.argv[1])
resource_group = sys.argv[2]
for key,value in dns_names.items():
host = value[0]
zone = value[1]
domain = host + "." +... | null | tools/letsencrypt/cleanup.py | cleanup.py | py | 1,113 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.INFO",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"... |
394463601 | from yahooquery import Ticker
import tkinter as tk
from datetime import datetime
class Application(tk.Frame):
def __init__(self, master):
super().__init__(master)
self.grid()
self.read()
self.createWidgets()
self.configure(background = "black")
def read(self):... | null | Stocks GUI/stocks.py | stocks.py | py | 2,713 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tkinter.Frame",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "tkinter.Label",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "tkinter.Label",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "tkinter.Label",
"li... |
122073537 | import pytest
from django.utils import timezone
from django.utils.encoding import escape_uri_path
from coapp.core.actions.models import Actions
from coapp.core.areas.models import Area
from ..models import User
pytestmark = pytest.mark.django_db
def test_user_get_absolute_url(user: User):
assert user.get_absolu... | null | backend/coapp/core/users/tests/test_models.py | test_models.py | py | 3,057 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pytest.mark",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "models.User",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "django.utils.encoding.escape_uri_path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "mod... |
275852515 | import cPickle, gzip, numpy
import theano as t
import theano.tensor as T
f = gzip.open('mnist.pkl.gz', 'rb')
train_set, valid_set, test_set = cPickle.load(f)
f.close()
# data_xy is a two dimension array
def share_dataset(data_xy):
data_x, data_y = data_xy
share_x = t.shared(numpy.asarray(data_x, dtype=t.conf... | null | data.py | data.py | py | 869 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gzip.open",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cPickle.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "theano.shared",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number":... |
558035532 | import requests
from bs4 import BeautifulSoup
import json
URL = "https://www.grandcinemas.com.au/Page/Sessions"
class Bot():
def __init__(self, url):
self.URL = url
r = requests.get(self.URL)
self.soup = BeautifulSoup(r.content, 'html5lib')
self.movie_sections = self.soup.find('div... | null | scraper.py | scraper.py | py | 1,569 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number... |
273491932 | import tensorflow as tf
import numpy as np
# from tqdm import tqdm
import scipy.io as sio
from network_and_loss import forward, graph_loss, supervised_loss
from utils import (find_neighbors, call_precision, dense_to_one_hot,
DataSet, RBF)
from findIndex import equal_proportion_sampling
labeled_data_... | null | 中间层嵌入/EmbedDN.py | EmbedDN.py | py | 6,133 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.random.seed",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "scipy.io.loadmat",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "scipy.io",
"... |
564087801 | import sys
sys.path.append("..")
from dataloader_2_stream import GolfDB_2_Stream
from model_2_stream import EventDetector
from util import *
import torch
from torch.utils.data import DataLoader
from torchvision import transforms
import os
from torch.utils.tensorboard import SummaryWriter
from myeval import myeval
from ... | null | skeleton_opt_streams/eval_2_stream.py | eval_2_stream.py | py | 5,183 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "dataloader_2_stream.GolfDB_2_Stream",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "data.... |
117505010 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import requests
import time
import json
import mail
class snowball_monitor:
# variables
pa_history = []
cookies = {}
group_basic_url = 'https://xueqiu.com/P/'
ad_basic_url = 'http://xueqiu.com/cubes/rebalancing/history.json'
group_list = []
j... | null | snowball_monitor.py | snowball_monitor.py | py | 5,940 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.loads",
"line_number": 90,
"usage_type": "call"
},
{
"api_name": "mail.send_mail",
"line_number": 119,
"usage_type": "call"
},
{
"api_name": "time.asctime",
"line_number": 132,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_n... |
294405788 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from jsonfield.forms import JSONFormField
from accounts.models import UserCredit
from common import PROVINCES
from accounts.models import Zone
from .models import Customer, Project, Product, Contact
def gen_field(field_propert... | null | tags/3.5.3/crm/crm/forms.py | forms.py | py | 5,527 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.forms.CharField",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.forms",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "django.forms.TextInput",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.for... |
545170141 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Visualize C_0.99 for all languages except the 10 with most characters."""
# 3rd party modules
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style("whitegrid")
def main(lang_stats):
"""
Plot basic statisics of languages.
Parameters
---... | null | lidtk/data/char_distribution.py | char_distribution.py | py | 2,475 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "seaborn.set_style",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "seaborn.barplot",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.savefig",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "matplotlib... |
352130274 | import matplotlib.pyplot as plt
import heapq
import copy
from time import sleep
from random import randint
from itertools import permutations
import numpy as np
from itertools import combinations
import itertools
def line(route):
xc=[]
yc=[]
for i in (range(0,len(route))):
x=route[i][0]
... | null | astar_tsp_dynamic.py | astar_tsp_dynamic.py | py | 6,509 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.randint",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "random.randint",
"li... |
226326459 | #%%
import numpy as np
import os
import six.moves.urllib as urllib
import sys
import tarfile
import tensorflow as tf
import zipfile
from collections import defaultdict
from io import StringIO
from matplotlib import pyplot as plt
from PIL import Image
from IPython.display import display
import time
# print(f'cv versio... | null | raspberry/detect_demo.py | detect_demo.py | py | 2,829 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tensorflow.__version__",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.executing_eagerly",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tensorflow.config.experimental.list_physical_devices",
"line_number": 20,
"usage... |
307091502 | import gym
import time
from Torch_rl.agent.DDPG import DDPG_Agent
from Torch_rl.model.Network import DenseNet
from torch import nn
import torch
import torch.nn as nn
import torch.nn.functional as F
#%%
envID = "wlanmap-v0"
env = gym.make(envID)
nowtime = time.strftime('%y%m%d%H%M', time.localtime())
path = "savedate" ... | null | DDPG_runner_with_GCN.py | DDPG_runner_with_GCN.py | py | 2,953 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gym.make",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_num... |
653811288 | import collections
import imp
import json
import logging
import socket
import sys
logging.basicConfig(
format='%(asctime)-15s %(levelname)-8s %(name)-11s %(message)s',
level=logging.DEBUG,
)
log = logging.getLogger('code-retreat-runner')
def get_user_data(path):
Data = collections.namedtuple('Data', ['t... | null | code_retreat/__main__.py | __main__.py | py | 2,595 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "collections.n... |
379109891 | from docutils import nodes
from added_value.grammatical_conjunctions import list_conjunction, list_conjunction_parts
from added_value.pyobj_role import make_pyobj_role
def make_literal_any_items_node(rawtext, app, prefixed_name, obj, parent, modname, options):
"""Render a Python sequence as a comma-separated lis... | null | source/added_value/literal_any_items_role.py | literal_any_items_role.py | py | 1,075 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "added_value.grammatical_conjunctions.list_conjunction_parts",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "docutils.nodes.Text",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "docutils.nodes",
"line_number": 22,
"usage_type": "name"
... |
339484595 |
import os
import time
from pymodbus.server.asynchronous import StartTcpServer
from pymodbus.datastore import ModbusSequentialDataBlock
from pymodbus.datastore import ModbusSlaveContext, ModbusServerContext
from pymodbus.payload import BinaryPayloadBuilder
from pymodbus.constants import Endian
from apscheduler.schedu... | null | virtual_modbustcp_server/server.py | server.py | py | 1,506 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pymodbus.datastore.ModbusSequentialDataBlock.create",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pymodbus.datastore.ModbusSequentialDataBlock",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "pymodbus.datastore.ModbusSlaveContext",
"lin... |
155495249 | import torch
import numpy as np
from sklearn.svm import SVC
from sklearn.neighbors import NearestNeighbors
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score
from gensim.corpora.dictionary import Dictionary
from gensim.matutils impor... | null | utils.py | utils.py | py | 6,877 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.zeros",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 80... |
52942957 |
from flask import Flask
from datetime import datetime
app = Flask(__name__)
@app.route('/time')
def time():
now = datetime.now()
return str(now)
app.run(host='0.0.0.0',
port=8080,
debug=True) | null | time_app_sample/run.py | run.py | py | 218 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "name"
}
] |
324136915 | import socket
from process_data import *
from telegram.ext import Updater, CommandHandler
from telegram_bot import *
import logging
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_socket.bind((socket.gethostname(), 80))
server_socket.listen(5)
token = '1245262637:AAGFfXDyh3wM4cFpnAiYa8cIM8bK... | null | Thingspeak/LSEL/server.py | server.py | py | 1,040 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "socket.socket",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "socket.gethost... |
140035338 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from decimal import Decimal as D
from dateutil import rrule
from django.db import models as db
from django.utils.translation import ugettext_laz... | null | src/ralph_pricing/models.py | models.py | py | 18,121 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "decimal.Decimal",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "dateutil.rrule.rrule",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "dateutil.rrule",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "dateutil.rrule.DA... |
163779057 | class Model(object):
"""
Superclass for all FEA models
"""
def __init__(self, name, mtype):
"""
Parameters
----------
name : str
Name of model
mtype : str
Type of model
"""
self.mtype = mtype # Model type
self.name... | null | base/model.py | model.py | py | 12,826 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 251,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 251,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 319,
"usage_type": "call"
},
{
"api_name":... |
55526454 | import sys
sys.path.append('/Users/npolizzi/Projects/combs/src/')
import combs
import prody as pr
import pickle
import collections
# import time
# class MacOSFile(object):
#
# def __init__(self, f):
# self.f = f
#
# def __getattr__(self, item):
# return getattr(self.f, item)
#
# def read(se... | null | src/runs/glutamine_binding_protein/20170911/glutamine_bp_lig_hotspot.py | glutamine_bp_lig_hotspot.py | py | 3,439 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "combs.Sample",
"line_numb... |
14018709 | from PyQt5.QtWidgets import QApplication, QMainWindow, QDockWidget, QTextEdit, QListWidget
from PyQt5 import QtGui
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import Qt
import sys
class DockDialog(QMainWindow):
def __init__(self):
super().__init__()
self.title = 'PyQt5 QDockWidget';
self.iconName =... | null | 37_QDock_Widget/QDockWidget.py | QDockWidget.py | py | 1,275 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtGui.QIcon",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QDockWidget",
"line_number": 36,
"usage_type": "call"
},
{
"api_name... |
460448594 | import pandas as pd
from collections import Counter
import numpy as np
# load data
data_rivm_riool = pd.read_csv("Data/rivm_rioolwaterdata.csv", sep=';')
# Transform date column from string to datetime
data_rivm_riool.Date_measurement = pd.to_datetime(data_rivm_riool.Date_measurement, format='%Y-%m-%d')
# Sort dataf... | null | Python/rna_data.py | rna_data.py | py | 2,955 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"l... |
30747177 |
# coding: utf-8
# In[1]:
"""
Test yourself as a learning agent with "SpaceInvaders-v0"!
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys, gym, time, pyglet
from random_controller import Controller
fps = 23 # frames per second (approx... | null | src/random_controller/space_invaders/random_space_invaders.py | random_space_invaders.py | py | 1,192 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gym.make",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "random_controller.Controller",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 54,
"usage_type": "call"
}
] |
119906185 | """This class will have everything needed to create HDF5 input files to use for
any analysis in this IMAGEN project.
"""
# Global imports
import pandas as pd
import numpy as np
from os.path import join
import os
import glob
import matplotlib.pyplot as plt
from scipy.ndimage.interpolation import zoom
import nibabel a... | null | inputcreator/inputcreator.py | inputcreator.py | py | 14,277 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "nibabel.load",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "scipy.ndimage.interpolation.zoom",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "nibabel.loa... |
526899770 | # -*- coding: UTF-8 -*-
import ast
from io import open
import re
from setuptools import setup
'''
How to build and upload this package to PyPi
python setup.py sdist
python setup.py bdist_wheel --universal
twine upload dist/*
'''
_version_re = re.compile(r"ROBOT_LIBRARY_VERSION\s+=\s+(.*)")
with open("Comp... | null | setup.py | setup.py | py | 973 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.compile",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "io.open",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "ast.literal_eval",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_numb... |
100903618 | import torch
import torch.nn.intrinsic.qat as nniqat
from torch.nn.utils.fusion import fuse_conv_bn_eval, fuse_linear_bn_eval
from torch.quantization.fx.utils import _parent_name
import mqbench.nn.intrinsic as qnni
import mqbench.nn.intrinsic.qat as qnniqat
from mqbench.utils.registry import register_convert_function
... | null | mqbench/fusion_method.py | fusion_method.py | py | 4,144 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.quantization.fx.utils._parent_name",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "mqbench.utils.registry.register_convert_function",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "mqbench.nn.intrinsic.LinearBn1d",
"line_number": 11... |
45707003 | import numpy as np
import tensorflow as tf
from tensorflow import keras
from keras.models import Sequential
from keras.layers import Dense, Flatten, Conv2D, MaxPooling2D, Dropout, BatchNormalization
from tensorflow.keras import layers
from keras.utils import to_categorical
from keras.callbacks import ModelCheckpoint
fr... | null | model.py | model.py | py | 2,096 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.loadtxt",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "keras.utils.to_categorical",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt"... |
372036382 | # Copyright 2018-2020 Xanadu Quantum Technologies 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 | tests/test_qaoa.py | test_qaoa.py | py | 28,746 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "networkx.Graph",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "networkx.Graph",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pennylane.qaoa.x_mixer",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "pennylane.qaoa",... |
88023292 | import nltk
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
from Monoculus.entity.sentiment import Sentiment
# obtain the sentiment for a given body of text
def calculate_sentiment(text):
analyzer = SentimentIntensityAnalyzer()
# split text into list of sentences and compute sentiments ... | null | Monoculus/service/analysis/sentiment/sentiment_analysis.py | sentiment_analysis.py | py | 2,632 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "vaderSentiment.vaderSentiment.SentimentIntensityAnalyzer",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "nltk.sent_tokenize",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "Monoculus.entity.sentiment.Sentiment",
"line_number": 41,
"usa... |
363382414 | '''
Run principal component analysis on the dataset X
'''
import numpy as np
import scipy as sp
def pca(X):
'''
computes eigenvectors of the covariance matrix of X Returns
the eigenvectors U, the eigenvalues (on diagonal) in S
'''
# Usefule values
m, n = X.shape
# You need to return the... | null | ex7/pca.py | pca.py | py | 948 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.zeros",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "scipy.linalg.svd",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "scipy.linalg",
"line_num... |
366339867 | # This script does LOOCV using 8/9 patients (9th is reserved for testing)
# Various parameters of C are tried
# Features are power in 6 frequency bands and 5 voltage domain features in a one second window
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import scipy.io as sio
import os
import ieeg... | null | SBOX/train_classifier_pwr_vltg_sboxEZ.py | train_classifier_pwr_vltg_sboxEZ.py | py | 13,014 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ieeg_funcs.get_path_dict",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"... |
39014340 | #!/usr/bin/python3
# coding: utf-8
import argparse
from functools import partial
import math
import multiprocessing
from multiprocessing.pool import Pool
import os
from random import shuffle
import subprocess
import sys
from termcolor import colored
# DIRSEARCH GIT Repository
GIT_URL = 'https://github.com/maurosori... | null | pataconeso.py | pataconeso.py | py | 4,527 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
... |
63191368 | #!/usr/bin/env python3
import datetime
import time
import RPi.GPIO as GPIO
timezone_offset = -8.0 # Pacific Standard Time (UTC−08:00)
tzinfo = datetime.timezone(datetime.timedelta(hours=timezone_offset))
time_allowed_start = 17 # 6 PM
time_allowed_stop = 3
l_led_pin = 13 # define led_pin
r_led_pin = 19
a_led_pin... | null | MotionSkull.py | MotionSkull.py | py | 4,285 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.timezone",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO.setmode",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"l... |
256618659 | from setuptools import setup, find_packages
import os
version = '0.6'
setup(name='affinitic.zamqp',
version=version,
description="AMQP Consumer and publisher integration with Zope",
long_description=open("README.txt").read() + "\n" +
open(os.path.join("docs", "HISTORY.txt")).r... | null | pypi_install_script/affinitic.zamqp-0.6.tar/setup.py | setup.py | py | 1,653 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "setuptools.setup",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "setuptools.find_packages",
... |
438353007 | import os
import processing
import uuid
import tempfile
from qgis.core import QgsVectorLayer, QgsField
from .byra_validate import ByRaValidate
from PyQt5.QtCore import pyqtRemoveInputHook, QVariant
import pdb
class ByRaPreprocessor:
def __init__(self, validator: ByRaValidate):
self.hraFolder = validator.hraFo... | null | byra/test/byra_preprocessor.py | byra_preprocessor.py | py | 9,036 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "byra_validate.ByRaValidate",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "os.path.expanduser",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.path.jo... |
369284278 | #!/usr/bin/env python
"""
Script to validate event definition files
"""
import argparse
import json
import os
import sys
import re
import common
try:
from jsonschema import validate
except ImportError as e:
print("Failed to import jsonschema: " + str(e))
print("")
print("You may need to install ... | null | scripts/validate.py | validate.py | py | 11,651 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.exit",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_... |
603107944 | import logging
import compose_mode_helper as ComposeModeHelper
logger = logging.getLogger("haproxy")
def get_compose_mode_links(docker, haproxy_container):
labels = haproxy_container.get("Config", {}).get("Labels", {})
project = labels.get("com.docker.compose.project", "")
if not project:
raise E... | null | haproxy/helper/compose_mode_link_helper.py | compose_mode_link_helper.py | py | 2,078 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "compose_mode_helper._calc_links",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "compose_mode_helper._calc_links",
"line_number": 28,
"usage_type": "call"
}
] |
450734642 | # encoding: utf-8
import re
import json
from .common import InfoExtractor
from ..utils import (
compat_urlparse,
)
class FranceTVBaseInfoExtractor(InfoExtractor):
def _extract_video(self, video_id):
info = self._download_xml(
'http://www.francetvinfo.fr/appftv/webservices/video/'
... | null | youtube_dl/extractor/francetv.py | francetv.py | py | 6,883 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "common.InfoExtractor",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "utils.compat_urlparse.urljoin",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "utils.compat_urlparse",
"line_number": 27,
"usage_type": "name"
},
{
"api_name... |
274158433 | # -*- coding:utf-8 -*-
import re
import matplotlib.pyplot as plt
import os
from sklearn.feature_extraction.text import CountVectorizer
# from sklearn import cross_validation
from sklearn.model_selection import cross_val_score
from sklearn import tree
from sklearn.ensemble import RandomForestClassifier
import numpy a... | null | src/Resume/FtpBruteForce.py | FtpBruteForce.py | py | 3,977 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.listdir",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "os.path.isfile",
"line_numbe... |
543985092 | import io
import json
import re
class Highlighter(object):
'''Highlights text based on rules from json files or dicts.'''
def __init__(self,
parent_application,
rules_list=[]):
# List of dicts containing:
# rulename (dict['rule'])
# color code (dict['... | null | hms/utilities/highlighter.py | highlighter.py | py | 6,140 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.load",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "re.finditer",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "io.StringIO",
"line_number": 99,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 136,... |
632841237 | #!/usr/bin/env python
# coding=utf-8
#
# Copyright 2013 david reid <zathrasorama@gmail.com>
#
# 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
... | null | sample_scripts/ofgem_certificate_search.py | ofgem_certificate_search.py | py | 3,731 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.today",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "pyw... |
584275937 | import requests
def pokemon_extract(poke, lang):
pokedata = []
for pokemon in poke:
r = requests.get('https://pokeapi.co/api/v2/pokemon/' + pokemon)
extract = r.json()['abilities']
for i in extract:
data = requests.get(i['ability']['url'])
for j in data.json()['n... | null | TUT/interview.py | interview.py | py | 570 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
}
] |
45745712 | """Implements PAA."""
import numpy as np
import datetime as dt
import timeit
def paa(series, paa_segments):
"""PAA implementation."""
series_len = len(series)
# check for the trivial case
if (series_len == paa_segments):
return np.copy(series)
else:
res = np.zeros(paa_segments)
... | null | tsmpy/sax/paa.py | paa.py | py | 2,658 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.copy",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_... |
17923683 |
# returns all the links prrsnet on a webpage
from bs4 import BeautifulSoup
import requests
url = input("Enter a website to extract urls from: \n")
r = requests.get("http://"+ url)
data = r.text
soup = BeautifulSoup(data,'lxml')
for link in soup.find_all('a'):
print(link.get('href')) | null | url.py | url.py | py | 291 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
}
] |
243282881 | import requests
import datetime
from bs4 import BeautifulSoup
HTTP = 'http://www.songlyrics.com/'
fetch = lambda url: requests.get(HTTP + url) if url[:4] != 'http' else requests.get(url)
def now():
"""
Retrieve current date & time
"""
return datetime.datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S')
... | null | songlyricsscraper.py | songlyricsscraper.py | py | 4,784 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "bs4.Beaut... |
53447540 | """
Created on 2018/8/14
@author: yby
@desc : 2018-08-21 已经正式运行测试完成,可以正常使用
"""
from tasks.tushare.ts_pro_api import pro
import pandas as pd
import logging
from tasks.backend.orm import build_primary_key
from datetime import date, datetime, timedelta
from tasks.utils.fh_utils import try_2_date, STR_FORMAT_DATE, datet... | null | tasks/tushare/tushare_stock_daily/stock.py | stock.py | py | 10,555 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tasks.utils.fh_utils.STR_FORMAT_DATE",
"line_number": 22,
"usage_type": "argument"
},
{
... |
437669179 | from functools import partial
import numpy as np
import pennylane as qml
from pennylane.tape import QuantumTape
from pennylane.transforms.control import ctrl, ControlledOperation
from pennylane.tape.tape import expand_tape
def assert_equal_operations(ops1, ops2):
"""Assert that two list of operations are... | null | tests/transforms/test_control.py | test_control.py | py | 8,522 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.testing.assert_allclose",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.testing",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pennylane.RX",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pennyla... |
241568593 | import jax.numpy as np
from jax import random, grad, jacfwd
from cmd import make_pd_bregman
import jaxlib
from jax.scipy import linalg
from cmd_helper import DP_pd, DP_inv_pd, D2P_pd, inv_D2P_pd
from cmd import make_lagrangian, updates, cmd_step, _tree_apply, make_bound_breg
import collections
from lq_game_helper impor... | null | fax/competitive/cmd/cmd_tester.py | cmd_tester.py | py | 23,720 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "jax.__version__",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "jaxlib.__version__",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "jax.config.config.update",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": ... |
539013383 | #coding=utf-8
#--do_train \
# --bert_model "bert-base-uncased" \
# --model_type "MatchModel" \
# --train_file "data/wikipassageQA/train.tsv" \
# --dev_file "data/wikipassageQA/dev.tsv" \
# --test_file "data/wikipassageQA/test.tsv" \
# --attacked_file "data/AttackedText/rate1_pos_text.txt"
# --do_lower_case \
# --lea... | null | run_BertSampleTrain.py | run_BertSampleTrain.py | py | 11,861 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.seed",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.seed",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"lin... |
397997056 | from flask import render_template
from flask import Blueprint
from flask import session
from flask import request
from flask import redirect
from model.table_user import User
from model.table_article import Article
main = Blueprint('index', __name__)
# 由session得到当前访问用户,找不到返回None
def current_user():
user_id = ses... | null | route/main_page.py | main_page.py | py | 1,888 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Blueprint",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.session.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "model.table_user.User.... |
431272617 | import numpy as np
import keras
from keras import backend as K
from sklearn.metrics import confusion_matrix
import converter as cvt
import guesser as gue
import glob
import os
def makeFilenames(data_name, cell_size, epoch, batch_size, timesteps, offset):
label_name = gue.tasksize_extractor(data_name)
rep_numbe... | null | regression_model/mmsus.py | mmsus.py | py | 8,276 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "guesser.tasksize_extractor",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "guesser.rep_extractor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.r... |
397338609 | import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d.axes3d as p3
import matplotlib.animation as animation
from Plot2 import *
from Helper import Datareader
from tqdm import tqdm
import time as timed
"""Constants"""
G = 6.6740831*10**(-11) #m^3*kg^(-1)*s^(-2)
dt = 3600*24 ... | null | Zon+aarde.py | Zon+aarde.py | py | 8,556 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "Helper.Datareader",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "numpy.diff",
"line_number... |
456544422 | import math
import boto3
from awswrangler.exceptions import InvalidArguments
def get_session(
session_primitives=None, key=None, secret=None, profile=None, region=None
):
"""
Return a configured Boto3 Session object
"""
if session_primitives:
key = session_primitives.key if session_primi... | null | awswrangler/common.py | common.py | py | 1,814 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "boto3.Session",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "boto3.Session",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "boto3.Session",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_numbe... |
372217934 | #!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import os
import sys
from genesys.global_config import global_paths
pi = np.pi
def plot_fiducial(lmax, plot_list=["TT", "EE", "BB", "TE"], lensed=True, fid_spectra_dir="pico_spectra", annotate_size=12, figsize=(20,10), axis_si... | null | plotting/plot_spectra.py | plot_spectra.py | py | 5,660 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.pi",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "genesys.global_config.global_... |
250360595 | import boto3
import botocore
import constants
if __name__ == "__main__":
ceph_endpoint = constants.CEPH_ENDPOINT
access_key = constants.AWS_ACCESS_KEY_ID
secret_key = constants.AWS_SECRET_ACCESS_KEY
region = constants.REGION
bucket_name = constants.BUCKET_NAME
topic_name = constants.TOPIC_NAME
... | null | kafka/configure_notification.py | configure_notification.py | py | 1,346 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "constants.CEPH_ENDPOINT",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "constants.AWS_ACCESS_KEY_ID",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "constants.AWS_SECRET_ACCESS_KEY",
"line_number": 8,
"usage_type": "attribute"... |
335633040 | from typing import (
List,
Tuple,
Dict,
Optional,
)
import os
import sys
import logging
import torch
import allennlp
import numpy as np
import scipy
from scipy import sparse
from metal.label_model import LabelModel
from metal.analysis import lf_summary
from tqdm import tqdm
from dpd.utils import Tens... | null | dpd/weak_supervision/collator/metal_collator.py | metal_collator.py | py | 5,701 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "collator.Collator",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "metal.label_model.LabelModel",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "util... |
385595897 | from flask import Flask
app = Flask(__name__)
@app.route('/') # Fill this in!
def index():
return "<h1>Go to 'puppy_latin/name' to get the latin name of your puppy!</h1>"
@app.route('/puppy_latin/<name>') # Fill this in!
def puppy_latin(name):
x = len(name)
latin = ""
if name[x - 1] == 'y':
... | null | Flask Bootcamp _ Udemy Course/Exercise 6.py | Exercise 6.py | py | 534 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "waitress.serve",
"line_number": 23,
"usage_type": "call"
}
] |
47813110 | import sqlite3
import json
class Product:
def __init__(self, db_row_raw):
db_row = dict(db_row_raw)
self.id_product = db_row["id_product"]
self.id_sales_product = db_row["id_sales_product"]
self.added_date = db_row["added_date"]
@staticmethod
def delete_from_db(db_conn, idd... | null | backend/data.py | data.py | py | 2,548 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlite3.Cursor",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.Cursor",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.Cursor",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.C... |
561182149 | #!/usr/bin/env python
# coding: utf-8
# In[534]:
# used for manipulating directory paths
import os
# Scientific and vector computation for python
import numpy as np
# Plotting library
from matplotlib import pyplot
import pandas as pd
# In[577]:
data= pd.read_csv("house_data_complete.csv")
# In[831]:
train... | null | Practical Assignment House Pricing/Practical Assignment House Pricing.py | Practical Assignment House Pricing.py | py | 3,944 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.split",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot"... |
248555095 | from http.server import BaseHTTPRequestHandler, HTTPServer
from urllib.parse import urlparse, parse_qsl, quote
from pathlib import Path
from functools import cmp_to_key
from subprocess import call
import os
import string
from os.path import expanduser
from threading import Thread
import socket
class MpvRequestHandler(... | null | server.py | server.py | py | 6,262 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "http.server.BaseHTTPRequestHandler",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "string.Template",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "os.se... |
237191820 | import csv
import json
from itertools import dropwhile
def filter_interesting(s_r_y_n):
'''composed filter function for mean_ages dataset
'''
return valid_year(s_r_y_n) and valid_name(s_r_y_n) and not_racist(s_r_y_n)
def not_racist(s_r_y_n):
'''we only want the whole population, not the foreigners, ... | null | preprocessing/filter_data_einwohner.py | filter_data_einwohner.py | py | 4,281 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "itertools.dropwhile",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 133,
"usage_type": "call"
}
] |
198495016 | import textwrap
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
from tornado.options import define, options
define("port", default=8000, help="run on the given port", type=int)
class ErrorHandler(tornado.web.RequestHandler):
def get(self):
self.write(u'you acces... | null | tutorial/hello3.py | hello3.py | py | 758 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tornado.options.define",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tornado.httpserver.web",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "tornado.httpserver",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": ... |
65788223 | import pygame
import time
import random
pygame.init()
crash_sound = pygame.mixer.Sound("crash.wav")
pygame.mixer.music.load("Broadway.mp3")
display_width=800
passed=0
display_height=600
car_width=64
car_height=80
black=(0,0,0) #Colors are defined in RGB format
white=(255,255,255)
red=(200,... | null | game.py | game.py | py | 6,962 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.mixer.Sound",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pygame.mixer.music.load... |
228134384 | # python 3.4.2
import matplotlib.pyplot as plt
from scipy.io import wavfile as wav
from scipy.fftpack import fft
import numpy as np
import os
INPUT_DIR = os.path.join(os.path.dirname(__file__), '..', 'test_files')
def plot_waveform(input_file, window):
"""
plot_waveform, plots the waveform of a 16 bit wav f... | null | scratch/audio_analysis.py | audio_analysis.py | py | 2,481 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "scipy.io.wavfile.read",
"l... |
379602910 | import requests
import json
firebaseUrl = ""
secret = "ujoGsxCI1V2W2dHxWswbQu6Kvzjh2UNGNQm6qZgN"
result = requests.get('https://arasreqsdb.firebaseio.com/outlookCreds.json').json()
for entry in result:
if entry == "inUse" or entry == "users":
pass
else:
got = json.dumps(result[entry])
... | null | misc/outlook_refresh.py | outlook_refresh.py | py | 1,337 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": ... |
299781709 | from urllib import request
from bs4 import BeautifulSoup
import config
import json
import time
import db
def get_page(url, data=None):
req = request.Request(url, data=data, headers=config.headers)
html = request.urlopen(req).read().decode('utf-8')
return html
def get_reviews(movie_id, query=None):
u... | null | crawler.py | crawler.py | py | 2,568 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "urllib.request.Request",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "urllib.request",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "config.headers",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "urllib.requ... |
12066129 | # -*- coding: utf-8 -*-
__author__ = 'zyzy'
'''
requests模拟登陆知乎,包括使用cookie自动登陆
'''
import requests # requsets模块 发送请求 可百度requests文档学习
try:
import cookielib # python2 cookielib相关模块
except:
import http.cookiejar as cookielib # python3 这样写可以实现python2和python3兼容
import re
import shutil #
import tim... | null | ArticleSpider/utils/zhihu_login_requests.py | zhihu_login_requests.py | py | 4,867 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.session",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "http.cookiejar.LWPCookieJar",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "http.cookiejar",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "re.search... |
128053453 | """...
"""
import sys, petsc4py
petsc4py.init(sys.argv)
import petsc4py.PETSc as petsc
import mpi4py.MPI as mpi
import numpy as np
import math
import importlib
import config as cfg
from mrpy.mr_utils import mesh
from mrpy.mr_utils import op
import mrpy.discretization.temporal as td
import mrpy.discretization.spatial ... | null | demos/incompressible_flow/kovasznay/run_unif.py | run_unif.py | py | 4,806 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "petsc4py.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "importlib.import_module",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "config.output_modul... |
252419743 | import pickle
import numpy as np
import distance
import taupz
from numba import jit
@jit(nopython=True)
def maxiscan(pstation, parrival, ptraveltimes, terr, maxi):
for j in range(0, len(pstation) - 1):
for k in range(j + 1, len(pstation)):
obdiff = parrival[j] - parrival[k]
for l in... | null | 3locate_numba.py | 3locate_numba.py | py | 12,380 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numba.jit",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 45,... |
4456798 | from django.shortcuts import render,redirect
from django.http import JsonResponse
from web import models
from web.forms.server import ServerModelForm
def server_list(request):
queryset = models.Server.objects.all()
return render(request,'server_list.html',{'queryset':queryset})
def server_add(request):
if... | null | day24/06/s27deploy/web/views/server.py | server.py | py | 1,371 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "web.models.Server.objects.all",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "web.models.Server",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "web.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.s... |
88893975 | """
Additional utilities for running command-line apps - most of these do not apply
to tool-contract-driven programs. (Ported from pbsmrtpipe)
"""
import argparse
import logging
import os
import platform
import time
import traceback
from pbcommand.validators import validate_file, validate_fofn
from pbcommand.utils i... | null | pbcommand/cli/utils.py | utils.py | py | 4,339 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
238774809 | import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.models import load_model
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPooling2D, Conv1D
from keras import backend as K
import numpy as np
import scipy.io as sio
import kerassurgeon as ks
... | null | py-thesis/Keras/prova3.py | prova3.py | py | 3,058 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "keras.datasets.mnist.load_data",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "keras.datasets.mnist",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "keras.backend.image_data_format",
"line_number": 27,
"usage_type": "call"
},
{
... |
451071219 | """
Single-pole balancing experiment using a feed-forward neural network.
"""
import multiprocessing
import os
import pickle
import numpy as np
import neat
import visualize
import gym
runs_per_net = 2
# Use the NN network phenotype and the discrete actuator force function.
def eval_genome(genome, config):
net ... | null | BipedalWalker_v3/find-genome.py | find-genome.py | py | 3,166 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "neat.nn.FeedForwardNetwork.create",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "neat.nn",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "gym.make",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
... |
455019682 | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 2 17:00:54 2018
@author: Administrator
"""
import xml.etree.ElementTree as ET
import os
from os import getcwd
import numpy as np
from PIL import Image
import cv2
import imgaug as ia
from imgaug import augmenters as iaa
import sys
import pickle,gzip
from... | null | tools/BoxToJpg.py | BoxToJpg.py | py | 13,155 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.listdir",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "xml.etree.ElementTree.parse",
... |
105856909 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from enum import Enum, unique
from collections import OrderedDict
import logging
import numpy
import theano
import theano.tensor as tensor
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
from theanolm.exceptions import IncompatibleStateError, InputEr... | null | theanolm/network/network.py | network.py | py | 14,955 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "theanolm.network.projectionlayer.ProjectionLayer",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "theanolm.network.tanhlayer.TanhLayer",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "theanolm.network.lstmlayer.LSTMLayer",
"line_number": 3... |
427750058 | # Notes
'''
check hsv color @ https://alloyui.com/examples/color-picker/hsv && https://www.rapidtables.com/web/color/RGB_Color.html
calculation tutorial @ https://www.youtube.com/watch?v=x4qPhYamRDI
h = hue (color in degrees) [0-360]
S = saturation [0%-100%]
v = value [0%-100%]
converted
0 > H > 360 -> OpenCV rang... | null | color_detector.py | color_detector.py | py | 2,550 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
6416379 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
import os
import re
import subprocess
from io import BufferedIOBase
from tempfile import NamedTemporaryFile
try:
from future.utils import python_2_unicode_compatible
except ImportError:
def python_2_unicode_co... | null | zxing/barcode.py | barcode.py | py | 4,818 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"li... |
164903778 | from typing import Dict, Union, Tuple
import torch
from torch import nn
from model.decoder import ITreeDecoder
class LinearDecoder(ITreeDecoder):
name = "Linear"
def __init__(self, h_enc: int, h_dec: int, label_to_id: Dict, dropout: float = 0.) -> None:
super().__init__(h_enc, h_dec, label_to_id)
... | null | model/decoder/linear_decoder.py | linear_decoder.py | py | 1,088 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "model.decoder.ITreeDecoder",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.nn",
... |
355518996 | """
Some miscellaneous functions used throughout many cbs modules
"""
import argparse
import errno
import logging
import os
import pathlib
import re
import subprocess
import sys
import time
from pathlib import Path
import numpy as np
import pandas as pd
logger = logging.getLogger(__name__)
try:
import dateutil.... | null | src/cbs_utils/misc.py | misc.py | py | 66,754 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "dateutil.parser",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "cbs_utils.Q_",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "os.getcwd",
"line_... |
320516030 | import math
import cv2
import matplotlib.pyplot as plt
import numpy as np
from skimage import color, io
from skimage.segmentation import clear_border
from skimage.measure import regionprops, label
from .utils import equ_hist_color_image
from IPython import embed
class PupilAnalysisException(Exception):
"""Base cl... | null | livestockwatch/pupil_analysis.py | pupil_analysis.py | py | 8,468 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.zeros",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "cv2.fastNlMeansDenoisingColored",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "cv2.GaussianBlur",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "cv2.cvtC... |
203805607 | import bcrypt
from flask import Flask, render_template, url_for, session, request, jsonify
from flask_socketio import SocketIO
import data_handler
from json_data import *
from util import json_response
from utils import *
app = Flask(__name__)
app.config['TEMPLATES_AUTO_RELOAD'] = True
app.secret_key = SESSION_SECRET... | null | main.py | main.py | py | 16,716 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask_socketio.SocketIO",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "flask.sessi... |
174578752 | from flask_appbuilder import ModelView,BaseView,expose, action, has_access
from flask_appbuilder.models.sqla.interface import SQLAInterface
from app import appbuilder
from wtforms.validators import NumberRange
from app.stsvs.models import Stsv
from app.stsvs.controllers import stsvcargamasiva
#### imports charts #####
... | null | app/stsvs/views.py | views.py | py | 2,848 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pytz.timezone",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "app.stsvs.contr... |
98412282 | from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = []
operations = [
migrations.CreateModel(
name='LogEntry',
fields=[
(
'id', models.AutoField(
verbose_name='ID', serialize... | null | mayan/apps/mailer/migrations/0001_initial.py | 0001_initial.py | py | 1,083 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.CreateModel",
"line_number": 8,
"usage_type": "call"
},
{... |
300632798 | import random_handler as ran
import math
import random
import constants_conversions as c
import interpolation
import sympy as sym
import frequency_and_phase_modulation as fm
x, y, z, t = sym.symbols('x y z t', real = True)
class tomasi_1_5:
def __init__(self, *args, **kwargs):
internal_resistance = c.resi... | null | est/tomasi.py | tomasi.py | py | 44,221 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sympy.symbols",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "constants_conversions.resistance",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "random_handler.main",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "con... |
215121627 | from requests import post,get
from json import loads
from os import system
headers = {
'Host': 'c.y.qq.com',
'Referer': 'http://c.y.qq.com/',
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 '
'Safari/537.36 '
}
def find_song(word):
"""
... | null | 测试-获取歌曲url.py | 测试-获取歌曲url.py | py | 2,017 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number":... |
480168719 | import random
import zipfile
from django.core.management.base import BaseCommand
from django.core.files import File as DjangoFile
from django.conf import settings
from django_seed import Seed
from users.models import User
NAME = "users"
class Command(BaseCommand):
help = f"This command creates {NAME}"
def ... | null | users/management/commands/seed_users.py | seed_users.py | py | 2,369 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "users.models.User.objects.create_superuser",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "users.models.User.objects",
"line_number": 45,
"usage_... |
629416060 | import warnings
import sklearn.metrics as metrics
from torch.autograd import Variable
import time
from scipy.io import loadmat
from collections import defaultdict
import numpy as np
import torch
from hinets.model_higcn import MyHIgcn as HiGCN
from sklearn.model_selection import StratifiedKFold
warnings.filterwarnings("... | null | train-higcn.py | train-higcn.py | py | 12,635 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.Inf",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "torch.save",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"... |
286650777 | """Rule definition for ansible syntax check."""
import json
import re
import subprocess
import sys
from typing import Any, List
from ansiblelint._internal.rules import BaseRule, RuntimeErrorRule
from ansiblelint.config import options
from ansiblelint.errors import MatchError
from ansiblelint.file_utils import Lintable... | null | src/ansiblelint/rules/AnsibleSyntaxCheckRule.py | AnsibleSyntaxCheckRule.py | py | 6,147 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.compile",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "re.MULTILINE",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "re.S",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "re.DOTALL",
"line_number":... |
314811382 | #----------------------------------------------------------------------------
# Name:
# Purpose:
#
# Authors:
#
# Created:
# Copyright: (c) Christian Chwala 2016
# Licence: The MIT License
#----------------------------------------------------------------------------
import scipy
imp... | null | pycomlink/spatial/interpol.py | interpol.py | py | 7,836 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.arange",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.meshgrid",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "numpy.vstack",
"line_num... |
87481063 | # 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 os
import json
from datetime import timedelta
import dateutil.parser
import utils
import logging
SCHEMA_VERSION ... | null | download_data.py | download_data.py | py | 4,136 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.walk",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "dateutil.parser.parser.parse",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "dateutil.parser.parser",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "date... |
580359842 | from flask import Flask,render_template,jsonify,request,redirect,url_for,session
import functools
app = Flask(__name__)
app.secret_key = "xxxxx"
DATA_DIC = {
1:{"name":"xxx","age":12},
2:{"name":"yyy","age":20}
}
def auth(func):
@functools.wraps(func)
def inner(*args,**kwargs):
username = ses... | null | flask/flask01/app01.py | app01.py | py | 1,803 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.session.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "flask.redirect",
"line... |
450266276 | from billiard import (
current_process,
)
from celery import (
Celery,
)
from celery.signals import (
celeryd_after_setup,
)
from prometheus_client import (
Counter,
)
from prometheus import (
registry,
)
TASKS_COUNT = Counter(
'task_count',
'Tasks completed',
['worker_id', 'thread_id'... | null | tasks/__init__.py | __init__.py | py | 735 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "prometheus_client.Counter",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "prometheus.registry",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "celery.Celery",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "celery.si... |
583833362 | # this takes a trained network as input and creates a
import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib
from data.results.sparsifier.latest_model.model import Siamese
from tqdm import tqdm
from data_getter import GibsonDataset
from torch.utils import data
import os
import pudb
import numpy as np
i... | null | src/sparsifier/confusion_matrix.py | confusion_matrix.py | py | 1,566 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.use",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",... |
343945259 | # @Time : 2017/4/17 16:31
# @Author : Cui X
# @File : commons.py
# 公共用法
import uuid
import hashlib
import time
def create_md5():
m = hashlib.md5()
m.update(bytes(str(time.time()), encoding='utf-8'))
return m.hexdigest()
def create_uuid():
return str(uuid.uuid1())
if __name__ == '__main__'... | null | day06/选课系统/select_system/lib/commons.py | commons.py | py | 399 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "hashlib.md5",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "uuid.uuid1",
"line_number": 19,
"usage_type": "call"
}
] |
518315123 | from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.contrib import admin
from rest_framework.urlpatterns import format_suffix_patterns
from .views import HomepageView, StorypageView, LoginpageView, AboutpageView, NewHeropageView
from .views import HeroLCAPIView, H... | null | pysomething/pysomething/urls.py | urls.py | py | 2,436 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.urlpatterns.format_suffix_patterns",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.patterns",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 17,
"usage_type": "call... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.