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
221281928
from __future__ import absolute_import import os import sys from collections import namedtuple from six.moves import zip # We should aspire to create batches of less than 15 python files # although this is not a strict limit. Setting a target of 10 files, # will on average yield batches of 10-15. TARGET_FILE_NUMBER =...
null
scripts/create_incr_tickets.py
create_incr_tickets.py
py
6,221
python
en
code
null
code-starcoder2
66
[ { "api_name": "six.moves.zip", "line_number": 79, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 117, "usage_type": "call" }, { "api_name": "os.path", "line_number": 117, "usage_type": "attribute" }, { "api_name": "os.walk", "line_number"...
109172225
# -*- coding: utf-8 -*- # Importing Scrapy Library import scrapy from bs4 import BeautifulSoup from amazon_scraper.items import AmazonItem # Creating a new class to implement Spider class AmazonReviewsSpider(scrapy.Spider): # Spider name name = 'amazon_reviews' # Domain names to scrape allowed_domai...
null
amazon_scraper/amazon_scraper/spiders/amazon_reviews_spider.py
amazon_reviews_spider.py
py
3,630
python
en
code
null
code-starcoder2
66
[ { "api_name": "scrapy.Spider", "line_number": 10, "usage_type": "attribute" }, { "api_name": "amazon_scraper.items.AmazonItem", "line_number": 41, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 43, "usage_type": "call" }, { "api_name": "...
498024323
from datetime import datetime import pygame from pygame.locals import * import time import os, sys import planet import company import solarsystem import datetime import primitives import global_variables import gui import random import importlib importlib.reload(sys) if hasattr(sys,"setdefaultencoding")...
null
highfrontier/src/highfrontier/main.py
main.py
py
8,342
python
en
code
null
code-starcoder2
66
[ { "api_name": "importlib.reload", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.setdefaultencoding", "line_number": 17, "usage_type": "call" }, { "api_name": "global_variables.window_size", "line_number": 29, "usage_type": "attribute" }, { "api_nam...
360638790
from flask import Flask, render_template, request, redirect from flask_sqlalchemy import SQLAlchemy # instead of mysqlconnection from sqlalchemy.sql import func from flask_migrate import Migrate # this is new app = Flask(__name__) # configurations to tell our app about the database we'll be connecting to app.config...
null
python/OOP/first_orm_project/app.py
app.py
py
2,015
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 10, "usage_type": "call" }, { "api_name": "flask_migrate.Migrate", "line_number": 12, "usage_type": "call" }, { "api_name": "sqlalche...
414129203
import scipy.signal as signal from numpy import * import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt from matplotlib.mlab import psd def selfpsd(x, NFFT=None, Fs=None, Fc=None, detrend=None, window=None, noverlap=None, pad_to=None, sides=None, scale_by_freq=None): if Fc is N...
null
self_psd.py
self_psd.py
py
3,551
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.use", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.mlab.psd", "line_number": 15, "usage_type": "call" } ]
452881240
#coding=utf-8 ''' Created on 2012-12-11 @author: Administrator ''' import logging.config from logging.handlers import RotatingFileHandler class Logging: logDir = "/opt/netbase4/log" __inited = False @staticmethod def _initLogConf(): logging.config.fileConfig(Logging.logDir + "/log...
null
products/netUtils/logger.py
logger.py
py
1,208
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.config.config.fileConfig", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.config.config", "line_number": 19, "usage_type": "attribute" }, { "api_name": "logging.config", "line_number": 19, "usage_type": "name" }, { "api_na...
287130152
from django.shortcuts import render from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status from rest_framework.authentication import TokenAuthentication from rest_framework import filters from rest_framework.authtoken.views import ObtainAuthToken from re...
null
rest/profilr_api/views.py
views.py
py
3,997
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.views.APIView", "line_number": 18, "usage_type": "name" }, { "api_name": "rest_framework.response.Response", "line_number": 30, "usage_type": "call" }, { "api_name": "rest_framework.response.Response", "line_number": 39, "usage_type": "call" ...
570324496
import sys import os import numpy as np import argparse def hextobin(hex_string): bin_string = bin(int(hex_string,16))[2:] return bin_string def signPermutation(p): # explicitly using cycle notation of permutation # input: p is a list of permutation indices # i.e. [x_sorted, p] = sort(x_unsorted) n = len(p) ...
null
parse_ci_vectors.py
parse_ci_vectors.py
py
3,619
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.isfile", "line_number": 44, "usage_type": "call" }, { "api_name": "os.path", "line_number": 44, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.argsort", "line_number...
63878060
import RPi.GPIO as GPIO import signal from flask import Flask, render_template, Response, request from camera import Camera from motor import Motor pin_status_led = 17 app = Flask(__name__) camera = Camera() camera.setDaemon(True) camera.start() motor = Motor(pin_a1 = 21, pin_a2 = 20, pin_b1 = 16, pin_b2 = 12) moto...
null
server/app.py
app.py
py
1,499
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "camera.Camera", "line_number": 11, "usage_type": "call" }, { "api_name": "camera.setDaemon", "line_number": 12, "usage_type": "call" }, { "api_name": "camera.start", "line_nu...
651698723
# _*_coding:utf-8_*_ import xml.etree.ElementTree as ET tree = ET.parse("movies_1.xml") root = tree.getroot() for child in root.findall('movie'): child.remove(child.find('format')) studio = ET.Element('studio') studio.text = 'XX' child.append(studio) tree.write('movies_new.xml')
null
XML/ET_xml_1.py
ET_xml_1.py
py
301
python
en
code
null
code-starcoder2
66
[ { "api_name": "xml.etree.ElementTree.parse", "line_number": 5, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 5, "usage_type": "name" }, { "api_name": "xml.etree.ElementTree.Element", "line_number": 11, "usage_type": "call" }, { "api...
340444937
from collections import defaultdict import heapq class DirectedEdge: def __init__(self, origin, dest, length): self.origin, self.dest, self.length = origin, dest, length class Vertex: def __init__(self, name, edges = []): self.name, self.edges = name, edges def __lt__(self, other): # Irrelevant, but ne...
null
py/dijkstra_fewest_edges.py
dijkstra_fewest_edges.py
py
2,034
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.defaultdict", "line_number": 16, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 17, "usage_type": "call" }, { "api_name": "heapq.heappop", "line_number": 22, "usage_type": "call" }, { "api_name": "heapq.h...
627783398
#!/usr/bin/env python # coding=utf-8 # @Time : 2018-12-09 下午5:22 # @Author : wuyunzhen # @File : tools.py # @Product : PyCharm # @Docs : 工具类 # @Source : import os import json from collections import defaultdict from werkzeug.datastructures import ImmutableMultiDict...
null
Aomp_vrc_tmp/common/tools.py
tools.py
py
5,391
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 21, "usage_type": "attribute" }, { "api_name": "xmltodict.parse", "line_number": 26, "usage_type": "call" }, { "api_name": "xmltodict.parse", "line_number": 31, "usage_type": "call" }, { "api_name": "json.loads", "lin...
268261756
###################################################################### # # File: b2/console_tool.py # # Copyright 2018 Backblaze Inc. All Rights Reserved. # # License https://www.backblaze.com/using_b2_code.html # ###################################################################### from __future__ import absolute_im...
null
b2/console_tool.py
console_tool.py
py
53,763
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 49, "usage_type": "call" }, { "api_name": "account_info.sqlite_account_info.B2_ACCOUNT_INFO_ENV_VAR", "line_number": 55, "usage_type": "name" }, { "api_name": "account_info.sqlite_account_info.B2_ACCOUNT_INFO_DEFAULT_FILE", "l...
600811290
import mysql.connector from mysql.connector import errorcode import os from dotenv import load_dotenv from sklearn.feature_extraction.text import TfidfVectorizer from operator import itemgetter from datetime import datetime, timedelta import csv import json load_dotenv() config = { 'user': os.getenv("MYSQL_USER")...
null
analysis_corpus.py
analysis_corpus.py
py
4,054
python
en
code
null
code-starcoder2
66
[ { "api_name": "dotenv.load_dotenv", "line_number": 11, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 14, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 15, "usage_type": "call" }, { "api_name": "os.getenv", "line_number":...
575214129
from django.contrib import admin from django.contrib.auth.models import User, Group from .models import * @admin.register(UserStatus) class UserStatusAdmin(admin.ModelAdmin): list_display = ( 'id', 'status', ) search_fields = ['id', 'status', ] @admin.register(User) class UserAdmin(admin.ModelA...
null
apps/login_registration/admin.py
admin.py
py
813
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 7, "usage_type": "name" }, { "api_name": "django.contrib.admin.register", "line_number": 6, "usage_type": "call" }, { ...
393653020
import time import datetime import json import redis from .control import Control from nanpy import (ArduinoApi, SerialManager) default_connection = SerialManager(device='/dev/ttyUSB0') # r = redis.Redis(host='127.0.0.1', port=6379) class ButtonControl(Control): def __init__(self, pin, name=None, key=None, conne...
null
controls/arduino/button_control.py
button_control.py
py
1,261
python
en
code
null
code-starcoder2
66
[ { "api_name": "nanpy.SerialManager", "line_number": 8, "usage_type": "call" }, { "api_name": "control.Control", "line_number": 11, "usage_type": "name" } ]
642483098
from django.conf.urls import url, include from . import views app_name = 'main' urlpatterns = [ url(r'^$', views.main_index, name='index'), url(r'^gloabl_search[/]?$', views.global_search, name='global_search'), url(r'^my_account[/]?$', views.my_account, name='my_account'), url(r'^login[/]?$', views....
null
main/urls.py
urls.py
py
3,146
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "django.c...
415534661
import sqlalchemy as sa from .base import metadata study_tags = sa.Table( "study_tags", metadata, sa.Column( "study_id", sa.BigInteger, sa.ForeignKey("projects.id", onupdate="CASCADE", ondelete="CASCADE"), nullable=False, ), sa.Column( "tag_id", sa.B...
null
packages/postgres-database/src/simcore_postgres_database/models/tags.py
tags.py
py
921
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlalchemy.Table", "line_number": 5, "usage_type": "call" }, { "api_name": "base.metadata", "line_number": 7, "usage_type": "argument" }, { "api_name": "sqlalchemy.Column", "line_number": 8, "usage_type": "call" }, { "api_name": "sqlalchemy.BigInteg...
236963906
from firebase import Firebase import calendar import time from firebase import Firebase import datetime as dt from datetime import datetime rootRef = Firebase('https://iot-s613420.firebaseio.com/Aquaponics/System/Logs') def send(type, compenent, description): year = str(datetime.now().strftime('%Y')) month = str(...
null
wamp/v1/firebase_log_2.py
firebase_log_2.py
py
714
python
en
code
null
code-starcoder2
66
[ { "api_name": "firebase.Firebase", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "name" }, { "api_name": "datetime.dat...
524169413
import sys import argparse from app.core.console import runner def main(shell_arguments): """ Verifica a opção utilizado e executa comando correspondente :param shell_arguments: shell_arguments :return: void """ args = parse_command_line(shell_arguments) if args.dbmigrate is not None: ...
null
fava.py
fava.py
py
2,548
python
en
code
null
code-starcoder2
66
[ { "api_name": "app.core.console.runner.migrate", "line_number": 16, "usage_type": "call" }, { "api_name": "app.core.console.runner", "line_number": 16, "usage_type": "name" }, { "api_name": "app.core.console.runner.runSeeder", "line_number": 19, "usage_type": "call" }, ...
408641151
import numpy as np import math import matplotlib.pyplot as plt m=1. c=0.1 k=1. dt=0.01 def eom(x,dx,u): return (u-c*dx-k*np.sin(x))/m #return (u-c*dx-k*x)/m def next_state(x,dx,u): kx1 = dx kdx1 = eom(x,dx,u) kx2 = dx+kdx1*dt/2. kdx2 = eom(x+kx1*dt/2.,dx+kdx1*dt/2.,u) kx3 = dx+kdx2*dt...
null
preliminary/bode/bode3/experimental_bode.py
experimental_bode.py
py
3,974
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.sin", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 30, "usage_type": "attribute" }, { "api_name": "numpy.sin", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 46...
549093434
# encoding: utf-8 import datetime from WindPy import w from data_access.db_data_collection import DataCollection from back_test.model.constant import Util from Utilities import admin_write_util as admin import pandas as pd import numpy as np w.start() # date = datetime.date.today() date = datetime.date(2019,1,28) d...
null
data_access/insert_daily_data.py
insert_daily_data.py
py
8,523
python
en
code
null
code-starcoder2
66
[ { "api_name": "WindPy.w.start", "line_number": 10, "usage_type": "call" }, { "api_name": "WindPy.w", "line_number": 10, "usage_type": "name" }, { "api_name": "datetime.date", "line_number": 14, "usage_type": "call" }, { "api_name": "Utilities.admin_write_util.conn...
532727011
from django import forms from rentals.models import Booking from django.core.exceptions import ValidationError from datetime import timedelta class BookingForm(forms.ModelForm): class Meta: model = Booking fields = ('car', 'start_time', 'duration_hrs') def clean(self, *args, **kwargs): ...
null
tinycar/rentals/forms.py
forms.py
py
848
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": "rentals.models.Booking", "line_number": 9, "usage_type": "name" }, { "api_name": "datetime...
310569730
''' This takes the bitalino openRevoution sensor EDA data froma txt file And extracts the basic features from the EDA. Author : Santhosh Nayak (santhoshnayak0903@gmail.com) \ Gautam Sawala date : 16 -02- 2018 ''' import numpy as np import matplotlib.pyplot as plt import biosppy as bs #load the data fromthe file x = n...
null
old/read_eda.py
read_eda.py
py
1,495
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.loadtxt", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 39, "usage_type": "call" }, { "api_name": "matplotlib.pyplot"...
349887011
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import requests from collections import defaultdict import os import datetime from slack import WebClient import argparse # from random import randrange from bisect import bisect_right import hashlib import jpholiday # Example: # python relayscheduler.py # post_to_slack ...
null
relayscheduler.py
relayscheduler.py
py
10,101
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 35, "usage_type": "attribute" }, { "api_name": "hashlib.sha256", "line_number": 83, "usage_type": "call" }, { "api_name": "bisect.bisect_right", "line_number": 88, "usage_type": "call" }, { "api_name": "jpholiday.is_holid...
637322774
import param import panel as pn import pandas as pd import geopandas as gpd import holoviews as hv from vizApps.services.viz.progressExtModule import ProgressExtMod from vizApps.domain.TypeVizEnum import TypeVizEnum from vizApps.Utils.geomUtils import GeomUtil from holoviews import Overlay, NdOverlay, Dimension from...
null
vizApps/services/trace/traceParam.py
traceParam.py
py
4,244
python
en
code
null
code-starcoder2
66
[ { "api_name": "vizApps.domain.TypeVizEnum.TypeVizEnum.CHOROPLETH_MAP", "line_number": 16, "usage_type": "attribute" }, { "api_name": "vizApps.domain.TypeVizEnum.TypeVizEnum", "line_number": 16, "usage_type": "name" }, { "api_name": "vizApps.domain.TypeVizEnum.TypeVizEnum.POINT_MA...
462597061
import random import torch from utils import to_one_hot, to_one_hot_multiple import torch.nn as nn import torch.nn.functional as F class Memory(object): def __init__(self): self.buffer = [] class PolicyNetwork(nn.Module): def __init__(self, input_dim, output_dim): super().__init__() ...
null
agents/RegretMinimizationAgent.py
RegretMinimizationAgent.py
py
3,112
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.Module", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
211875021
""" This contains a range of functions required to correct for the Magnetisation Transfer effect visible in the HCP data. """ import json from pathlib import Path from fsl.wrappers import fslmaths, LOAD, bet, fast from fsl.data.image import Image import numpy as np from .initial_bookkeeping import create_dirs import ...
null
hcpasl/m0_mt_correction.py
m0_mt_correction.py
py
4,159
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.load", "line_number": 23, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 43, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 44, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 68...
193298265
""" TCKDB backend app models freq module """ from sqlalchemy import Column, Float, Integer, String from tckdb.backend.app.db.base_class import Base from tckdb.backend.app.models.common import JSONEncodedDict, MutableDict class Freq(Base): """ A class for representing a TCKDB Freq item (frequency scaling fac...
null
tckdb/backend/app/models/freq.py
freq.py
py
2,961
python
en
code
null
code-starcoder2
66
[ { "api_name": "tckdb.backend.app.db.base_class.Base", "line_number": 11, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 33, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 33, "usage_type": "argument" }, { "api...
8692473
from django.contrib import admin from django.conf.urls import include, url urlpatterns = [ url(r"^admin/", admin.site.urls), url( r"^api/oembed/", include("oembedservice.urls", namespace="oembedservice"), ), url( r"^api/s3imageservice/", include("s3imageservice.urls", na...
null
politicoservicesapi/urls.py
urls.py
py
356
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 5, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 5, "usage_type": "name" }, { "api_name": ...
472124374
import pandas as pd import numpy as np from utils.cat_id import cat_id_list from scipy.stats.mstats import gmean from tqdm import tqdm import torch logits_path = 'logits/' pred_names = ['seres50_8920_53.npy', 'seres50_8912_62.npy', 'seres50_8911_74.npy', 'seres50_8916_86.npy'] infer_path = 'data/test/test_simplified.c...
null
save_predictions.py
save_predictions.py
py
1,442
python
en
code
null
code-starcoder2
66
[ { "api_name": "utils.cat_id.cat_id_list", "line_number": 15, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 25, "usage_type": "call" }, { "api_name": "tqdm.tqdm",...
634999212
# -*- coding: utf-8 -*- """ Created on Mon Aug 31 23:38:02 2020 @author: BT """ # Common imports import tensorflow as tf import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from utils import generate_time_series, generate_data, plot_series, plot_learning_curves from utils import plot_multipl...
null
DL/15_RNNs/2_forecasting_several_timestep.py
2_forecasting_several_timestep.py
py
13,714
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.seed", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 18, "usage_type": "attribute" }, { "api_name": "tensorflow.random.set_seed", "line_number": 19, "usage_type": "call" }, { "api_name": "tensor...
209973004
# -*- coding: utf-8 -*- import vk import config session = vk.Session(config.ACCESS_TOKEN) api = vk.API(session) def getLen(uid): audio = api.audio.get(owner_id=uid) play = [] for lenght in audio: play.append(lenght) return len(play) def main(): audio = api.audio.get(owner_id=config.UID)...
null
playlist.py
playlist.py
py
638
python
en
code
null
code-starcoder2
66
[ { "api_name": "vk.Session", "line_number": 5, "usage_type": "call" }, { "api_name": "config.ACCESS_TOKEN", "line_number": 5, "usage_type": "attribute" }, { "api_name": "vk.API", "line_number": 6, "usage_type": "call" }, { "api_name": "config.UID", "line_number...
495830691
import json import math import numpy as np import os from tqdm import tqdm from sklearn.model_selection import KFold import codecs from tools.conlleval import evaluate_conll_file from keras import backend as K from tools.load_embedding_matrix import load_embedding from bilm import TokenBatcher from inputs.data_process...
null
train_elmo_gru_locaatt.py
train_elmo_gru_locaatt.py
py
12,988
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 16, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 18, "usage_type": "call" }, { "api_name": "json.load", "line_number": 19, "usage_type": "call" }, { "api_name": "json.load", "line_number": 20...
194050611
#!/Users/Jonman/anaconda/bin/python3 import asyncio as snc props = dir( snc) print( "Printing each item in the asyncio library") for i in props: print( i) print( "Printing subitems from everything in the asyncio library") for i in props: print( dir( i)) snc.sleep snc.create_subprocess_exec( pr...
null
the_asyncio.py
the_asyncio.py
py
543
python
en
code
null
code-starcoder2
66
[ { "api_name": "asyncio.sleep", "line_number": 16, "usage_type": "attribute" }, { "api_name": "asyncio.create_subprocess_exec", "line_number": 17, "usage_type": "call" } ]
353252553
"""Scripts to parse Facebook message history. Written by Shoyo Inokuchi (May 2019). """ import collections import datetime import json import utils def most_frequent_words(): """Return most frequently used words in a conversation.""" conv_dir = utils.get_conversation_path() user_json_file = f'{conv_dir...
null
src/most-freq-words.py
most-freq-words.py
py
1,274
python
en
code
null
code-starcoder2
66
[ { "api_name": "utils.get_conversation_path", "line_number": 14, "usage_type": "call" }, { "api_name": "json.load", "line_number": 18, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 21, "usage_type": "call" } ]
521346932
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable=W0613, C0116 # type: ignore[union-attr] # This program is dedicated to the public domain under the CC0 license. """ Simple Bot to reply to Telegram messages. First, a few handler functions are defined. Then, those functions are passed to the Dispatcher a...
null
app.py
app.py
py
10,842
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 30, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 31, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 34, "usage_type": "call" }, { "api_name": "os.environ", ...
342044652
import datetime as dt import math import os import numpy as np import pandas as pd import pytest from refet.daily import Daily import refet.units as units # Test daily functions using actual RefET input/output files # DEADBEEF - This doesn't work if I move it to conftest.py class DailyData(): """Setup daily val...
null
tests/test_daily_refet_output.py
test_daily_refet_output.py
py
6,156
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.join", "line_number":...
184593668
# encoding: utf-8 """ @version:3.6 @author:lamplight @file:02.py @time:2018/1/919:23 """ # url # img_list = [] # url = '../../upload/2017-06/17060705015645.jpg' # filename = url.split('/')[2:4] # # filename = url.split('/')[4].split('.jpg') # # del filename[1] # # del filename[0] # # filename = str(filename).replace(' ...
null
24fa/02.py
02.py
py
3,196
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 26, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 104, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
141704597
#!/usr/bin/env python # ----------------------------------------------------- # Written by Zhu Lingfeng on 2021/3/28. # ----------------------------------------------------- import sys from pycocotools.coco_analyze import COCOAnalyze, my_plot annFile = sys.argv[1] coco = COCOAnalyze(annFile) # get all cats catNms =...
null
PythonAPI/scripts/analyze.py
analyze.py
py
662
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pycocotools.coco_analyze.COCOAnalyze", "line_number": 11, "usage_type": "call" }, { "api_name": "pycocotools.coco_analyze.my_plot", "line_number": 22, "usage_type": "call" }, { ...
619935008
from django.shortcuts import render_to_response from django.template import RequestContext from markitup_field.settings import MARKUP_FILTERS def apply_filter(request): markup = request.POST.get('data', '') markup_format = request.POST.get('markup_format', 'text') rendered = MARKUP_FILTERS[markup_format](...
null
markitup_field/views.py
views.py
py
464
python
en
code
null
code-starcoder2
66
[ { "api_name": "markitup_field.settings.MARKUP_FILTERS", "line_number": 9, "usage_type": "name" }, { "api_name": "django.shortcuts.render_to_response", "line_number": 10, "usage_type": "call" }, { "api_name": "django.template.RequestContext", "line_number": 12, "usage_type...
510490857
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # __author__:"付恒大" import configparser config = configparser.ConfigParser() config.read('example.ini') # sections返回所有的配置部分名称,没有DEFAULT。 se = config.sections() print(se) user = config['bitbucket.org']['User'] print(user) for key in config['topsecret.server.com']: pr...
null
oldboy/day05-常用模块学习/CONFIGPARSER模块/configparser模块读操作.py
configparser模块读操作.py
py
365
python
en
code
null
code-starcoder2
66
[ { "api_name": "configparser.ConfigParser", "line_number": 7, "usage_type": "call" } ]
166064156
from .scene import Scene from ui import Text, Button, TextInput from pyglet.window.mouse import * from os import path from PIL import Image from util.image_vwr import ImageViewer import imghdr class ImageUploadScreen(Scene): def __init__(self, window, bus, manager): super().__init__(window, bus, draw_waves...
null
scenes/c_image_upload.py
c_image_upload.py
py
3,035
python
en
code
null
code-starcoder2
66
[ { "api_name": "scene.Scene", "line_number": 9, "usage_type": "name" }, { "api_name": "ui.Text", "line_number": 13, "usage_type": "call" }, { "api_name": "ui.Text", "line_number": 15, "usage_type": "call" }, { "api_name": "ui.Text", "line_number": 19, "usag...
621691351
#!/usr/bin/env python3.6 # -*- coding: utf-8 -*- """ YouTube player instance. References: https://github.com/Rapptz/discord.py/blob/rewrite/examples/playlist.py Deprecated: Currently in a broken state, unfortunately. === MIT License Copyright (c) 2018 Neko404NotFound Permission is hereby granted, free of ...
null
neko2/cogs/.deprecated/beats.py
beats.py
py
11,065
python
en
code
null
code-starcoder2
66
[ { "api_name": "discord.opus.is_loaded", "line_number": 50, "usage_type": "call" }, { "api_name": "discord.opus", "line_number": 50, "usage_type": "attribute" }, { "api_name": "os.name", "line_number": 51, "usage_type": "attribute" }, { "api_name": "discord.opus.lo...
266427505
from peak.api import * from interfaces import * from model import * from peak.util.signature import ISignature from sets import Set from peak.storage.interfaces import ISQLConnection from peak.util.Graph import Graph __all__ = [ 'titleAsPropertyName', 'titleAsMethodName', 'DocumentProcessor', 'AbstractProcesso...
null
PEAK-0.5a4dev_r2085/build/lib.macosx-10.6-x86_64-2.7/peak/ddt/processors.py
processors.py
py
30,007
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.now", "line_number": 101, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 101, "usage_type": "name" }, { "api_name": "model.Repr", "line_number": 489, "usage_type": "attribute" }, { "api_name": "model.Repr...
622869777
# -*- coding: utf-8 -*- ''' A library that provides a Python interface to the ClickMeeting API''' __author__ = 'Emil Balashov' __version__ = '0.0.4' import requests API_SERVER = 'https://api.clickmeeting.com/v1/conferences/' MEETING = 'meeting' WEBINAR = 'webinar' ACTIVE = 'active' INACTIVE = 'inactive' ACCESS_TYP...
null
clickmeeting/clickmeeting.py
clickmeeting.py
py
7,408
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 41, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 43, "usage_type": "call" }, { "api_name": "requests.put", "line_number": 45, "usage_type": "call" }, { "api_name": "requests.delete", "line_n...
330955946
#!/usr/bin/env python3 """ bit.py - Return current Bitcoin exchange rate. """ import urllib.request, json from bs4 import BeautifulSoup def bitcash(): location = 'https://coinmarketcap.com/currencies/bitcoin-cash/' request = urllib.request.Request(location) request.add_header('User-Agent', 'Mozilla/5.0 (Macintosh;...
null
modules/bitcoin.py
bitcoin.py
py
1,654
python
en
code
null
code-starcoder2
66
[ { "api_name": "urllib.request.request.Request", "line_number": 11, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 11, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 11, "usage_type": "name" }, { "api_nam...
167605911
from flask import Blueprint, jsonify, request from user.user_service import UserService user = Blueprint('user', __name__) @user.route('/', methods=['GET', 'POST']) @user.route('/<int:id>', methods=['GET', 'POST']) def index(id=None): if request.method == 'POST': resp = {'status': 'POST'} service ...
null
user/view.py
view.py
py
613
python
en
code
null
code-starcoder2
66
[ { "api_name": "user.user_service", "line_number": 3, "usage_type": "name" }, { "api_name": "flask.Blueprint", "line_number": 3, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 9, "usage_type": "attribute" }, { "api_name": "flask.reques...
647017060
from pathlib import Path import click from dtoolcore import DataSet from mask_to_centroid_overlay import mask_to_overlay_segment def mass_centroid_annotation(images_ds, masks_fpath): metadata = images_ds.get_overlay('filename_metadata') try: cn_overlay = images_ds.get_overlay('seed_centroids') ...
null
scripts/data_handling/mass_centroid_annotation.py
mass_centroid_annotation.py
py
952
python
en
code
null
code-starcoder2
66
[ { "api_name": "mask_to_centroid_overlay.mask_to_overlay_segment", "line_number": 23, "usage_type": "call" }, { "api_name": "dtoolcore.DataSet.from_uri", "line_number": 33, "usage_type": "call" }, { "api_name": "dtoolcore.DataSet", "line_number": 33, "usage_type": "name" ...
287685338
import click import matplotlib.pyplot as plt import os import shutil from skimage.io import imread # Our modules import ruler_detection import binarization import tracing import measurement @click.command() @click.option('--input', help='Input directory of images') @click.option('--output', help='Output directory of...
null
pipeline.py
pipeline.py
py
1,532
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.exists", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "shutil.rmtree", "line_number": 20, "usage_type": "call" }, { "api_name": "os.mkdir", "line_number...
97119917
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import wagtail.wagtailcore.blocks import wagtail.wagtailcore.fields import wagtail.wagtailimages.blocks class Migration(migrations.Migration): dependencies = [ ('wagtailcore', '0019_verbose_names_cle...
null
app/core/migrations/0006_auto_20151010_2055.py
0006_auto_20151010_2055.py
py
1,355
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.migrations.Migration", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 10, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 18, "usage_type": "call" }, ...
506816222
import mysql.connector import numpy as np import keras from keras.models import load_model from sklearn.externals import joblib con = mysql.connector.connect(user='root', database='dell',host='localhost',password='') con.autocommit = True cur = con.cursor() cur.execute("SELECT merch_id,trans_amt,is_declined,tnodecpe...
null
predict.py
predict.py
py
1,462
python
en
code
null
code-starcoder2
66
[ { "api_name": "mysql.connector.connector.connect", "line_number": 8, "usage_type": "call" }, { "api_name": "mysql.connector.connector", "line_number": 8, "usage_type": "attribute" }, { "api_name": "mysql.connector", "line_number": 8, "usage_type": "name" }, { "api...
13221367
import argparse import boto3 from library.util.SpockMap import SpockMap from library.util.SpockMap import parse_sfo_version if __name__ == "__main__": parser = argparse.ArgumentParser(description="Building SPOCK Map") parser.add_argument("-p", "--path", required=True, help="Opens or Creates a file that would ...
null
SpockBuildMap.py
SpockBuildMap.py
py
972
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "library.util.SpockMap.parse_sfo_version", "line_number": 15, "usage_type": "call" }, { "api_name": "library.util.SpockMap.SpockMap", "line_number": 16, "usage_type": "call" ...
521164539
from unittest import mock from mitmproxy.addons import browser from mitmproxy.test import taddons def test_browser(caplog): caplog.set_level("INFO") with mock.patch("subprocess.Popen") as po, mock.patch( "shutil.which" ) as which, taddons.context(): which.return_value = "chrome" b...
null
test/mitmproxy/addons/test_browser.py
test_browser.py
py
2,094
python
en
code
null
code-starcoder2
66
[ { "api_name": "unittest.mock.patch", "line_number": 9, "usage_type": "call" }, { "api_name": "unittest.mock", "line_number": 9, "usage_type": "name" }, { "api_name": "mitmproxy.test.taddons.context", "line_number": 11, "usage_type": "call" }, { "api_name": "mitmpr...
287418190
from collections import defaultdict, Counter, deque class Solution: def alienOrder(self, words: List[str]) -> str: ''' Topological Sorting / BFS ''' adj_list = defaultdict(set) in_degree = Counter({c : 0 for word in words for c in word}) ...
null
269_AlienDictionary/269_AlienDictionary.py
269_AlienDictionary.py
py
1,636
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.defaultdict", "line_number": 8, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 9, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 22, "usage_type": "call" } ]
317076209
import torch from collections import defaultdict, OrderedDict from torch.serialization import default_restore_location import os def make_positions(tensor, padding_idx, left_pad, onnx_trace=False): """Replace non-padding symbols with their position numbers. Position numbers begin at padding_idx+1. Padding...
null
aweseq/utils/misc.py
misc.py
py
4,970
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch._dim_arange", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.arange", "line_number": 25, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 34, "usage_type": "call" }, { "api_name": "torch.Tensor",...
369402801
# This file contains a selection of public pdfs that are used within # the Plenum notebooks from core.tools import * import numpy as np import scipy class EffectiveAreas(object): r''' This class loads the public effective areas and allows to use it within the analyses ''' def __init__(self, path='....
null
core/analysis_tools/public_pdfs.py
public_pdfs.py
py
5,502
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.arange", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.diff", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.load", "line_number"...
85782657
import requests import datetime from bs4 import BeautifulSoup import json import csv today = str(datetime.datetime.now().date()) # Create a list of dictionaries for JSON Object response = [] songs = list() artist = list() chartNumbers = list() streams = list() # Scrape APNewsBriefs with requests url = 'https://spo...
null
spotify.py
spotify.py
py
1,354
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.now", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 7, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 20, "usage_type": "call" }, { "api_name": "bs4.Beautiful...
480488528
import Crypto.PublicKey.RSA import argparse import re import sys ############################ ## Wiener's Attack module ## ############################ # Calculates bitlength def bitlength(x): assert x >= 0 n = 0 while x > 0: n = n+1 x = x>>1 return n # Squareroots an integer def isqrt(n): if n < 0: raise...
null
rsa/wieners_attack.py
wieners_attack.py
py
3,525
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 116, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 125, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 127, "usage_type": "call" }, { "api_name": "Crypto.PublicKey.RS...
608496979
# -*- coding=utf-8 -*- """ # Copyright (c) 2020 PaddlePaddle Authors. 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...
null
models/treebased/tdm/model.py
model.py
py
21,558
python
en
code
null
code-starcoder2
66
[ { "api_name": "paddlerec.core.model.ModelBase", "line_number": 24, "usage_type": "name" }, { "api_name": "paddlerec.core.model.ModelBase.__init__", "line_number": 26, "usage_type": "call" }, { "api_name": "paddlerec.core.model.ModelBase", "line_number": 26, "usage_type": ...
273481498
# -*- coding: utf-8 -*- import mock import pytest from h.api.search import transform @pytest.mark.parametrize("ann_in,ann_out", [ # Preserves the basics ({}, {}), ({"other": "keys", "left": "alone"}, {"other": "keys", "left": "alone"}), # Target field ({"target": "hello"}, {"target": "hello"}), ...
null
h/api/search/test/transform_test.py
transform_test.py
py
2,839
python
en
code
null
code-starcoder2
66
[ { "api_name": "h.api.search.transform.prepare", "line_number": 21, "usage_type": "call" }, { "api_name": "h.api.search.transform", "line_number": 21, "usage_type": "name" }, { "api_name": "pytest.mark.parametrize", "line_number": 8, "usage_type": "call" }, { "api_...
251802543
# # Copyright (c) 2015 EUROGICIEL # # 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 a...
null
sticks/api/v1/datamodels/ticket.py
ticket.py
py
1,611
python
en
code
null
code-starcoder2
66
[ { "api_name": "sticks.api.v1.datamodels.base.Base", "line_number": 23, "usage_type": "attribute" }, { "api_name": "sticks.api.v1.datamodels.base", "line_number": 23, "usage_type": "name" }, { "api_name": "wsme.types.text", "line_number": 28, "usage_type": "attribute" },...
257300921
""" Welborn Productions - MiddleWare - Requests Handles requests coming in to welbornprod. """ import logging import re from os.path import isfile from django.conf import settings from django.http import HttpResponse log = logging.getLogger('wp.middleware.requests') def get_remote_host(request): """ Returns...
null
middleware/requests.py
requests.py
py
4,952
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "django.conf.settings.SECRET_BAN_FILE", "line_number": 49, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 49, "usage_type": "name" }, { "...
179740752
""" Numpy API for xcape. """ from functools import reduce import numpy as np import dask.array as da from .duck_array_ops import (reshape, ravel_multi_index, concatenate, broadcast_arrays) from .cape_fortran import cape as _cape_fortran from .cape_numba import cape as _cape_numba from .sr...
null
src/xcape/core.py
core.py
py
12,593
python
en
code
null
code-starcoder2
66
[ { "api_name": "functools.reduce", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.atleast_2d", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.reshape", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.reshape", "...
432281580
## ! dependency modul ## import modulderive import mqtt import sqlite3 import time import base64 ##! database connection conn = sqlite3.connect('/root/dev/proyek/satpam.sq3') print ("Opened database successfully"); print ("==========================================") # def fungsi1(): # cursor = conn.execute("sele...
null
allsystem.py
allsystem.py
py
3,244
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlite3.connect", "line_number": 9, "usage_type": "call" }, { "api_name": "modulderive.enkrip", "line_number": 42, "usage_type": "call" }, { "api_name": "modulderive.enkrip", "line_number": 43, "usage_type": "call" }, { "api_name": "base64.b64encode...
291983825
__author__ = 'user' import logging from logging import handlers import zmq import event_processor_api import multiprocessing as mp file_name = '/opt/pokerist/processor/worker_trigger_logs/worker.log' worker_logger = logging.getLogger('worker_logger') worker_handler = handlers.RotatingFileHandler(file_name, maxByte...
null
future_prod/event_trigger_worker.py
event_trigger_worker.py
py
2,167
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.handlers.RotatingFileHandler", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.handlers", "line_number": 14, "usage_type": "name" }, { "api_name"...
195394713
import unittest from datetime import datetime from unittest.mock import MagicMock from iso8601 import iso8601 from jsonschema import ValidationError from parameterized import parameterized from application.data_validator import DataValidator class CompleteValidatorTests(unittest.TestCase): @classmethod def ...
null
tests/complete_validator_tests.py
complete_validator_tests.py
py
2,844
python
en
code
null
code-starcoder2
66
[ { "api_name": "unittest.TestCase", "line_number": 12, "usage_type": "attribute" }, { "api_name": "application.data_validator.DataValidator", "line_number": 15, "usage_type": "call" }, { "api_name": "jsonschema.ValidationError", "line_number": 22, "usage_type": "argument" ...
72343624
from django.db import models from .car_options import Car_options class Cab(models.Model): car = models.ForeignKey(Car_options, on_delete=models.CASCADE) name = models.CharField(max_length=50, default="") number_plate = models.CharField(max_length=50, default="") air_conditioned = models.BooleanField(default=True)...
null
Travel/models/cabs.py
cabs.py
py
578
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.models.Model", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 4, "usage_type": "name" }, { "api_name": "django.db.models.ForeignKey", "line_number": 5, "usage_type": "call" }, { "api_name": ...
227695711
import unittest from fairtest.modules.metrics.regression import * import rpy2.robjects as ro from rpy2.robjects import numpy2ri import numpy as np from . import assertAlmostEqualTuples class TestingMutualInfo(unittest.TestCase): def setUp(self): numpy2ri.activate() ro.r('set.seed({})'.format(0)) ...
null
src/fairtest/tests/modules/metrics/test_regression.py
test_regression.py
py
767
python
en
code
null
code-starcoder2
66
[ { "api_name": "unittest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "rpy2.robjects.numpy2ri.activate", "line_number": 11, "usage_type": "call" }, { "api_name": "rpy2.robjects.numpy2ri", "line_number": 11, "usage_type": "name" }, { "api_...
288065646
# 최소 스패닝 트리 # 시간 : 2시간 # 구현 아이디어 : 프림알고리즘을 이용한 풀이 # 시간복잡도는 O(n^2)으로 크루스칼알고리즘(Elog2E)보다 느리다. import sys from heapq import heapify, heappop, heappush from collections import defaultdict input = sys.stdin.readline v, e = map(int, input().split()) adj = defaultdict(list) for i in range(e): e1, e2, w = map(int, input()...
null
November,2020~July,2021/2021-01-22/1197_이승민_최소스패닝트리.py
1197_이승민_최소스패닝트리.py
py
1,278
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.stdin", "line_number": 9, "usage_type": "attribute" }, { "api_name": "collections.defaultdict", "line_number": 11, "usage_type": "call" }, { "api_name": "heapq.heapify", "line_number": 21, "usage_type": "call" }, { "api_name": "heapq.heappop", ...
610448839
import tweepy import queue from time import time import threading from .Records import Records from .StreamListenerHelpers import StreamListenerHelpers from .StreamListenerFilters import StreamListenerFilters from .Models import Contest from .QueueWorker import QueueWorker from .TextTools import TextTools class Stream...
null
src/mod/StreamListener.py
StreamListener.py
py
9,998
python
en
code
null
code-starcoder2
66
[ { "api_name": "tweepy.StreamListener", "line_number": 12, "usage_type": "attribute" }, { "api_name": "tweepy.StreamListener.__init__", "line_number": 14, "usage_type": "call" }, { "api_name": "tweepy.StreamListener", "line_number": 14, "usage_type": "attribute" }, { ...
100653798
from django.shortcuts import render, redirect from datawisata.models import Datawisata from datawisata.forms import FormDataWisata def datawisata(request): datawisatas = Datawisata.objects.all() konteks = { 'datawisatas' : datawisatas, } return render(request, 'datawisata.html', k...
null
wisatajogja/datawisata/views.py
views.py
py
1,728
python
en
code
null
code-starcoder2
66
[ { "api_name": "datawisata.models.Datawisata.objects.all", "line_number": 9, "usage_type": "call" }, { "api_name": "datawisata.models.Datawisata.objects", "line_number": 9, "usage_type": "attribute" }, { "api_name": "datawisata.models.Datawisata", "line_number": 9, "usage_...
447254498
import argparse import difflib import pathlib import shutil from typing import Callable, List, Optional, Tuple from . import utils class HtmlDiffFileWriter: def __init__(self, target_folder: pathlib.Path, wrapcolumn: int, tabsize: int) -> None: self.target_folder = target_folder self.differ = di...
null
universum/analyzers/diff_utils.py
diff_utils.py
py
5,600
python
en
code
null
code-starcoder2
66
[ { "api_name": "pathlib.Path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "difflib.HtmlDiff", "line_number": 14, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "typing.List", ...
111407131
""" Some util functions for constructing neural networks. """ import theano import theano.tensor as T # from theano.printing import pydotprint import numpy as np import pyrl.layers as layers import pyrl.optimizers as optimizers import pyrl.agents.arch as arch from pyrl.utils import make_minibatch_x_y class Feedforwa...
null
pyrl/algorithms/nn.py
nn.py
py
3,366
python
en
code
null
code-starcoder2
66
[ { "api_name": "theano.tensor.matrix", "line_number": 19, "usage_type": "attribute" }, { "api_name": "theano.tensor", "line_number": 19, "usage_type": "name" }, { "api_name": "pyrl.agents.arch.model_params", "line_number": 48, "usage_type": "call" }, { "api_name": ...
118192744
#!/usr/bin/env python from os import path from setuptools import setup, find_packages def read(name): return open(path.join(path.dirname(__file__), name)).read() def runtests(): from django.conf import settings from django.core.management import call_command if not settings.configured: setti...
null
setup.py
setup.py
py
1,166
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.settings.configured", ...
309885932
import ssl import re import os import time import progressbar from urllib.request import urlopen from bs4 import BeautifulSoup, SoupStrainer from multiprocessing import Pool from pprint import pprint # 忽略 SSL 验证 ssl._create_default_https_context = ssl._create_unverified_context hrefList = [] # 获取章节列表中所有的页 def get_c...
null
src/index.py
index.py
py
2,950
python
en
code
null
code-starcoder2
66
[ { "api_name": "ssl._create_default_https_context", "line_number": 12, "usage_type": "attribute" }, { "api_name": "ssl._create_unverified_context", "line_number": 12, "usage_type": "attribute" }, { "api_name": "urllib.request.urlopen", "line_number": 21, "usage_type": "cal...
117064022
from __future__ import unicode_literals import collections import io import json import logging import os import pre_commit.constants as C from pre_commit import five from pre_commit.clientlib import load_manifest from pre_commit.clientlib import LOCAL from pre_commit.clientlib import MANIFEST_HOOK_DICT from pre_comm...
null
pre_commit/repository.py
repository.py
py
7,025
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 22, "usage_type": "call" }, { "api_name": "pre_commit.constants.INSTALLED_STATE_VERSION", "line_number": 30, "usage_type": "attribute" }, { "api_name": "pre_commit.constants", "line_number": 30, "usage_type": "name" }, ...
79819306
# Basic library import pandas as pd import numpy as np import matplotlib.pyplot as plt ### ------------------------ ### # Preprocessing library from sklearn.preprocessing import LabelEncoder, OneHotEncoder ### ------------------------ ### # This function will work for 1-base index (Though Python, Java, C/C++ are ...
null
Regression/06. mrz_Random_Forest_Regression.py
06. mrz_Random_Forest_Regression.py
py
2,293
python
en
code
null
code-starcoder2
66
[ { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 27, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.OneHotEncoder", "line_number": 34, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 55, "usage_type": "call" }, {...
37174504
from django.contrib import admin from django.contrib import messages from django import forms from django.utils import timezone from data_ocean.admin import input_filter from .models import Subscription, Invoice, ProjectSubscription, Project, CustomSubscriptionRequest, Invitation from rangefilter.filter import DateRan...
null
payment_system/admin.py
admin.py
py
10,194
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 11, "usage_type": "name" }, { "api_name": "django.contrib.messages.ERROR", "line_number": 32, "usage_type": "attribute" ...
291403332
# -*- coding: utf-8 -*- # # -------------------------------------------------------- # @Author: Lintao # @Date: 5/13/21 6:27 PM # @Version 1.0 # -------------------------------------------------------- """ An example that uses TensorRT's Python api to make inferences. """ import ctypes import os os.environ.setdefault(...
null
tensorrtx/yolov5_trt_logo.py
yolov5_trt_logo.py
py
15,273
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ.setdefault", "line_number": 13, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.walk", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path.join", "lin...
270436490
## The main function of PyRAIMD ## the first version Jingbai Li Feb 16 2020 ## the second version Jingbai Li May 14 2020 ## the class version Jingbai Li Jul 15 2020 import sys,os,time,datetime import numpy as np from tools import whatistime,howlong from tools import Readcoord,Printcoord,Checkpoint,Readinitcond from ...
null
PyRAIMD.py
PyRAIMD.py
py
6,372
python
en
code
null
code-starcoder2
66
[ { "api_name": "entrance.ReadInput", "line_number": 63, "usage_type": "call" }, { "api_name": "entrance.StartInfo", "line_number": 64, "usage_type": "call" }, { "api_name": "methods.QM", "line_number": 85, "usage_type": "call" }, { "api_name": "tools.Readcoord", ...
254876722
import os import time import multiprocessing class LocalComm: def __init__(self, local_queues, addr): self.local_queues = local_queues self.addr = addr assert(0 <= addr < len(self.local_queues)) self.i = 0 def send(self, to_addr, data): self.local_queues[to_addr].put(by...
null
taskloaf/local.py
local.py
py
1,399
python
en
code
null
code-starcoder2
66
[ { "api_name": "multiprocessing.Queue", "line_number": 24, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 27, "usage_type": "call" } ]
249441924
#imports import traceback from threading import Thread from queue import Queue from hashlib import sha512 from .data_file import DataFile from ..utilities.runnable import Runnable from ..utilities.misc import populated_kwargs from ..my_kafka.my_producers import MySerializingProducer from .config import RUN_OPT_CONST fr...
null
openmsipython/data_file_io/upload_data_file.py
upload_data_file.py
py
12,623
python
en
code
null
code-starcoder2
66
[ { "api_name": "data_file.DataFile", "line_number": 14, "usage_type": "name" }, { "api_name": "utilities.runnable.Runnable", "line_number": 14, "usage_type": "name" }, { "api_name": "queue.full", "line_number": 107, "usage_type": "call" }, { "api_name": "utilities....
284000374
from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Writer', fields=[ ('id', models.AutoField( auto_created=True, ...
null
writers/migrations/0001_initial.py
0001_initial.py
py
772
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.migrations.Migration", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 4, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 12, "usage_type": "call" }, ...
547462589
#!/usr/bin/env python3 from argparse import ArgumentParser from numpy import zeros, linspace, argmin, loadtxt, argsort, asarray, savetxt, diag, argwhere, mean from numpy.linalg import norm from scipy.sparse import csr_matrix, eye, load_npz, save_npz from scipy.optimize import minimize # from lmfit import minimize, Para...
null
current/tdsatdegen.py
tdsatdegen.py
py
7,121
python
en
code
null
code-starcoder2
66
[ { "api_name": "libs.states.state_at_ts", "line_number": 26, "usage_type": "call" }, { "api_name": "libs.states.prob_of_state", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 27, "usage_type": "call" }, { "api_name": "argpa...
582965942
from django.core.files.base import ContentFile from django.db import models from keima import settings from records.models import Record from users.models import User from servers.ogs import OGSClient, OGSException from importer.managers import OGSUserManager class OGSUser(models.Model): ''' Track user's acco...
null
importer/models.py
models.py
py
1,897
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.models.Model", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 10, "usage_type": "name" }, { "api_name": "django.db.models.OneToOneField", "line_number": 15, "usage_type": "call" }, { "api_n...
653784685
"""Unit and regression tests for the tool utilities.""" import argparse import os import StringIO import sys import tempfile from pyAirviro import __version__ from pyAirviro.other import logging import pyAirviro.tests from pyAirviro.tools import utils class CaptureStderrTestCase(pyAirviro.tests.TestCase): """B...
null
pyAirviro/tests/tools/test_utils.py
test_utils.py
py
5,427
python
en
code
null
code-starcoder2
66
[ { "api_name": "pyAirviro.tests", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sys.stderr", "line_number": 20, "usage_type": "attribute" }, { "api_name": "sys.stderr", "line_number": 21, "usage_type": "attribute" }, { "api_name": "StringIO.StringI...
218548406
# uses conda environment gpflow6_0 # #!/anaconda3/envs/gpflow6_0/env/bin/python from memory_profiler import profile # generic import numpy as np import pandas as pd import xarray as xr # import dask.array as da import scipy.io as io from itertools import product import glob import time # plotting from matplotlib.co...
null
readv_it_av.py
readv_it_av.py
py
22,250
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.colors.Normalize", "line_number": 39, "usage_type": "name" }, { "api_name": "matplotlib.colors.Normalize.__init__", "line_number": 43, "usage_type": "call" }, { "api_name": "matplotlib.colors.Normalize", "line_number": 43, "usage_type": "name" ...
505384442
''' This script can be used to parse out the timeseries data from the raw files obtained from Intel ''' import sys import csv import pickle from datetime import datetime, timedelta from timeseries import TimePoint, TimeSeries def parse_header(header): #user,measure,timestamp-start,timestamp-end,value time_...
null
scripts/parse_data.py
parse_data.py
py
2,586
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.strptime", "line_number": 27, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 27, "usage_type": "name" }, { "api_name": "timeseries.TimeSeries", "line_number": 51, "usage_type": "call" }, { "api_name": "ti...
591470274
""" Functions for visualizing/plotting reaction networks. """ import matplotlib.cm import numpy as np import rustworkx as rx from rustworkx.visualization import mpl_draw def plot_network(graph: rx.PyGraph, vertex_cmap_name: str = "jet", **kwargs): """ Plots a reaction network using rustworkx visualization too...
null
src/rxn_network/network/visualize.py
visualize.py
py
1,349
python
en
code
null
code-starcoder2
66
[ { "api_name": "rustworkx.PyGraph", "line_number": 10, "usage_type": "attribute" }, { "api_name": "rustworkx.visualization.mpl_draw", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 42, "usage_type": "call" }, { "api_name": "...
492728386
"""Assignment 11: Latent Dirichlet Allocation #2. ECE 590: Natural Language Processing Patrick Wang """ import matplotlib.pyplot as plt import numpy as np from hw11_solution import lda, lda_solve def test_lda_solve(): vocabulary = ['bass', 'pike', 'deep', 'tuba', 'horn', 'catapult'] V = len(vocabulary) ...
null
hw11_evaluate.py
hw11_evaluate.py
py
1,109
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.array", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random.dirichlet", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 24, "usage_type": "attribute" }, { "api_name": "numpy.array", ...
507980134
import re import numpy as np import math from statistics import mean from tme2.IRModelClass import Okapi spaceRegex=re.compile("\s*(\d+)\s+(\d+)") indexRegex = re.compile("\.I (\d)+") TRegex=re.compile("\.T\n") BRegex=re.compile("\.B\n") ARegex=re.compile("\.A\n") KRegex=re.compile("\.K\n") WRegex=re.compile("\.W\n") ...
null
tme3/tme3.py
tme3.py
py
10,649
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.compile", "line_number": 7, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 8, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 9, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 10, ...
393262558
# coding: utf-8 from flask import request, flash, render_template, redirect, url_for, session as fl_sess import os.path import uuid from web import app from db import session, Folder from scanner import Scanner from managers.user import UserManager from managers.folder import FolderManager @app.before_request def ch...
null
supysonic/folder.py
folder.py
py
2,309
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.request.path.startswith", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.request.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 15, "usage_type": "name" }, { "api_name": "m...
41625048
# -*- coding: utf-8 -*- """ Created on Thu Oct 15 16:05:47 2020 @author: mathewjowens A script to reproduce the anaylsis of Owens et al., Solar Physics 2021, "Extreme space-weather events and the solar cycle" """ import numpy as np import pandas as pd from datetime import datetime import os as os from scipy.stats im...
null
code/ExtremeEventsSolarCycle.py
ExtremeEventsSolarCycle.py
py
68,376
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.rcParams.update", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 23, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 23, "usage_type": "name" }, { ...
561260901
from django.urls import path from . import views from .views import page_render urlpatterns = [ # A cool example, but not for use here. # path('<page_slug>/', include([ # path('about/', views.about), # path('history/', views.history), # path('courses/', views.courses), # path(...
null
osu_www/pages/urls.py
urls.py
py
1,675
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 18, "usage_type": "call" }, { "api_name": "views.request_permissions", "line_number": 18, "usage_type": "attribute" }, { "api_name": "django.urls.path", "line_number": 19, "usage_type": "call" }, { "api_name": "view...
411855767
# This Python module is part of the PyRate software package. # # Copyright 2017 Geoscience Australia # # 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/...
null
pyrate/roipac.py
roipac.py
py
7,296
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.stat", "line_number": 91, "usage_type": "call" }, { "api_name": "pyrate.ifgconstants.PYRATE_X_STEP", "line_number": 106, "usage_type": "attribute" }, { "api_name": "pyrate.ifgconstants", "line_number": 106, "usage_type": "name" }, { "api_name": "...
450690196
import os, sys from time import sleep from selenium import webdriver import redis import time import configparser config = configparser.ConfigParser() config.read(r'C:\Projects\@Scripts\CONFIG\urls_r.cfg') URL_WEBSITE = config['Settings']['URL_WEBSITE'] URL_REST = config['Settings']['URL_REST'] file_ = 'r.xlsx' r1 ...
null
html_to_databases/reuters_feed.py
reuters_feed.py
py
3,081
python
en
code
null
code-starcoder2
66
[ { "api_name": "configparser.ConfigParser", "line_number": 9, "usage_type": "call" }, { "api_name": "redis.StrictRedis", "line_number": 16, "usage_type": "call" }, { "api_name": "codecs.open", "line_number": 18, "usage_type": "call" }, { "api_name": "bs4.BeautifulS...
298726078
""" sensor_test.py Test of all the sensors. """ import os import unittest from math import sqrt from numpy import pi, sqrt from config import Config from environment.game import Game from environment.spawn_functions.simple import SpawnSimple from utils.dictionary import D_SENSOR_LIST from utils.vec2d import Vec2d #...
null
tests/sensors_test.py
sensors_test.py
py
9,212
python
en
code
null
code-starcoder2
66
[ { "api_name": "unittest.TestCase", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 30, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 30, "usage_type": "call" }, { "api_name": "utils.vec2d.Vec2d", "li...
128109854
#!/usr/bin/env python from baselines import bench from baselines.common import set_global_seeds import gym, logging from baselines import logger import tensorflow as tf from collections import Counter from sklearn.model_selection import ParameterGrid, GridSearchCV from gym_mujoco_planar_snake.benchmark.info_collector...
null
planar_snake_prototype_RL/agents/run_mujoco_coded_control_withpixel.py
run_mujoco_coded_control_withpixel.py
py
12,545
python
en
code
null
code-starcoder2
66
[ { "api_name": "baselines.common.set_global_seeds", "line_number": 49, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 76, "usage_type": "attribute" }, { "api_name": "math.pi", "line_number": 78, "usage_type": "attribute" }, { "api_name": "math.pi",...
292380588
import json from django.http.response import JsonResponse from django.views import View from django.db.models import Q from users.decorators import login_decorator from books.models import ( BookAuthor, BookCategory, Category, Comment, CommentLike, Book ) # 상세페이지 class BookD...
null
books/views.py
views.py
py
10,529
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.views.View", "line_number": 19, "usage_type": "name" }, { "api_name": "books.models.Book.objects.filter", "line_number": 22, "usage_type": "call" }, { "api_name": "books.models.Book.objects", "line_number": 22, "usage_type": "attribute" }, { ...