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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
600650507 | from social_core.storage import UserMixin, BaseStorage
from chalicelib.fam.db import users, social_auth, associations
from chalicelib.fam.common.logger import log_call
from botocore.exceptions import ClientError
class DynamoDBUserStorage(UserMixin):
current_user = None
@classmethod
@log_call(name='Dynamo... | null | chalicelib/fam/oauth/storage.py | storage.py | py | 4,091 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "social_core.storage.UserMixin",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "chalicelib.fam.common.logger.log_call",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "chalicelib.fam.db.users.User",
"line_number": 26,
"usage_type": "attri... |
233274566 | from django.contrib.auth import get_user_model
from django.test import TestCase
from ..models import (
Field,
Survey,
)
User = get_user_model()
class Tests(TestCase):
def setUp(self):
self.user = User.objects.create_user("foo", password="bar")
def test_likert_field_missing_scale(self):
... | null | formly/tests/tests.py | tests.py | py | 854 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.test.TestCase",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "models.Survey",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "... |
413597857 | import pytest
from jina.optimizers import EvaluationCallback
from jina.types.request import Request
from jina import Document
EVAL_NAME = 'evaluation'
NUM_REQUESTS = 3
NUM_DOCS_PER_REQUEST = 4
@pytest.fixture()
def operator(request):
return request.param
@pytest.fixture()
def callback(operator):
return Ev... | null | tests/unit/optimizers/test_evaluation_callback.py | test_evaluation_callback.py | py | 1,703 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pytest.fixture",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "jina.optimizers.EvaluationCallback",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "jina... |
112876390 | #/usr/bin/python3
'''
name: 泛微-OA漏洞
description: 泛微-OA Config信息泄露漏洞
'''
import pyDes
from app.lib.utils.request import request
class Weaver_Ecology_Oa_Config_BaseVerify:
def __init__(self, url):
self.url = url
self.headers = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.... | null | python/app/plugins/http/泛微OA/Weaver_Ecology_Oa_Config.py | Weaver_Ecology_Oa_Config.py | py | 1,250 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "app.lib.utils.request.request.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "app.lib.utils.request.request",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "pyDes.des",
"line_number": 24,
"usage_type": "call"
}
] |
642370787 | import serial
from serial import Serial
import time
import cv2
import threading
import os
def show_webcam(ser_id, mirror=False):
counter = 1
cam = cv2.VideoCapture(0) # change the device id to your camera
while True:
ret_val, img = cam.read()
if mirror:
img = cv2.... | null | pyUSBport.py | pyUSBport.py | py | 1,310 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.flip",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number":... |
470917563 | import unittest
import datetime
from Comunidad.Persona import Persona
from Comunidad.Base import Base, Session
from faker import Faker
class Test_fakerData(unittest.TestCase):
def setUp(self):
self.data_factory = Faker()
self.data = []
self.personas = []
for i in range(0,10... | null | tests/test_fakerData.py | test_fakerData.py | py | 3,195 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "unittest.TestCase",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "faker.Faker",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "Comunidad.Persona.Persona",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.... |
448385045 | # -*- coding: utf-8 -*-
def extract_band(hdf_image_id, working_directory, hdf_file, output_directory, band):
'''
Функция извлекает указанный канал из изображения, преобразует в проекцию и сохраняет в указанную директорию
:param working_directory: Рабочая директория, в которой находится файл
:param hdf_f... | null | mod13a1.py | mod13a1.py | py | 4,515 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.chdir",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.stat",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "ImagesBandsCtrl.create",
"line_number"... |
387302029 | # Requires
# pip install git+https://github.com/openai/whisper.git -q
print("import whisper")
import whisper
model = whisper.load_model('base')
print("import pytube")
from pytube import YouTube
youtube_video_url = "https://www.youtube.com/watch?v=M0PFDJ11Txg"
youtube_video = YouTube(youtube_video_url)
print(f"Titl... | null | llm/whisper/tts.py | tts.py | py | 641 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "whisper.load_model",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pytube.YouTube",
"line_number": 11,
"usage_type": "call"
}
] |
650208900 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: PYos41.py
# Author : summer1988 (wuzhonghua2734@gmail.com)
# DateTime: 2016-01-02 22:03
#
import decimal
import datetime
import six
from base import build_doc, DismantleRate, BasePY_TEMPLATE
class PY_TEMPLATE(BasePY_TEMPLATE):
"""
银行间拆借利率
"""
... | null | Learn_Scrapy/fin_data_crawler/web_crawler/PYos41.py | PYos41.py | py | 2,362 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "base.BasePY_TEMPLATE",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "base.DismantleRate",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "six.moves.range",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "six.moves",
... |
561527747 | # -*- coding: utf-8 -*-
import re
from typing import Optional, Tuple
import pkg_resources
pkg_name = 'flake8-broken-line'
#: We store the version number inside the `pyproject.toml`:
pkg_version: str = pkg_resources.get_distribution(pkg_name).version
INVALID_LINE_BREAK = re.compile(r'(?<!\\)\\$', re.M)
N400 = 'N40... | null | flake8_broken_line.py | flake8_broken_line.py | py | 740 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pkg_resources.get_distribution",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.M",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "typing.Optional",... |
180801297 | from IPython import display
import time
import PIL
import os
import imageio
import glob
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
tf.enable_eager_execution()
# define the dimensions of thei mage, including the rgb channel
HEIGHT, WIDTH, CHANNEL = 128, 128, 3
noise_dim = 100 # have a n... | null | generate.py | generate.py | py | 4,353 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tensorflow.enable_eager_execution",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tensorflow.random.normal",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tensorflow.random",
"line_number": 17,
"usage_type": "attribute"
},
{
... |
111348095 | #!/usr/bin/python3
######################################################################
# This program prin several reports on the status of the OGN DDB
######################################################################
import MySQLdb # the SQL data base routines
import json
import os
from ddbfun... | null | utils/report.py | report.py | py | 9,289 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "config.DBuser",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "config.DBpasswd",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "MySQL... |
553381353 | import numpy as np
import scipy as sci
from scipy.optimize import minimize
from scipy.interpolate import interp1d
from scipy.special import kv
import pickle
def load_object(filename):
with open(filename, 'rb') as fid:
return pickle.load(fid)
class fRegions(object):
def __init__(self, label =0, materi... | null | XANES2020_code/Betatron_analysis/xray_analysis.py | xray_analysis.py | py | 4,345 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pickle.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 29... |
351546312 | from django.conf.urls import patterns, include, url
from Solcito import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^submit_matricula/$', views.submitMatricula, name='submit_matricula'),
url(r'^edit_matricula/$', views.editMatricula, name='edit_matricula'),
url(r'^solcito$', view... | null | Solcito/urls.py | urls.py | py | 804 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "Solcito.views.index",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "Solcito.views",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.conf.... |
414199418 | import os.path as op
import numpy as np
import matplotlib.pyplot as plt
from pandas import read_csv
from mne.io import Raw
from mne import Epochs, find_events, pick_types
from mne.io import set_bipolar_reference
from h5io import read_hdf5
data_path = '/media/jrking/harddrive/Audio_sequence/data/NY523/NY523_AudioSequ... | null | scripts/analysis/pilots/NYU523/check_ERP.py | check_ERP.py | py | 1,815 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "mne.io.Raw",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "mne.find_events",
"line_number": ... |
391044910 | import sys
import xml.sax
import Stemmer
from nltk.corpus import stopwords
import re
from datetime import datetime
import multiprocessing
articles = []
class Article():
def __init__(self, x, y, z):
self.title = x
self.text = y
self.docID = z
class ParsingHandler(xml.sax.ContentHandler):... | null | wiki_indexer.py | wiki_indexer.py | py | 5,191 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "xml.sax.sax",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "xml.sax",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stop... |
609260975 | import datetime
from time import time
#import itertools
print('started at:', datetime.datetime.now(), '\n')
startTime = time()
def timeBetween(timeStart, timeStop):
sec = abs(timeStop - timeStart)
min = sec//60
sec -= min*60
h = min//60
min -= h*60
days = h//24
h -= days*24
return '{0... | null | euler_020.py | euler_020.py | py | 661 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.now",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "time.time",
"... |
69937736 | from bpy.types import Panel
from mathutils import Vector
# ---------------------------- Panel ---------------------------
class UIPANEL_PT_def(Panel):
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "Array Tools"
class UIPANEL_PT_trans(UIPANEL_PT_def):
"""Panel containing the settings f... | null | at_panel.py | at_panel.py | py | 5,208 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "bpy.types.Panel",
"line_number": 5,
"usage_type": "name"
}
] |
510616784 | from django.contrib.auth import get_user_model
from django.core.mail import EmailMessage
from django.db.models.signals import post_save
from django.dispatch import receiver
from backend import app_settings
from backend.models import Order, OrderStatus
from website import settings
@receiver(post_save, sender=Order)
d... | null | orders/backend/signals.py | signals.py | py | 1,367 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "backend.app_settings.ORDERS_SEND_ORDER_STATUS",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "backend.app_settings",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "backend.models.OrderStatus.BASKET",
"line_number": 14,
"usage_typ... |
494991727 | # -*- coding: utf-8 -*-
import scrapy
from scrapy.http import Request
import re
from datetime import datetime
from newscrawl.items import newsItem
import time
class MaoMingDailySpider(scrapy.Spider):
name = "maomingdaily"
allowed_domains = ["mm111.net"]
base_url = "http://paper.mm111.net"
newspapers =... | null | newscrawl/spiders/maomingdaily.py | maomingdaily.py | py | 2,560 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scrapy.Spider",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.today",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "scrapy.h... |
596457285 | from flask import request, abort
import requests
from logbook import Logger
from . import bp
from ...cache import cache
log = Logger(__name__)
@cache.memoize(timeout=600)
def _thumbnail_proxy(uri, referer):
return requests.get(
uri,
headers={
'referer': referer
}
)
@bp.... | null | torabot/frontend/main/thumbnail.py | thumbnail.py | py | 949 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logbook.Logger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cache.cache.memoize",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cache.cache",
"lin... |
572548273 | '''
word2vec module
see wor2vec_main.ipynb for examples about how to use this module.
'''
import sys, os
root = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(root, '..'))
from content.tree import *
import gensim
import numpy as np
import re
from gensim.models.word2vec import Word2Vec
from ... | null | word2vec/word2vec.py | word2vec.py | py | 7,160 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line... |
142011530 | # encode
'''
Class to
'''
from collections import Counter
from github.vkudva.encoders.encoder_factory import BaseSerDes
ENCODE_MAP = {
'.': 'DOT',
',': 'COMMA',
'?': 'QUESTION MARK',
'!': 'EXCLAMATION MARK'
}
class TelexSerdes(BaseSerDes):
"""
"""
def __init__(self):
super()._... | null | github/vkudva/encoders/telex_encoder.py | telex_encoder.py | py | 1,245 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "github.vkudva.encoders.encoder_factory.BaseSerDes",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "collections.Counter",
"line_number": 33,
"usage_type": "call"
}
] |
287090585 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r"^all/", views.user_admin, name="users"),
url(r"^create-view/", views.create_view, name="create-user-view"),
url(r"^create/$", views.create, name="create-user"),
url(r"^delete/(?P<uid>[a-zA-Z0-9_\-]{1,36})$", views.delete, name="... | null | coronafiec/users/urls.py | urls.py | py | 497 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.co... |
504592305 | # -*- coding: utf-8 -*-
"""
Created on Tue May 28 16:13:28 2019
@author: Kyle
"""
import csv
import os
import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Dropout, LSTM, Bidirectional, RepeatVector, TimeDistributed
from keras.callbacks import EarlyStopping
# read in the raw preproc... | null | bidirectional_lstm_encoder_decoder.py | bidirectional_lstm_encoder_decoder.py | py | 3,541 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_numb... |
147697944 | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Author(models.Model):
name = models.CharField(max_length=50)
def __str__(self):
return self.name
class Book(models.Model):
title = models.CharField(max_length = 250)
author = models.Fore... | null | library/books/models.py | models.py | py | 466 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.models.Model",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "... |
376981909 | import json
import urllib.request
import urllib.parse
##MAPQUEST_API_KEY = 'Fmjtd|luu8216tnh,70=o5-942s1a'
##BASE_MAPQUEST_URL = 'http://open.mapquestapi.com/directions/v2/'
def get_route_url(to: str,from_: str):
'''Returns a URL, which contains MapQuests API key, a user inputed
starting location... | null | Navagation/project3url.py | project3url.py | py | 1,065 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "urllib.request.parse.urlencode",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "urllib.request.parse",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 18,
"usage_type": "name"
},
{
"api_name"... |
194105580 | from flask import Flask, render_template, request
import os
from flask_cors import CORS
from PIL import Image
from predict import Predict
import json
app = Flask(__name__)
# app.config.from_object('satcounter_config')
CORS(app)
'''
이미지 처리 함수
'''
def image_resize(image, width, height):
return image.resize((int(width... | null | app.py | app.py | py | 2,289 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PIL.Image.ROTATE_180",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image",
"... |
481041328 | import argparse
import json
import os
import string
import subprocess
import sys
import time
import webbrowser
from io import BytesIO
from random import choice, randint, shuffle
from timeit import default_timer as timer
import numpy as np
import requests
import socketio
import svgwrite
import tensorflow.compat.v1 as t... | null | draw_bot.py | draw_bot.py | py | 13,969 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tensorflow.compat.v1.compat.v1.disable_eager_execution",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat.v1.compat",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.compat.v1",
"line_number": 25,
"usage_... |
575339484 | #!/usr/bin/env python3
"""Main script for gaze direction inference from webcam feed."""
import argparse
import os
import queue
import time
import numpy as np
import pandas as pd
import coloredlogs
import cv2 as cv
import tensorflow as tf
from datasources import Video, Webcam
from models import DPG, ELG
from util.infe... | null | src/elg_demo.py | elg_demo.py | py | 4,878 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "coloredlogs.install",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "tensorflow.ConfigProto",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "te... |
398778202 | from sympy import Symbol,pprint
import sympy as sym
import sympy.plotting as syp
import matplotlib.pyplot as plt
x=Symbol('x')
mu=Symbol('mu')
sigma=Symbol('sigma')
pprint(2*sym.pi*sigma)
print(2*sym.pi*sigma)
pprint(1/(sym.sqrt(2*sym.pi*sigma*sigma)))
part_1=1/(sym.sqrt(2*sym.pi*sigma**2))
part_2=sym.exp(-1*((x... | null | week2/170401035_2.py | 170401035_2.py | py | 750 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sympy.Symbol",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sympy.Symbol",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sympy.Symbol",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sympy.pprint",
"line_number"... |
134564967 | import networkx as nx
import blossom5.pyMatch as pm
"""
:param size:
:param plot_load:
We define the unit cell, which contains two qubits, a star operator and plaquette operator.
| |
- Star - Q_0 - also top (T) qubit
| |
- Q_1 - Plaq - also down (D) qubit
| |
By doing so, ... | null | old/toric_code.py | toric_code.py | py | 5,449 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "networkx.Graph",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "networkx.algorithms.matching.max_weight_matching",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "networkx.algorithms",
"line_number": 73,
"usage_type": "attribute"
},
... |
410643624 | from __future__ import print_function
import numpy as np
import h5py
import time
import matplotlib.pyplot as plt
from datetime import date,timedelta
import pandas as pd
import cPickle as pickle
import os
import sys
DATA_PATH = r'/Users/jpkotyla/Python/src/hdf5_testing//'
TESTDIR = r'/Users/jpkotyla/Python/src/hdf5_tes... | null | src/hdf5_testing/testing.py | testing.py | py | 3,286 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.random.normal",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.system",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.system",
"line... |
181728364 | from django.utils.translation import ugettext as _
from django.db.models.signals import class_prepared
from longerusername import MAX_USERNAME_LENGTH
def longer_username(sender, *args, **kwargs):
if sender.__name__ == "User" and sender.__module__ == "django.contrib.auth.models":
sender._meta.get_field("use... | null | longerusername/models.py | models.py | py | 823 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "longerusername.MAX_USERNAME_LENGTH",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.ugettext",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "longerusername.MAX_USERNAME_LENGTH",
"line_number": 8,
"usage_type": "... |
553516467 | from conans import ConanFile, Meson, tools
from conan.tools.files import rename
from conans.errors import ConanInvalidConfiguration
import glob
import os
import shutil
required_conan_version = ">=1.43.0"
class LibSigCppConanV2(ConanFile):
name = "libsigcpp"
homepage = "https://github.com/libsigcplusplus/libs... | null | recipes/libsigcpp/2.x.x/conanfile.py | conanfile.py | py | 3,896 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "conans.ConanFile",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "conans.tools.cross_building",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "conans.tools",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "conans.erro... |
490084564 | import os
import click
import torch
from typing import Tuple, Optional
from torch2tflite.converter import torch_to_tflite
from torch2tflite.utils import load_torchvision_model, load_model_from_file
@click.group()
def cli():
pass
@click.command(name="file")
@click.argument("input")
@click.argument("output")
@cli... | null | torch2tflite/main.py | main.py | py | 2,327 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "click.group",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.randn",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "torch2tflite.utils.load_model_from_file",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "torch2... |
511611758 | import pytest
import dpkt
@pytest.mark.skip(
reason="https://github.com/open-traffic-generator/snappi-ixnetwork/issues/525"
)
def test_capture_control(api, utils):
"""
The test is to check if capture has control packets included.
Validation: packet captures should have bgp packets
"""
config ... | null | tests/capture/test_capture_control.py | test_capture_control.py | py | 3,116 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "dpkt.pcapng.Reader",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "dpkt.pcapng",
"line_number": 93,
"usage_type": "attribute"
},
{
"api_name": "dpkt.ethernet.Ethernet",
"line_number": 94,
"usage_type": "call"
},
{
"api_name": "dpkt.ether... |
428196603 | #################################################################
#################################################################
############### BioJupies Plugin Updater ################
#################################################################
################################################################... | null | update/pipeline/pipeline-update.py | pipeline-update.py | py | 8,679 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pymysql.install_as_MySQLdb",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engi... |
404769027 | from utils.database import CreateDatabaseClient
from bson.objectid import ObjectId
from datetime import datetime, timedelta
import dateutil.parser
client = CreateDatabaseClient()
moviesCollection = client.moviesCollection()
ticketsCollection = client.ticketsCollection()
def bookTicket(jsonData):
showTimeString = j... | null | utils/methods.py | methods.py | py | 4,748 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "utils.database.CreateDatabaseClient",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "dateutil.parser.parser.parse",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "dateutil.parser.parser",
"line_number": 21,
"usage_type": "attribute"
}... |
75551952 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Part of Odoo.
# Copyright (C) 2021 Allegro IT (<http://www.allegro.lv/>)
# E-mail: <info@allegro.lv>
# Address: <Vienibas gatve 109 LV-1058 Riga Latvia>
# ... | null | l10n_lv_hr_payroll/models/hr_payroll.py | hr_payroll.py | py | 10,564 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "odoo.models.Model",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "odoo.fields.Boolean",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "odoo.fields",
... |
392418968 | from itertools import combinations as combi
relation=[["100","ryan","music","2"],["200","apeach","math","2"],["300","tube","computer","3"],["400","con","computer","4"],["500","muzi","music","3"],["600","apeach","music","2"]]
row=len(relation)
col=len(relation[0])
candidates=[]
for i in range(1, col+1):
... | null | 후보키.py | 후보키.py | py | 739 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "itertools.combinations",
"line_number": 10,
"usage_type": "call"
}
] |
131181227 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from Tkinter import *
from PIL import Image, ImageTk
import os
import sqlite3
import tkFileDialog
import ntpath
def path_leaf(path):
"""Dada una ruta, devuelve solo el nombre del archivo."""
head, tail = ntpath.split(path)
return tail #or ntpath.basename(head)
de... | null | RA/main.py | main.py | py | 23,130 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ntpath.split",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line... |
251687946 | #!/usr/bin/env python3
# coding=utf-8
#
# Copyright (c) 2020-2021 Huawei Device Co., Ltd.
# 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 | bearpi-hm_nano-oh_flower/00_src/bearpi-hm_nano_oh_fun/test/xdevice/src/xdevice/_core/environment/manager_env.py | manager_env.py | py | 7,655 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "_core.logger.platform_logger",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "_core.utils.convert_serial",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "_core.config.config_manager.UserConfigManager",
"line_number": 92,
"usage_type": ... |
510749827 | """
Reads data from Data/ and trains the Neural network on this data.
The network is then saved to be used in led_match.py
"""
from source.instance import get_json_from_path
from source.module import Module
from pathlib import Path
import tensorflow as tf
import numpy as np
import datetime
import os
def find_ratio(a... | null | source/panel_predictor/panel_finder/panel_classifier/panel_classifier.py | panel_classifier.py | py | 8,628 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "source.module.Module",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path",
"line... |
6881399 | import pygame
import sys
import time
import random
from pygame.locals import *
WINDOW_WIDTH = 800
WINDOW_HEIGHT = 600
GRID_SIZE = 50
GRID_WIDTH = WINDOW_WIDTH / GRID_SIZE
GRID_HEIGHT = WINDOW_HEIGHT / GRID_SIZE
BLACK = (0,0,0)
WHITE = (255, 255, 255)
GRAY = (80,80,80)
GREEN = (0, 50, 0)
ORANGE = (250, 150, 0)
UP = ... | null | snake backup.py | snake backup.py | py | 4,529 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.randint",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "pygame.Rect",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "pygame.draw.rect",
"lin... |
91655929 | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | null | bigbench/models/huggingface_models.py | huggingface_models.py | py | 14,330 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "transformers.TFGPT2LMHeadModel",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "transformers.GPT2Tokenizer",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "transformers.TFOpenAIGPTLMHeadModel",
"line_number": 47,
"usage_type"... |
325034686 | import torch.nn.functional as F
from src.model.emb import *
class TextNet(nn.Module):
@staticmethod
def padded(original_arr, final_len):
""" Center padding a [x*WORD_DIM] array to shape[SEQ_LEN*WORD_DIM] with zeros
Args:
original_arr: numpy array with shape [1, x*WORD_DIM], x MUST... | null | src/model/textnet.py | textnet.py | py | 4,672 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.functional.FloatTensor",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "torch.nn.functional.cat",
"line_number": 30,
"usage_type": "call"
},
{
"api_n... |
653559463 | import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
from mpl_toolkits.mplot3d import Axes3D
import csv, math
import numpy as np
LR = 0.1
EPSILON = 0.000001
def normalize(l):
return [(i-np.mean(l))/math.sqrt(np.var(l)) for i in l]
x = np.array([ [1,i] for i in normalize([float(line[0]) for line in csv.rea... | null | data/ans1/q1b.py | q1b.py | py | 981 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.mean",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.var",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 13,
... |
326168138 | from oslo_utils import timeutils
import pecan
from pecan import rest
import wsme
from wsme import types as wtypes
from oasis.api.controllers import base
from oasis.api.controllers import link
from oasis.api.controllers.v1 import collection
from oasis.api.controllers.v1 import types
from oasis.api import expose
from oa... | null | oasis/api/controllers/v1/requestheader.py | requestheader.py | py | 6,778 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "oasis.api.controllers.v1.types.JsonPatchType",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "oasis.api.controllers.v1.types",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "oasis.api.controllers.v1.types.JsonPatchType.internal_attrs",
... |
503048969 | from django.shortcuts import render, redirect
from .models import Train, Ticket
from django.template.loader import render_to_string
from django.http import HttpResponse,HttpResponseRedirect,JsonResponse
from .forms import ticket
from django.conf import settings # new
from django.views.generic.base import TemplateView
f... | null | home/views.py | views.py | py | 10,930 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.date.today",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "django.contrib.messages.warning",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "dja... |
93857241 | import numpy as np
import random
import os
import cv2
from sklearn import preprocessing
import pandas as pd
def initializeW_B(layers):
network = {}
# +1 for bias
for i in range(len(layers)-1):
layer = [[np.random.randn() for j in range(layers[i]+1)] for j in range(layers[i+1])]
networ... | null | bpn_train.py | bpn_train.py | py | 5,829 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.random.randn",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 17,
"usage_type": "call"
},
{
"api_name"... |
42755941 | from django.core.mail import send_mail
from django.template.loader import render_to_string
from decouple import config
from django.urls import reverse
from django.conf import settings
def send_activation_email(user):
url = reverse('activate', args=(user.activation_token,))
url = settings.SITE_URL + u... | null | backend/core/mail.py | mail.py | py | 678 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.reverse",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.SITE_URL",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 10,
"usage_type": "name"
},
{
"api_na... |
143966471 | import pytest
class TestBasicGalaxyMeasure:
@pytest.fixture(scope="class")
def overrides(self, devices):
overrides = dict(
model="sleep_sdss_measure_simple",
dataset="default" if devices.use_cuda else "cpu",
training="cpu",
)
return overrides
@p... | null | tests/test_galaxy_measure.py | test_galaxy_measure.py | py | 560 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pytest.fixture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 14,
"usage_type": "call"
}
] |
645392648 | import cv2
import platform
class VideoCalibration():
def lire(self):
cap = cv2.VideoCapture('Videos/VideoCalibrationV1.mp4')
# Si le système n'est pas un mac
if not platform.system() == "Darwin":
cv2.namedWindow("Frame", cv2.WND_PROP_FULLSCREEN)
cv2.setWindowProper... | null | src/videoCalibration.py | videoCalibration.py | py | 1,133 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "platform.system",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.namedWindow",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.WND_PROP_FULLSCRE... |
282451294 | import pandas as pd
import numpy as np
import math
import json
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib as mp
import ast
mp.rcParams["font.size"]=12
df_pipelines = pd.read_csv("../results/pipelines.csv")
fig,ax1 = plt.subplots(1,1)
locs = {-0.4:-0.1, 0.6000000000000001:0.4, 1.6:0.9, -2.... | null | plots/separate_pipelines.py | separate_pipelines.py | py | 1,220 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.rcParams",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "m... |
160017349 | """
The MIT License (MIT)
Copyright (c) 2015 Ricardo Yorky
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge... | null | emailqueue/mongodb.py | mongodb.py | py | 2,778 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "bson.objectid.objectid",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "bson.objectid",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "json... |
229331219 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import collections
a = ['Class-V', 'Class-VI', 'Class-VII', 'Class-VIII']
b = [1, 2, 2, 3]
s = zip(a, b)
d = collections.defaultdict(set)
for i, j in s:
d[i].add(j)
print(d)
| null | exercises/school/final mock/q6.py | q6.py | py | 227 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.defaultdict",
"line_number": 9,
"usage_type": "call"
}
] |
327539260 | from django.shortcuts import render,HttpResponse
from django.views import View
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.views.generic import ListView
from linuxInfoMoni import models
import json,time
from datetime import datetime
from .public.linuxMoni import moniLinuxServer,... | null | linuxInfoMoni/views.py | views.py | py | 10,685 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.views.View",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "linuxInfoMoni.models.serverInfo.objects.all",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "linuxInfoMoni.models.serverInfo",
"line_number": 13,
"usage_type": "attribu... |
67150277 | from pathlib import Path
import numpy as np
import pandas as pd
from utils import get_clusters_centre_mass
from hotspots.hs_io import HotspotReader, HotspotWriter
from hotspots.hs_ensembles import SelectivityResult
from hotspots.grid_extension import Grid, _GridEnsemble
def as_grid(origin_coords, far_corner_coords, a... | null | scripts/chembl_rescoring_scripts/generate_brd1_vs_all_select_maps.py | generate_brd1_vs_all_select_maps.py | py | 5,483 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "hotspots.grid_extension.Grid",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "hotspots.grid_extension._GridEnsemble.HDBSCAN_cluster",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "hotspots.grid_extension._GridEnsemble",
"line_number": 50,... |
354135465 | from mock import Mock, MagicMock, patch
from django.core import cache
from django.test import TestCase
from memcached_memoize import decorators
class TestMemcachedMethodDecorator(TestCase):
@patch('django.core.cache.cache')
@patch('memcached_memoize.cached_data.CachedData')
def test_memcached_decorator(... | null | tests/test_decorators.py | test_decorators.py | py | 10,772 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.test.TestCase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "mock.Mock",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.core.cache.get",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "django.core.... |
212474434 | import config
import argparse
from googleapiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
import json
import requests
from logzero import logger
import jsons
class GPhotos:
def __init__(self):
service = None
creds = None
def Login(self):
SCOPES = 'https:/... | null | upload_gphotos.py | upload_gphotos.py | py | 3,597 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "oauth2client.file.Storage",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "oauth2client.file",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "l... |
583400454 | """
Client to help construct mappings following the graft syntax.
This client is solely concerned with _syntax_, not how to expose
user-facing delayed objects that use grafts. For that, see the
Workflows implementation of Proxytypes, which provides a lazy,
strongly-typed proxy object interface, using graft to represen... | null | descarteslabs/common/graft/client/client.py | client.py | py | 19,645 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "itertools.count",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "six.iteritems",
"line_number": 194,
"usage_type": "call"
},
{
"api_name": "six.viewkeys",
"line_number": 208,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
"l... |
95832008 | import json
from mfixgui.tools.qt import get_ui
def make_info_widget(mfixgui):
""" Create widget for Info filemenu pane """
widget = mfixgui.ui.file_menu_info_widget = get_ui('info.ui')
return widget
def switch_tab_info(stackedwidget, mfixgui):
stackedwidget.setCurrentWidget(mfixgui.ui.file_menu_inf... | null | mfix-18.1.5/mfixgui/file_menu/info_widget.py | info_widget.py | py | 997 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "mfixgui.tools.qt.ui",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "mfixgui.tools.qt",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "mfixgui.tools.qt.get_ui",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "mfixgu... |
448287298 | """
img:你想要绘制图形的那幅图像。
color:形状的颜色。以 RGB 为例,需要传入一个元组,例如:( 255,0,0)代表蓝色。对于灰度图只需要传入灰度值。
thickness:线条的粗细。如果给一个闭合图形设置为 -1,那么这个图形就会被填充。默认值是 1.
linetype:线条的类型, 8-connected,抗锯齿等。默认情况是 8-connected。 cv2.LINE_AA为抗锯齿,这样看起来会非常平滑。
画线:
要画一条线,你只需要告诉函数这条线的起点和终点。我们下面会画一条从左上方到右下角的蓝色线段
cv2.line(img,(0,0),(511,511),(255,0,0),5)
画... | null | 006-图像处理/OpenCV/my-demo/绘图函数.py | 绘图函数.py | py | 3,653 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.zeros",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 61,
"usage_type": "attribute"
},
{
"api_name": "cv2.line",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
"line_numbe... |
320144571 | import os
from typing import Callable
import igibson
from igibson.envs.igibson_env import iGibsonEnv
try:
import gym
import torch as th
import torch.nn as nn
from stable_baselines3 import PPO
from stable_baselines3.common.evaluation import evaluate_policy
from stable_baselines3.common.preproce... | null | igibson/examples/demo/stable_baselines3_example.py | stable_baselines3_example.py | py | 5,971 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "stable_baselines3.common.torch_layers.BaseFeaturesExtractor",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "gym.spaces",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 41,
"usage_type": "call"... |
337804724 | from colorama import Fore, init, Style
class urmom:
def __init__(self):
init()
print(Fore.RED + 'some red text')
print(Style.DIM + 'and in dim text' + Style.RESET_ALL)
print('back to normal now')
COLORNAME = 'RED'
color = getattr(Fore, COLORNAME)
... | null | test_scripts/colorama_test.py | colorama_test.py | py | 368 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "colorama.init",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "colorama.Fore.RED",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "colorama.Fore",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "colorama.Style.DIM",
... |
39191442 | #!/usr/bin/env python
# coding=utf-8
"""
@author: Jiawei Wu
@create time: 2020-01-16 10:00
@edit time: 2020-03-12 16:28
@desc: 包含asv与目标动点的环境
"""
from .asv_dynamic import ASV
from .move_point import MovePoint
import numpy as np
import matplotlib.pyplot as plt
import gym
from gym import spaces
class ASVEnv(gym.Env):
... | null | jasv/asv_env.py | asv_env.py | py | 3,479 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gym.Env",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "asv_dynamic.ASV",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "move_point.MovePoint",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.i... |
86222850 | from django.conf.urls import patterns, include, url
from books import views
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'books_pro.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
#url(r'^test$', views.test, name='test'),... | null | books_pro/urls.py | urls.py | py | 683 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.patterns",
"line_number": 8,
"usage_type": "call"
},
{
"api... |
255161222 |
"""
Comparison of griddata and tricontour for an unstructured triangular grid.
"""
from __future__ import print_function
import matplotlib.pyplot as plt
from pylab import *
import matplotlib.tri as tri
import numpy as np
from numpy.random import uniform, seed
from matplotlib.mlab import griddata
import pdb
import li... | null | output/thermal_plot.py | thermal_plot.py | py | 12,735 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.subplot",
"line_number": 143,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 143,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.contour",
"line_number": 144,
"usage_type": "call"
},
{
"api_name... |
530713426 | from django.urls import path
from . import views
app_name = 'answers'
urlpatterns = [
path('<slug:slug>/update', views.AnswerUpdateView.as_view(), name='update'),
path('<slug:slug>/detail', views.AnswerDetailView.as_view(), name='detail'),
path('<slug:slug_exercise>/create', views.AnswerCreateView.as_vie... | null | answers/urls.py | urls.py | py | 343 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
}
] |
580547451 | #/usr/bin/python3
import xml.etree.ElementTree as ET
from xml.dom import minidom
from pathlib import Path
import argparse
labelPath = "/home/laboratory/lab/BioCreative/2010/BC2/bc2_ips_pmid2ppi_train.txt"
corpusRoot = "/home/laboratory/lab/BioCreative/2010/BC2/trainOffset/"
samplePath = "/home/laboratory/lab/BioCrea... | null | preprocessing/xmlToWholeSentence.py | xmlToWholeSentence.py | py | 5,357 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "xml.... |
538851248 | from typing import List, Tuple
import P1
# DEBEN DE PONERLE ANOTACION DE TIPO A TODAS LAS FUNCIONES
# 2. Crea una función que integre un polinomio (a0+a1x+a2x2+a3x3+...+anxn).
# El parámetro de esta función debe de ser una lista que contenga muchas tuplas que representan c/u de los términos
# del polinomio. Recomendac... | null | P2.py | P2.py | py | 607 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "P1.integra_termino",
"line_number": 13,
"usage_type": "call"
}
] |
107106663 | import utilities
from os.path import join
import logging
import re
log = logging.getLogger("CytoscapePlot")
def write_imp_graph(graph, fileName):
log.info("Writing IMP graph")
graphLogWrite = open(fileName, 'w')
graph.show(graphLogWrite)
graphLogWrite.close()
class CytoscapePlot():
""" Class for ... | null | pyext/src/CytoscapePlot.py | CytoscapePlot.py | py | 12,291 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "utilities.getAtomInfoFromName"... |
136714992 | """A setuptools based setup module.
See:
https://packaging.python.org/guides/distributing-packages-using-setuptools/
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
from pathlib import Path
import os
import re
# Utility function to read t... | null | setup.py | setup.py | py | 2,582 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pathlib.Path",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 28,
... |
157092821 | import collections
import settings
import numpy as np
from statistics import mean
from scipy.interpolate import interp1d
"""
Note:
1. Skip values larger than 240.
2. Add 128 to values less than 128.
"""
def fix_raw_value(response):
if not response:
return
val = int.from_bytes(response, 'big')... | null | receiver/DSP_utils.py | DSP_utils.py | py | 6,634 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "settings.CUT_INTERVAL",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "settings.POINTS_AFTER_INTERPOLATION",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "settings.POINTS_PER_SAMPLE",
"line_number": 42,
"usage_type": "attrib... |
22277437 | """code from:
https://www.mathblog.dk/project-euler-70-investigate-values-of-n-for-which-%CF%86n-is-a-permutation-of-n/"""
from utils.utils import primes_below
b = 1
pb = 1
br = 1000
MAX = 10000000
lb = 2000
ub = 5000
primes = [x for x in primes_below(ub) if x > lb]
def is_perm(n, phi):
return ''.join(sorted(st... | null | codes/problems/problem70.py | problem70.py | py | 688 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "utils.utils.primes_below",
"line_number": 12,
"usage_type": "call"
}
] |
641807808 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | null | vsts/vsts/test/v4_1/models/build_coverage.py | build_coverage.py | py | 1,767 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "msrest.serialization.Model",
"line_number": 12,
"usage_type": "name"
}
] |
563137872 | from dataclasses import dataclass
import os
import yaml
import cv2
from tqdm import tqdm
import numpy as np
from core.reader import VideoEffectReader, ImageEffectReader
from utils.new_ct import color_transfer
# from utils.color_transfer import color_transfer, hist_norm, simplest_cb
from utils.bbox_utils import (conver... | null | core/augment.py | augment.py | py | 16,354 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.ndarray",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "yaml.load",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "yaml.FullLoader",
... |
512606297 | from os import listdir
from process_kml import process, vehicle_props, map_movement_to_vehicle, order_dicts
from calc_co2 import counter_timeline
from fakedata import augment_transport
import json
directory = './Bewegungsdaten'
files = listdir(directory)
for i in range(len(files)):
files[i] = directory + '/' + fil... | null | __main__.py | __main__.py | py | 776 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.listdir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "process_kml.process",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "process_kml.order_dicts",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "calc_co2.counte... |
510531362 |
#!/usr/bin/env python
# Copyright (C) 2016 Toyota Motor Corporation
"""Flesh Color Detection Sample"""
import cv2
from cv_bridge import CvBridge, CvBridgeError
import rospy
from sensor_msgs.msg import Image
def create_mask_image(channel, th_max, th_min):
ret, src = cv2.threshold(channel, th_max, 255, cv2.THRESH... | null | catkin_ws/scripts/image_processing.py | image_processing.py | py | 2,504 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.threshold",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.THRESH_TOZERO_INV",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "cv2.threshold",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.THRESH_BIN... |
454847588 | from django.shortcuts import render, redirect
from django.http import HttpResponse
from .forms import PostForm, UpdateForm, CommentForm
from .models import Post
from .filters import PostFilter
def homePageView(request):
# Show posts in descending order
posts = Post.objects.all()
f = PostFilter(request.GET... | null | posts/views.py | views.py | py | 2,172 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "models.Post.objects.all",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.Post.objects",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "models.Post",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "filters.... |
387170183 | from django.conf.urls import url
from . import views
urlpatterns = [
url(
regex=r'^$',
view=views.index,
name='index'
),
url(
regex=r'^(?P<board>\w+)/$',
view=views.boards,
name='list'
),
url(
regex=r'^(?P<board>\w+)/new/$',
view=views... | null | pages/urls.py | urls.py | py | 1,190 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.... |
419902166 | import requests
import numpy as np
import pandas as pd
from bs4 import BeautifulSoup
class wikitable:
#function that makes a request to wikipedia and returns the raw html of the page
def get_html(url):
try:
response = requests.get(url)
response.raise_for_status()
ex... | null | wikitable.py | wikitable.py | py | 4,317 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.exceptions",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.DataFr... |
125045483 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('parking', '0005_auto_20150616_1815'),
]
operations = [
migrations.AlterField(
model_name='area',
nam... | null | Smart-Urban-Parking/supweb/parking/migrations/0006_auto_20150616_1823.py | 0006_auto_20150616_1823.py | py | 547 | 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"
},
{... |
411649140 | import json
import os
import tornado
import tornado.gen
import tornado.web
import tornado.websocket
import urllib
class WebServerHandler(tornado.web.RequestHandler):
def initialize(self, webserver):
self._webserver = webserver
@tornado.web.asynchronous
@tornado.gen.coroutine
def get(self, ur... | null | mbeam/webserver.py | webserver.py | py | 4,476 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tornado.web",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "tornado.web",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "tornado.gen",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "tornado.web.Applic... |
615869157 | import requests
from bs4 import BeautifulSoup
URL = 'https://store.steampowered.com/app/1085660/Destiny_2/'
headers = {
"User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36'}
page = requests.get(URL)
soup = BeautifulSoup(page.content,... | null | Destiny2Example.py | Destiny2Example.py | py | 511 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 11,
"usage_type": "call"
}
] |
213707055 | import matplotlib.pyplot as plt
import numpy as np
import sys
from . import colors
#TODO: I need to remake the plt.gca() function to find my Axes_bpl
def _get_ax(**kwargs):
"""
Get an axis object to plot stuff on.
This will take the axis from kwargs if the user specified `ax`. If not, it
will get th... | null | betterplotlib/_tools.py | _tools.py | py | 11,694 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.gca",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "numpy.percentile",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "numpy.floor"... |
487409850 | # from the finance file deduce month by month the difference in income. Determine the monthly income, change in income,
#and the month with the highest and lowest income.
#steps to take.
#1. Loop through all transactions
# 2. Check date on each transaction
# check amount on each transaction
# 4. convert month from num... | null | assignment_hols_queen.py | assignment_hols_queen.py | py | 3,794 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 57,
"usage_type": "attribute"
}
] |
19825235 | from asyncore import write
import numpy as np
import json
import torch
import torch.optim as optim
import torch.nn as nn
import torchvision
import torchvision.transforms as transforms
from torch.autograd import Variable
import torch.utils.data as data
import argparse
import logging
import os
import copy
from math impor... | null | prep.py | prep.py | py | 35,573 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "torch.optim.Adam",
"line_number": 140,
"usage_type": "call"
},
{
"api_name": "torch.optim",
"line_number": 140,
"usage_type": "name"
},
{
"api_name": "torch.optim.Ad... |
637965699 | #!/usr/bin/env python
#-*-coding: utf-8-*-
# Version: 0.1
# Author: Song Huang <huangxiaohen2738@gmail.com>
# License: Copyright(c) 2015 Song.Huang
# Summary:
import numpy as np
import matplotlib.pyplot as plt
data = np.loadtxt("1.txt")
width = (data[1,0] - data[0, 0])*0.4
plt.figure(figsize=(8, 5))
plt.bar(data[:... | null | 2d/1/4.py | 4.py | py | 448 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.loadtxt",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "matplotlib.p... |
283287516 | # encoding: utf-8
import pandas as pd
import numpy as np
import utils
import const
def get_disperstion():
cap_df = utils.get_stock_cap()
p_df = utils.get_stock_price()
r_df = p_df.pct_change()
exr_df = np.exp(r_df)
m_df = cap_df.div(cap_df.sum(axis=1), axis='index')
m_df.columns = m_df.column... | null | risk/dispersion.py | dispersion.py | py | 903 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "utils.get_stock_cap",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "utils.get_stock_price",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"l... |
405603162 | #
# Copyright (C) 2020 Georgia Institute of Technology. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
from typing import Dict, Tuple
import torch
import torch.nn as nn
_CACHE_KEY_TYPE = Tuple[int, int]
_CACHE_VAL_TYPE = Dict[str, torch.Tensor]
class TwoDeeArgmax(nn.Module):
def __init__(self... | null | oscar/utils/layers.py | layers.py | py | 2,258 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.Tuple",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Module",
"lin... |
303105984 | import redis
from redis_ratelimit.utils import calc_ttl, default_pool, parse_rate
class RateLimit:
def __init__(
self, rate: str, key: str, value: str, redis_pool: dict = default_pool,
):
self.rate = rate
self.key = key
self.value = value
self.pool = redis_pool
@pr... | null | redis_ratelimit/checks.py | checks.py | py | 1,145 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "redis_ratelimit.utils.default_pool",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "redis_ratelimit.utils.parse_rate",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "redis.Redis",
"line_number": 25,
"usage_type": "call"
},
{
"ap... |
618635072 | from typing import List
from django.core.exceptions import ValidationError
from ...product import AttributeInputType, models
from ...product.error_codes import ProductErrorCode
def validate_attribute_input_for_product(instance: models.Attribute, values: List[str]):
if not values:
if not instance.value_r... | null | saleor/graphql/product/utils.py | utils.py | py | 1,524 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "product.models.Attribute",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "product.models",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.core.exc... |
299787063 | from django import template
register = template.Library()
import re
def escapelatex(s):
s = s.replace("_", r"\_")
s = s.replace("\r", r"\\")
s = s.replace("\\\\\n\\\\", "\r\r")
s = s.replace("&", r"\&")
s = re.sub(r"\*\*(?P<content>.*?)\*\*", r"\\textbf{\g<content>}", s)
s = re.sub(r"//(?P<content>.*?)//", r"\\... | null | lettr/templatetags/escapelatex.py | escapelatex.py | py | 904 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.template.Library",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "re.sub",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_numbe... |
150136497 | # -*- coding: utf-8 -*-
import os, pandas
from jinja2 import Environment, FileSystemLoader
import utils, MasterData
import LCIA_ifu_reader as ifu
import numpy, shutil
from copy import copy
def recursive_rendering(e, env, result_folder, result_filename):
if type(e) == GenericObject:
template = env.get_templa... | null | modules/release/update_methods.py | update_methods.py | py | 5,078 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "utils.replace_HTML_entities",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.float64",... |
550006382 | import datetime
from math import sqrt
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import train_test_split
from sklearn.tree import export_graphviz
df = pd.read_csv(... | null | src/prediction_with_random_forest.py | prediction_with_random_forest.py | py | 6,642 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.DatetimeIndex",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.Dateti... |
316792610 | import math
import ujson
from collections import Counter
from subs.miniscape import items
from subs.miniscape import quests
from subs.miniscape import users
from subs.miniscape import adventures as adv
from subs.miniscape.files import RECIPE_JSON
GATHER_HEADER = f':hammer_pick: __**GATHERING**__ :hammer_p... | null | craft.py | craft.py | py | 7,759 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "subs.miniscape.files.RECIPE_JSON",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "ujson.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "s... |
481816843 | #!/usr/bin/env python3
''' ================
Results emitter
================
jobs_emitter.py | Dispatcher server
|
V
RabbitMQ | message queue bus
| | |
V V V
jobs_receiver.py | Workers
(x) ... | null | RabbitMQ/results_emitter.py | results_emitter.py | py | 2,218 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.time",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"... |
587304211 | # 此脚本需要在windows系统中双击执行
# 1、登录服务器
# 2、跳转到项目地址,执行git pull更新代码
# 3、执行mvn clean install命令
# 4、杀tomcat进程
# 5、备份当前war包
# 6、清空webapps文件夹
# 7、复制war包到webapps下,修改文件名
# 8、启动tomcat
import time
import paramiko as paramiko
import os
# 服务器
host = "122.112.236.194"
# 端口
port = 22
# 用户名
username = 'root'
# 密码
password = 'Dlf1989128'
ss... | null | project/project-python/utils/war_deploy_linux.py | war_deploy_linux.py | py | 4,617 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "paramiko.SSHClient",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "paramiko.AutoAddPolicy",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "time.localtim... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.