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
158166100
import webapp2 import os import urllib import sys sys.path.append('../') from models.Event import Event from models.User import AppUser from EventHandler import getString from EventHandler import getDate from EventHandler import getDateTime from EventHandler import getInt from google.appengine.ext import db from googl...
null
handlers/PostEventHandler.py
PostEventHandler.py
py
1,788
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "webapp2.RequestHandler", "line_number": 18, "usage_type": "attribute" }, { "api_name": "models.User.A...
373373511
__author__ = 'janak' from django.views.generic import CreateView from converse.forms import TweetForm from utils.global_actions import GlobalConstants from loginmgmt.user_helper import UserHelperMixin from utils.log_helper import init_logger from django.http import HttpResponse from django.core import serializers log...
null
converse/views/create_tweet.py
create_tweet.py
py
1,284
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.log_helper.init_logger", "line_number": 11, "usage_type": "call" }, { "api_name": "django.views.generic.CreateView", "line_number": 15, "usage_type": "name" }, { "api_name": "loginmgmt.user_helper.UserHelperMixin", "line_number": 15, "usage_type": "na...
298639260
# x is the input layer # y_hat is the output layer # W is the weights # b is the import numpy as np import matplotlib.pyplot as plt import matplotlib def sigmoid(x): return 1.0/(1+ np.exp(-x)) def sigmoid_derivative(x): return x * (1.0 - x) class NeuralNetwork: def __init__(self, x, y): se...
null
neural.py
neural.py
py
2,959
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.exp", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.random.rand", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 22, "usage_type": "attribute" }, { "api_name": "numpy.random.rand", ...
537396534
import plotly.express as px import numpy as np import csv def plotFigure(data_path): with open(data_path) as f: df = csv.DictReader(f) fig = px.scatter(df, x="Days Present", y="Marks In Percentage") fig.show() def getDataSource(data_path): days_present = [] marks_in_per...
null
marksVSdays.py
marksVSdays.py
py
992
python
en
code
null
code-starcoder2
76
[ { "api_name": "csv.DictReader", "line_number": 7, "usage_type": "call" }, { "api_name": "plotly.express.scatter", "line_number": 8, "usage_type": "call" }, { "api_name": "plotly.express", "line_number": 8, "usage_type": "name" }, { "api_name": "csv.DictReader", ...
297075367
# AWS SDK for Python import boto3 # MongoDB access string mongo = ('mongodb+srv://' 'UserName:' 'X9xX9xX9xX9xX9xX9xX9' '@cluster0-r4vye.mongodb.net/test' '?retryWrites=true&w=majority' ) # AWS S3 storage instance with credentials s3 = boto3.client('s3', region_name='us...
null
local/Lambda/harvest-lambda/creds.py
creds.py
py
862
python
en
code
null
code-starcoder2
76
[ { "api_name": "boto3.client", "line_number": 14, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 21, "usage_type": "call" } ]
61114444
# -*- coding: utf-8 -*- #!/usr/bin/python from django.core.management.base import NoArgsCommand from django.db import connection from vietnam.models import Listing from lxml.html import fromstring from vietnam.core.utils import replace_non_letter, strip_accents def dictfetchall(cursor): "Returns all rows from a c...
null
vietnam/management/commands/add_listing.py
add_listing.py
py
4,470
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.core.management.base.NoArgsCommand", "line_number": 52, "usage_type": "name" }, { "api_name": "django.db.connection.cursor", "line_number": 55, "usage_type": "call" }, { "api_name": "django.db.connection", "line_number": 55, "usage_type": "name" },...
378374116
import discord, asyncio, os, random, time, json, requests from apscheduler.schedulers.asyncio import AsyncIOScheduler from datetime import datetime from discord.ext import commands, tasks from bs4 import BeautifulSoup token = os.environ.get('AuthToken') client = commands.Bot(command_prefix = '.') ## Useful...
null
mainbot.py
mainbot.py
py
5,151
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ.get", "line_number": 7, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "discord.ext.commands.Bot", "line_number": 9, "usage_type": "call" }, { "api_name": "discord.ext.comm...
290561932
from flask import Flask import os import socket import logging import check_sents app = Flask(__name__) @app.route("/") def hello(): html = "<h3>Hello {name}!</h3>" \ "<b>Hostname:</b> {hostname}<br/>" return html.format(name=os.getenv("NAME", "world"), hostname=socket.ge...
null
server.py
server.py
py
746
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 17, "usage_type": "call" }, { "api_name": "socket.gethostname", "line_number": 18, "usage_type": "call" }, { "api_name": "check_sents.fix_sentence", ...
389318014
from django.shortcuts import render from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from rest_framework.renderers import JSONRenderer from rest_framework.parsers import JSONParser from app.models import Order, Cargo, Customer from app.serializers import OrderSerializer, Custome...
null
delivery/app/views.py
views.py
py
2,686
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.http.HttpResponse", "line_number": 12, "usage_type": "name" }, { "api_name": "rest_framework.renderers.JSONRenderer", "line_number": 17, "usage_type": "call" }, { "api_name": "app.models.Order.objects.all", "line_number": 25, "usage_type": "call" }...
557628654
#!/usr/bin/env python # -*- coding: utf-8 -*- import pytest from blueslip.enums import SLIP, ESCAPED from blueslip.decoding import REPLACE, INVALID, unescape from . import TRIPLE_INT8UN def test_matching_escaped_passes(encoded_packet: bytes): """ Test encoded packet to find all escaped values. :param ...
null
tests/unit/test_decoding.py
test_decoding.py
py
2,768
python
en
code
null
code-starcoder2
76
[ { "api_name": "blueslip.decoding.REPLACE.findall", "line_number": 19, "usage_type": "call" }, { "api_name": "blueslip.decoding.REPLACE", "line_number": 19, "usage_type": "name" }, { "api_name": "blueslip.decoding.INVALID.search", "line_number": 33, "usage_type": "call" ...
135790978
from django.contrib import admin # Register your models here. from cars.models import Car # 显示内容 class CarAdmin(admin.ModelAdmin): list_display = ('car_number', 'break_cause', 'break_time', 'punish_way', 'acceptance') # 显示的内容 ordering = ('break_time',) # 是一个元组 ('no',)升序 / ('-no',) 降序 search_fields = ...
null
LHP/carsys/cars/admin.py
admin.py
py
424
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 9, "usage_type": "name" }, { "api_name": "django.contrib.admin.site.register", "line_number": 17, "usage_type": "call" },...
307534244
from django.urls import path from .views import * urlpatterns = [ # path('admin/', admin, name='admin'), path('', index, name='home'), path('home/', Home, name='home'), path('success/', success, name='Success'), path('failure/', failure, name='Failure'), ] # url(r'^admin/', include(admin.site....
null
PaymentGateway/urls.py
urls.py
py
408
python
en
code
null
code-starcoder2
76
[ { "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", ...
327571777
from .common import addProperty from nnasm import resource_array, abc_atom, kernel_call import math import pyopencl.clrandom import pyopencl as cl import numpy as np @addProperty('manager','shape','size','weights','weights_accum','update_schedule','decay_schedule','build_complete', 'init_mean', 'init_sigma', 'resour...
null
Axono/TrainedWeights.py
TrainedWeights.py
py
6,910
python
en
code
null
code-starcoder2
76
[ { "api_name": "math.sqrt", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 36, "usage_type": "attribute" }, { "api_name": "nnasm.resource_array", "line_number": 38, "usage_type": "call" }, { "api_name": "nnasm.resource_arra...
405237904
from django.conf.urls import patterns, url urlpatterns = patterns('', # This url will show the home page url(r'^home/$', 'yaasapp.views.home'), # This url will redirect to the home page and will sort the table data according to the sort type passed url(r'...
null
YAAS/yaasapp/urls.py
urls.py
py
2,813
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.patterns", "line_number": 3, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "djan...
437010784
import webapp2 import os import jinja2 import hmac template_dir = os.path.join(os.path.dirname(__file__),'templates') jinja_env=jinja2.Environment(loader=jinja2.FileSystemLoader(template_dir),autoescape = True) def hash_str(s): return hmac.new('secret',s).hexdigest() def make_secure_val(s): return "%s|%s"%(s,hash...
null
ajax1/cookie.py
cookie.py
py
1,282
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "jinja2.Environment", "line...
600097575
import numpy as np from scipy.spatial.transform import Rotation as R from config.draco3_config import WalkingConfig, WalkingState from pnc.state_machine import StateMachine from pnc.planner.locomotion.dcm_planner.footstep import Footstep from pnc.draco3_pnc.draco3_state_provider import Draco3StateProvider class Cont...
null
pnc/draco3_pnc/draco3_state_machine/contact_transition_end.py
contact_transition_end.py
py
3,564
python
en
code
null
code-starcoder2
76
[ { "api_name": "pnc.state_machine.StateMachine", "line_number": 10, "usage_type": "name" }, { "api_name": "pnc.draco3_pnc.draco3_state_provider.Draco3StateProvider", "line_number": 17, "usage_type": "call" }, { "api_name": "pnc.planner.locomotion.dcm_planner.footstep.Footstep.RIGH...
286718964
# Given list of integers that contain numbers in random order, # write a program to find the longest possible sub sequence of consecutive numbers in the array. # Return this subsequence in sorted order. The solution must take O(n) time # For e.g. given the list 5, 4, 7, 10, 1, 3, 55, 2, the output should be 1, 2, 3, 4...
null
excercise/longest_consecutive_subsequnces.py
longest_consecutive_subsequnces.py
py
6,230
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.deque", "line_number": 54, "usage_type": "call" } ]
95660079
#!/usr/bin/env python """ Evaluate linker performance. """ import json from data import MATCHES, Reader METRICS = [ 'tp', 'fp', 'fn', 'precision', 'recall', 'fscore', ] def tab_format(data, num_fmt='{:.3f}', delimiter='\t'): lines = [delimiter.join([i[:6] for i in METRICS] + ['match'])] ...
null
conll03_nel_eval/evaluate.py
evaluate.py
py
3,967
python
en
code
null
code-starcoder2
76
[ { "api_name": "data.MATCHES", "line_number": 19, "usage_type": "name" }, { "api_name": "data.get", "line_number": 22, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 32, "usage_type": "call" }, { "api_name": "data.Reader", "line_number": 54,...
480380282
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Mar 14 14:23:30 2019 @author: mitja """ import numpy as np import healpy as hp import matplotlib.pyplot as plt from astropy.time import Time #import sys import credentials as cr import psycopg2 from pylab import * class AlertPipe: def __init_...
null
pipeline.py
pipeline.py
py
29,916
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 65, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number": 81, "usage_type": "call" }, { "api_name": "numpy.radians", "line_number": 81, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 81...
557797800
#!/usr/bin/env python3 import argparse import random import rsa_common as rc def test(): #p,q = rc.getCoPrimes(minimum=4000) p,q = rc.getCoPrimes(minimum=0, maximum=10) print('p=%s q=%s' % (p,q)) N = p*q print('N=%s' % N) phi = (p-1)*(q-1) print('phi=%s' % phi) # e is coprime with ...
null
extras/C960/rsa.py
rsa.py
py
4,054
python
en
code
null
code-starcoder2
76
[ { "api_name": "rsa_common.getCoPrimes", "line_number": 10, "usage_type": "call" }, { "api_name": "rsa_common.findCoPrimes", "line_number": 20, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 21, "usage_type": "call" }, { "api_name": "rsa_comm...
636016685
# Copyright (c) 2016 App Annie Inc. All rights reserved. import json from nose.plugins.attrib import attr from tests.schema_check.constants import constants from tests.schema_check.apis.apiv12.api_v12_objects import \ GetUserNewsFeedDetailAPI from tests.schema_check.base import BaseAPITestCase from tests.schema_...
null
tests/schema_check/cases/apiv12/test_user_news_feed_detail_api.py
test_user_news_feed_detail_api.py
py
1,417
python
en
code
null
code-starcoder2
76
[ { "api_name": "tests.schema_check.base.BaseAPITestCase", "line_number": 15, "usage_type": "name" }, { "api_name": "tests.schema_check.mixins.smoke_user_mixin.SmokeUserMixin", "line_number": 15, "usage_type": "name" }, { "api_name": "tests.schema_check.constants.constants.SCHEMAS"...
609416648
""" Script Name : scs_ingestion_main.py Description : Code to transfer SCS data to S3 Author : Yogesh Sharma Version : 2.0 Last Modified Date : 18/09/18 Config File : scs_ingestion_main.yaml """ import logging import datetime as dt from airflow import DAG from airflow.contri...
null
SCSCPO/scs_ingestion_main.py
scs_ingestion_main.py
py
8,452
python
en
code
null
code-starcoder2
76
[ { "api_name": "kyber.utils.adsales_job_config.JobConfig.get_config", "line_number": 21, "usage_type": "call" }, { "api_name": "kyber.utils.adsales_job_config.JobConfig", "line_number": 21, "usage_type": "name" }, { "api_name": "logging.info", "line_number": 22, "usage_typ...
136300511
from subprocess import check_output from collections import OrderedDict from joblib import Parallel, delayed from triform.config.genomes import create_genome_size_dict def bed_to_chromosome_dfs(bed_file, args): chromosomes = create_genome_size_dict(args.genome) text_dfs = Parallel(n_jobs=args.number_cores...
null
triform/preprocess/bed_to_chromosome_dfs.py
bed_to_chromosome_dfs.py
py
810
python
en
code
null
code-starcoder2
76
[ { "api_name": "triform.config.genomes.create_genome_size_dict", "line_number": 11, "usage_type": "call" }, { "api_name": "joblib.Parallel", "line_number": 13, "usage_type": "call" }, { "api_name": "joblib.delayed", "line_number": 14, "usage_type": "call" }, { "api...
124078284
import unittest import os import sys import re from selenium import webdriver from selenium.common.exceptions import TimeoutException from selenium.webdriver import Chrome from selenium.webdriver.common.by import By from selenium.webdriver.chrome.options import Options from selenium.webdriver.support import expected_c...
null
spec/feature/chrome_spec.py
chrome_spec.py
py
2,389
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ.get", "line_number": 15, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 15, "usage_type": "attribute" }, { "api_name": "unittest.TestCase", "line_number": 17, "usage_type": "attribute" }, { "api_name": "selenium.webdri...
303013568
import subprocess, os import pdb import pysam import pickle import numpy as np from Bio import SeqIO from diploidModel import diploidModel def SNPCall(bamFile,refFile,workDir,flag='naive'): if flag=='bcf': variantFile=bcfCallSNP(bamFile,refFile,workDir) stats=SNPStats(variantFile) fileName=...
null
SNPCall.py
SNPCall.py
py
3,285
python
en
code
null
code-starcoder2
76
[ { "api_name": "pickle.dump", "line_number": 15, "usage_type": "call" }, { "api_name": "pysam.AlignmentFile", "line_number": 27, "usage_type": "call" }, { "api_name": "Bio.SeqIO.to_dict", "line_number": 30, "usage_type": "call" }, { "api_name": "Bio.SeqIO", "li...
478703343
# -*- coding: utf-8 -*- # created by inhzus import logging import os import sys from logging.handlers import TimedRotatingFileHandler class PackagePathFilter(logging.Filter): def filter(self, record): pathname = record.pathname record.relative_path = None abs_sys_paths = map(os.path.abspa...
null
berater/utils/log.py
log.py
py
1,308
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.Filter", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sys.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.sep", "line_num...
40916490
""" Author: Do Tieu Thien Date: 25/1/2018 """ """----------------------------------------------------------------------------- IMPORT -----------------------------------------------------------------------------""" import os import cv2 import numpy as np from PIL import Image """-------------------------------------...
null
func/get_images_and_ids.py
get_images_and_ids.py
py
2,108
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.CascadeClassifier", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.listdir", "lin...
34735334
from django.urls import path from . import views app_name = 'books' urlpatterns = [ path('', views.IndexView.as_view(), name='index'), path('book/<int:pk>/', views.DetailView.as_view(), name='detail'), path('book/new/', views.new_book, name='new_book'), path('book/<int:book_id>/delete', views.delete_bo...
null
books/urls.py
urls.py
py
680
python
en
code
null
code-starcoder2
76
[ { "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", ...
633655395
from collections import Counter def sales_by_match(n, arr): """There is a large pile of socks that must be paired by color. Given an array of integers representing the color of each sock, determine how many pairs of socks with matching colors there are.""" socks = dict(Counter(arr)) pairs = 0 ...
null
interview_preparation_kit/warm_up.py
warm_up.py
py
1,668
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.Counter", "line_number": 8, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 27, "usage_type": "call" } ]
227381734
"""CLI and helper functions""" import re import readline import click def check_integer_input(value, min_value, max_value): """Converts and checks if the integer from the click prompt is in the given range""" try: value = int(value) except ValueError: raise click.BadParameter(f"{value} i...
null
musicreviews/helpers.py
helpers.py
py
1,607
python
en
code
null
code-starcoder2
76
[ { "api_name": "click.BadParameter", "line_number": 14, "usage_type": "call" }, { "api_name": "click.BadParameter", "line_number": 17, "usage_type": "call" }, { "api_name": "re.split", "line_number": 22, "usage_type": "call" }, { "api_name": "readline.parse_and_bin...
82115538
""" Visualize the results calculated by a given model on an image. """ import matplotlib.pyplot as plt import numpy as np import torch import torch.nn as nn import torch.utils.data as data from dataset import ImageAndKeypointDataset from model import KeypointPredictionModel DATA_PATH = './data/generated/' MODEL_FILE ...
null
Training_model/visualize.py
visualize.py
py
1,814
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.utils.data.DataLoader", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.utils.data", "line_number": 19, "usage_type": "name" }, { "api_name": "model.eval", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.no_grad...
574893286
from scipy import signal import matplotlib.pyplot as plt import numpy as np def apply_hearing_loss_sim(x, fs, channels=[0, 1]): b, a = signal.butter(4, 1170.0/(fs/2.), 'low') if len(x.shape) < 2: x = x[:, np.newaxis] for channel in channels: x[:, channel] = signal.filtfilt(b, a, x[:, channe...
null
hearing_loss_sim.py
hearing_loss_sim.py
py
370
python
en
code
null
code-starcoder2
76
[ { "api_name": "scipy.signal.butter", "line_number": 6, "usage_type": "call" }, { "api_name": "scipy.signal", "line_number": 6, "usage_type": "name" }, { "api_name": "numpy.newaxis", "line_number": 8, "usage_type": "attribute" }, { "api_name": "scipy.signal.filtfil...
623451072
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 noet: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the niceman package for the # copyright and license terms. # # ## ### ##...
null
niceman/distributions/piputils.py
piputils.py
py
6,558
python
en
code
null
code-starcoder2
76
[ { "api_name": "niceman.utils.execute_command_batch", "line_number": 47, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 48, "usage_type": "call" }, { "api_name": "re.MULTILINE", "line_number": 48, "usage_type": "attribute" }, { "api_name": "iter...
647317898
""" Note-related APIs. """ import os from flask import request, jsonify, g from sqlalchemy.exc import ProgrammingError from app import db from app.models import * from app.schemas import * from app.util.core import * from app.util.data import * from app.util.perm import auth_required @register_view("/notes") class No...
null
app/views/note.py
note.py
py
2,671
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.jsonify", "line_number": 20, "usage_type": "call" }, { "api_name": "flask.g.user", "line_number": 28, "usage_type": "attribute" }, { "api_name": "flask.g", "line_number": 28, "usage_type": "name" }, { "api_name": "sqlalchemy.exc.ProgrammingErr...
501245658
from os import path import glob import pandas import numpy from sqlalchemy import create_engine from sqlalchemy.sql import select, text from sqlalchemy.schema import CreateSchema, DropSchema ENGINE = create_engine('postgresql://postgres@localhost:5433/pdcms') AUDIT_DIR = path.dirname(path.realpath(__file__)) def load...
null
audit/setup.py
setup.py
py
3,572
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlalchemy.create_engine", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "name" }, { "api_name": "os.path.realpath", ...
9920638
from setuptools import setup, find_packages packages = find_packages() setup( name="carta-work-tests", version="0.1", packages=packages, package_data={k: ["*.csv", "*.yml", "*.html"] for k in packages}, scripts=[], entry_points={}, )
null
setup.py
setup.py
py
259
python
en
code
null
code-starcoder2
76
[ { "api_name": "setuptools.find_packages", "line_number": 3, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 4, "usage_type": "call" } ]
627722688
# -*- coding: utf-8 -*- """ Created on Wed Oct 25 14:46:12 2017 @author: Sanyu """ # project2 part3 import numpy as np import pandas as pd import seaborn as sn import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split # In[] homeprice = pd.read_csv("C:\Anaconda\home_pric...
null
Part3 Project2.py
Part3 Project2.py
py
6,702
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 18, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 24, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.PolynomialFeatures", "line_number": 46, "usage_type": "call" }...
290948888
import csv import cv2 import numpy as np lines = [] with open('.\data\driving_log.csv') as cf: reader = csv.reader(cf) for line in reader: lines.append(line) images = [] measurments = [] for line in lines: source_path = line[0] filename = source_path.split('\\')[-1] current_path = '.\da...
null
model.py
model.py
py
1,930
python
en
code
null
code-starcoder2
76
[ { "api_name": "csv.reader", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 21, "usage_type": "call" }, { "api_name": "cv2.IMREAD_UNCHANGED", "line_number": 21, "usage_type": "attribute" }, { "api_name": "numpy.array", "lin...
255908694
from flask import Flask, render_template, redirect, url_for, request, session, flash, g from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.bcrypt import Bcrypt from functools import wraps from forms import LoginForm, RegisterForm import random # import sqlite3 app = Flask(__name__) bcrypt = Bcrypt(app) import...
null
app.py
app.py
py
4,183
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.ext.bcrypt.Bcrypt", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.ext.sqlalchemy.SQLAlchemy", "line_number": 19, "usage_type": "call" }, { "api_name": "fl...
496891909
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # 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 applica...
null
pidgeyclient/shell.py
shell.py
py
10,277
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ.get", "line_number": 35, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 35, "usage_type": "attribute" }, { "api_name": "cliff.app.App", "line_number": 41, "usage_type": "name" }, { "api_name": "pidgeyclient.version.ver...
450197920
#coding:utf-8 import urllib.request, urllib.error,sys from urllib.parse import quote import xmltodict #install xmltodict import json url = "http://yapi.ta2o.net/maseli/index.rss" def get_info_ATS(): try: html = urllib.request.urlopen(url) xml = html.read().decode('utf-8') dict ...
null
checkATS.py
checkATS.py
py
1,486
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib.request.request.urlopen", "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...
437198473
# univariate multi-step vector-output stacked lstm example import numpy as np import matplotlib.pyplot as plt from pandas import read_csv import math from keras.models import Sequential from keras.layers import Dense from keras.layers import LSTM from sklearn.preprocessing import MinMaxScaler from sklearn.metrics impor...
null
kube/lstm/OLD/lstm-perc.py
lstm-perc.py
py
6,707
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.percentile", "line_number": 42, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 47, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.MinMaxScaler", "line_number": 61, "usage_type": "call" }, { "api_name": "keras...
513639931
from selenium.webdriver import Firefox from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.firefox.options import Options from selenium.webdriver.support import expected_conditions as expected from selenium.webdriver.support.wait import WebDriverWait from ...
null
scrap_tokopedia.py
scrap_tokopedia.py
py
2,416
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.firefox.options.Options", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver.Firefox", "line_number": 13, "usage_type": "call" }, { "api_name": "selenium.webdriver.support.wait.WebDriverWait", "line_number": 14, ...
63072231
import logging import requests import time import pebbles.utils class PBInstanceLogHandler(logging.Handler): """ Custom log handler which uploads provisioning logs through ReST interface. Could be replaced with HTTPHandler from standard library's logging package once it supports HTTPS and authenticat...
null
pebbles/logger.py
logger.py
py
1,481
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.Handler", "line_number": 8, "usage_type": "attribute" }, { "api_name": "logging.Handler.__init__", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.Handler", "line_number": 15, "usage_type": "attribute" }, { "api_name": "peb...
67966230
import sys, logging, traceback from appstatus import datehandler from database import dbconnection from appstatus import envvariables logger = logging.getLogger() logger.setLevel(logging.DEBUG) logging.basicConfig() class MainWindow(): ''' just some class ''' def __init__(self, appStatus, dbConnection): ...
null
mc-desktop/mc-desktop.py
mc-desktop.py
py
1,149
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 7, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 8, "usage_type": "call" }, { "api_name": "database.dbconn...
553579219
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function __author__ = 'kmu' """ Retrieve data from netcdf files from thredds.met.no and do some statistics. """ import ipdb #import matplotlib #matplotlib.use('Agg') #import matplotlib.pyplot as plt import numpy as np import netCDF...
null
Test/thredds_stats.py
thredds_stats.py
py
3,525
python
en
code
null
code-starcoder2
76
[ { "api_name": "netCDF4.Dataset", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 43, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.where", "line_numbe...
354521829
import pytest from django.utils.safestring import SafeString, mark_safe from grandchallenge.pages.substitutions import Substitution from tests.factories import PageFactory @pytest.mark.parametrize( "tag_name,content,inp,out", [ ("foo", "bar", "{% foo %}", "bar"), ("fo-o", "bar", "{% fo-o %}",...
null
app/tests/pages_tests/test_substitutions.py
test_substitutions.py
py
2,247
python
en
code
null
code-starcoder2
76
[ { "api_name": "grandchallenge.pages.substitutions.Substitution", "line_number": 24, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 8, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 8, "usage_type": "attribute" }, {...
418579062
import json import logging import pytest import shakedown import tempfile import sdk_cmd import sdk_install import sdk_jobs import sdk_plan import sdk_security import sdk_utils from security import transport_encryption from tests import config log = logging.getLogger(__name__) @pytest.fixture(scope='module') def ...
null
frameworks/cassandra/tests/test_toggle_tls.py
test_toggle_tls.py
py
6,890
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "tests.config.SERVICE_NAME", "line_number": 27, "usage_type": "attribute" }, { "api_name": "tests.config", "line_number": 27, "usage_type": "name" }, { "api_name": "sdk_sec...
377333649
""" 1. Get folder name with trained embeddings from sys argv 2. Loop over embedding files 3. For each embedding file do 4. For each emotion file: RemoveId, Embeddings, Reorder, Save to meaningful name 5. Get all featurevectors and train SVM on them, average per embedding file (for all 4 emotions) 6. write results to fi...
null
python_scripts/test_embeddings.py
test_embeddings.py
py
5,742
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 32, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 47, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 50, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
478586499
import logging import weakref import pkg_resources logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) from PyQt5 import QtWidgets, QtCore, QtGui from ...core.instrument.instrument import Instrument from ...core.services.interpreter import Interpreter from ...core.services.accounting import Accountin...
null
cct/qtgui/mainwindow/mainwindow.py
mainwindow.py
py
18,110
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 7, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 53, "usage_type": "attribute" }, { "api_name": "Py...
5610773
from django.shortcuts import render from django.contrib.auth.models import Group from django.db.models import Count from .models import Census, Weights from auth_system.models import MyUser from judge.models import ChoiceProblem, DuchengProblem, Problem, ClassName, MyHomework from django.utils import timezone from djan...
null
trunk/onlineTest/census/views.py
views.py
py
1,419
python
en
code
null
code-starcoder2
76
[ { "api_name": "auth_system.models.MyUser.objects.annotate", "line_number": 13, "usage_type": "call" }, { "api_name": "auth_system.models.MyUser.objects", "line_number": 13, "usage_type": "attribute" }, { "api_name": "auth_system.models.MyUser", "line_number": 13, "usage_t...
565371094
import logging from logging.handlers import QueueHandler, QueueListener from logging.config import dictConfig import os import subprocess import multiprocessing as mp import json from datetime import datetime import time import warnings from skeleton_synapses.constants import PROJECT_ROOT from skeleton_synapses.helper...
null
skeleton_synapses/helpers/logging_ss.py
logging_ss.py
py
3,865
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.NOTSET", "line_number": 18, "usage_type": "attribute" }, { "api_name": "warnings.filterwarnings", "line_number": 41, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 44, "usage_type": "call" }, { "api_name": "os.path", ...
314814047
from django.db import models from django.shortcuts import resolve_url as r from sispos.accounts.models import User from uuid import uuid4 from private_files import PrivateFileField SEMESTER_1 = 'Primeiro semestre' SEMESTER_2 = 'Segundo semestre' SEMESTER_3 = 'Terceriro semestre' SEMESTER_4 = 'Quarto semestre' SEMESTE...
null
sispos/relatorios/models.py
models.py
py
2,376
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.Model", "line_number": 44, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 44, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 45, "usage_type": "call" }, { "api_name"...
556954067
from selenium.webdriver import Chrome from selenium.webdriver.support.select import Select import time import pytest @pytest.fixture() def environment_setup(): global driver path = "C:/DdriveData/downloads/chromedriver_win32/chromedriver.exe" driver = Chrome(executable_path=path) driver.get("http://www...
null
pytest code/test_HandlingMultiwindows.py
test_HandlingMultiwindows.py
py
1,437
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 10, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 6, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 28, "usage_type": "call" } ]
544390188
import config import pytest import helpers from art.unittest_lib.common import testflow import rhevmtests.storage.helpers as storage_helpers from art.rhevm_api.tests_lib.low_level import ( storagedomains as ll_sd, hosts as ll_hosts, jobs as ll_jobs, vms as ll_vms ) from rhevmtests.storage.fixtures imp...
null
art/tests/rhevmtests/storage/storage_mixed_types_dc/fixtures.py
fixtures.py
py
3,901
python
en
code
null
code-starcoder2
76
[ { "api_name": "art.rhevm_api.tests_lib.low_level.storagedomains.getStorageDomainNamesForType", "line_number": 27, "usage_type": "call" }, { "api_name": "art.rhevm_api.tests_lib.low_level.storagedomains", "line_number": 27, "usage_type": "name" }, { "api_name": "config.DATA_CENTER...
370566823
#!/usr/bin/env python """ Script Header $Id: US23814 Copyright (c) 2016-2017 Cisco Systems, Inc. Name: cmCC23814_3pcc_BS_IOT_Interop_69_Connected_Line_Restriction_ After_Call_Forward.py Purpose: This test case demonstrates the ability of the DUT to update the caller ID display based on the calle...
null
common/IOT/Broadsoft_Interop/section_6/cc_basic/cmCC23814_3pcc_BS_IOT_Interop_69_Connected_Line_Restriction_After_Call_Forward.py
cmCC23814_3pcc_BS_IOT_Interop_69_Connected_Line_Restriction_After_Call_Forward.py
py
11,799
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 103, "usage_type": "call" }, { "api_name": "tng_sl.contrib.setup_helper.SetupHelpersTestCase", "line_number": 107, "usage_type": "name" }, { "api_name": "tng.api", "line_number": 107, "usage_type": "attribute" }, { ...
352661914
#!/user/bin/env python import serial import csv import os import time port = '/dev/ttyACM0' ser = serial.Serial(port, 9600) ser.flushInput() with open('ColdFlowTest6.csv', mode="w") as csv_file: csv_writer = csv.writer(csv_file, delimiter=",", quotechar='"', quoting=csv.QUOTE_MINIMAL) csv_writer.writerow("[Co...
null
GSE/Load_Cell/serialToCSV.py
serialToCSV.py
py
781
python
en
code
null
code-starcoder2
76
[ { "api_name": "serial.Serial", "line_number": 8, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 12, "usage_type": "call" }, { "api_name": "csv.QUOTE_MINIMAL", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.fsync", "line_n...
327079654
import re import torch import torchtext import torchtext.data import torch.nn as nn import torch.nn.functional as F import numpy as np from utils.model import CNN from utils.data import DataIterator from utils.utils import clean_text from captum.attr import LayerIntegratedGradients, TokenReferenceBase from captum.att...
null
server/model.py
model.py
py
12,327
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.data.DataIterator", "line_number": 32, "usage_type": "call" }, { "api_name": "captum.attr.TokenReferenceBase", "line_number": 34, "usage_type": "call" }, { "api_name": "torch.load", "line_number": 36, "usage_type": "call" }, { "api_name": "cap...
412534916
import time import io import threading try: # Para ser usado no raspberry pi import picamera class Camera(object): thread = None # background thread that reads frames from camera frame = None # current frame is stored here by background thread last_access = 0 # time of last client access to ...
null
camera_pi.py
camera_pi.py
py
2,160
python
en
code
null
code-starcoder2
76
[ { "api_name": "threading.Thread", "line_number": 14, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 19, "usage_type": "call" }, { "api_name": "time.time", "line_number": 22, "usage_type": "call" }, { "api_name": "picamera.PiCamera", "line_n...
211576808
import requests import re import random import json import base64 import cv2 import time from Crypto.Cipher import DES from xiaohongshu_check import Check def encrypt(key, text): """ DES 加密 :param key: 密钥, 长度必须为 16(AES-128)、24(AES-192)、32(AES-256) Bytes 长度 :param text: 密文 :return: """ enc...
null
shumei/shumei_passed.py
shumei_passed.py
py
8,219
python
en
code
null
code-starcoder2
76
[ { "api_name": "Crypto.Cipher.DES.new", "line_number": 20, "usage_type": "call" }, { "api_name": "Crypto.Cipher.DES", "line_number": 20, "usage_type": "name" }, { "api_name": "Crypto.Cipher.DES.MODE_ECB", "line_number": 20, "usage_type": "attribute" }, { "api_name"...
529777246
"""OlaApi URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-base...
null
OlaAPI/OlaApi/OlaApi/urls.py
urls.py
py
1,076
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.patterns", "line_number": 27, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 28, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 29, "usage_type": "call" }, { "api_name": "d...
575361071
from sklearn import feature_extraction from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer corpus = ['... ' '...' '... ' #数据集 ] vectorizer = CountVectorizer() X = vectorizer.fit_transform(corpus) # 获取词袋模型中的所有词...
null
src3/TF-IDF.py
TF-IDF.py
py
682
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.feature_extraction.text.CountVectorizer", "line_number": 10, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.text.TfidfTransformer", "line_number": 22, "usage_type": "call" } ]
26151729
#!/usr/bin/env python3 import random import colors as c class Dice(): """ Dice Creates a new die `sides`: How many sides the die has `dice`: The amount of dice you want to roll `ascii`: The ascii art you want to display to represent the number rolled """ def __...
null
dice.py
dice.py
py
679
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.randrange", "line_number": 24, "usage_type": "call" }, { "api_name": "colors.rc", "line_number": 29, "usage_type": "call" } ]
534809108
from django.db import models from account.models import MyUser class Category(models.Model): slug = models.CharField(max_length=100, primary_key=True) name = models.CharField(max_length=150, unique=True) def __str__(self): return self.name class Post(models.Model): CHOICES = ( ('in...
null
PycharmProjects/OwnRest/main/models.py
models.py
py
1,753
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.Model", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 6, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 7, "usage_type": "call" }, { "api_name": "...
522806333
#!/usr/bin/env python3 # import sys, os, argparse, datetime, subprocess, textwrap, shutil, signal import fnmatch usage_desc = textwrap.dedent(""" traverse and remove all sub-dirs named as 'build' from the given root dir """) class VersionError(Exception): def __init__(self, value): self.val...
null
basic_/path_/traverse_demo.py
traverse_demo.py
py
1,441
python
en
code
null
code-starcoder2
76
[ { "api_name": "textwrap.dedent", "line_number": 7, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, ...
232651800
import xlrd Lh = [] #Lh file as dictionary book = xlrd.open_workbook('Lh.xlsx') sh = book.sheet_by_index(0) first_row = [] for cx in range(sh.ncols): first_row.append(sh.cell_value(0,cx)) for rx in range(1, sh.nrows): # sh.nrows for all of it LhEntry = {} for cx in range (0, sh.ncols): LhEntry[firs...
null
LhDictionary.py
LhDictionary.py
py
407
python
en
code
null
code-starcoder2
76
[ { "api_name": "xlrd.open_workbook", "line_number": 3, "usage_type": "call" } ]
291568447
from utils.delay import delay from utils.raises import raises from utils.html_dec import bold, italic, underline @bold @italic @delay @raises(FileNotFoundError) def print_styled(styling_string): return styling_string + 2 print(print_styled("coffin_dance_meme.webm"))
null
python/module4/main.py
main.py
py
277
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.html_dec.bold", "line_number": 5, "usage_type": "name" }, { "api_name": "utils.html_dec.italic", "line_number": 6, "usage_type": "name" }, { "api_name": "utils.delay.delay", "line_number": 7, "usage_type": "name" }, { "api_name": "utils.raises...
294630200
import os from selenium import webdriver from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.chrome.options import Options from datetime import date import json # CSS Variables ok_button_css_list = [ "#root > div > div > div.app-mainContainer--3CJGG > div > main > div.layout > di...
null
crossword_scraper.py
crossword_scraper.py
py
6,141
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.common.exceptions.NoSuchElementException", "line_number": 42, "usage_type": "name" }, { "api_name": "selenium.common.exceptions.NoSuchElementException", "line_number": 50, "usage_type": "name" }, { "api_name": "os.path.abspath", "line_number": 123, ...
62440726
import os from datetime import datetime from logging import getLogger from time import time import copy from random import random from collections import namedtuple import numpy as np from lockfile.mkdirlockfile import MkdirLockFile from reversi_zero.agent.player import SelfPlayer from reversi_zero.config import Config...
null
src/reversi_zero/worker/self_play.py
self_play.py
py
5,759
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 18, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 19, "usage_type": "call" }, { "api_name": "rever...
556109648
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('schedule', '0014_auto_20170724_0944'), ] operations = [ migrations.AlterField( ...
null
schedule/migrations/0015_auto_20170724_0949.py
0015_auto_20170724_0949.py
py
523
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.migrations.AlterField", "line_number": 15, "usage_type": "call" }, {...
447026038
# -*- coding: utf-8 -*- #from distutils.core import setup from setuptools import setup def readme(): with open('README.md') as f: return f.read() try: import pypandoc long_description = pypandoc.convert('README.md', 'rst') except(IOError, ImportError): long_description = open('README.md').rea...
null
setup.py
setup.py
py
1,604
python
en
code
null
code-starcoder2
76
[ { "api_name": "pypandoc.convert", "line_number": 12, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 17, "usage_type": "call" } ]
450335087
#!/usr/bin/env python3.7 import aiostream import asyncio import rospy import rostest import sys import unittest from aiorospy import AsyncActionClient from actionlib import ActionServer, GoalStatus from actionlib.msg import TestAction, TestGoal, TestFeedback, TestResult from threading import Event class TestActionCl...
null
aiorospy/tests/test_action_client.py
test_action_client.py
py
3,574
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 15, "usage_type": "attribute" }, { "api_name": "rospy.init_node", "line_number": 19, "usage_type": "call" }, { "api_name": "actionlib.ActionServer", "line_number": 22, "usage_type": "call" }, { "api_name": "actionl...
227415271
from collections import defaultdict import math test = 0 if test == 1: inp = "../../test/04-input.txt" model = "../../test/04-model.txt" else: data = "../../data/wiki-ja-train.word" model = "model_file.txt" inp = "../../data/wiki-ja-test.word" def modeling_unigram(file1, file2): tot_cnt = 0 ...
null
kondo/tutorial03/tutorial03.py
tutorial03.py
py
2,573
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 16, "usage_type": "call" }, { "api_name": "math.log", "line_number": 54, "usage_type": "call" } ]
141566581
import datetime import uuid from mongoengine import Document, StringField, UUIDField from django.conf import settings from crits.core.crits_mongoengine import CritsSchemaDocument, CritsBaseAttributes from crits.core.crits_mongoengine import CritsDocument, CritsSourceDocument from crits.core.user_tools import user_sou...
null
crits/events/event.py
event.py
py
10,436
python
en
code
null
code-starcoder2
76
[ { "api_name": "crits.core.crits_mongoengine.CritsBaseAttributes", "line_number": 26, "usage_type": "name" }, { "api_name": "crits.core.crits_mongoengine.CritsSourceDocument", "line_number": 26, "usage_type": "name" }, { "api_name": "mongoengine.Document", "line_number": 26, ...
540528891
""" Auxiliary functions for development test suite. """ # standard library import logging import socket import shutil import glob import os import sys # subproject library import modules.clsMail ''' Logging. ''' def start_logging(): """ Start logging of performance. """ logging.captureWarnings(True) ...
null
testing/random/modules/auxiliary.py
auxiliary.py
py
2,798
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.captureWarnings", "line_number": 21, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.Formatter", "line_number": 25, "usage_type": "call" }, { "api_name": "logging.F...
599732766
# -*- coding: UTF-8 -*- import psycopg2 import re import sys import tldextract from datetime import datetime from threading import Thread from queue import Queue from logger import logger import os # db_name: lb, template0, certwatch, postgres, template1 (SELECT datname FROM pg_database) # table_name: sel...
null
dataset/get_fulldomain/get_fulldomain/crtsh.py
crtsh.py
py
7,765
python
en
code
null
code-starcoder2
76
[ { "api_name": "psycopg2.connect", "line_number": 23, "usage_type": "call" }, { "api_name": "queue.Queue", "line_number": 25, "usage_type": "call" }, { "api_name": "logger.logger.info", "line_number": 74, "usage_type": "call" }, { "api_name": "logger.logger", "...
174311893
# -*- coding: utf-8 -*- """ Created on Wed Aug 16 15:37:34 2017 #TF image Test @author: xuan.xia@siat.ac.cn """ # -*- coding: utf-8 -*- #import modules import tensorflow as tf import numpy as np import os import cv2 import sys SignalType = sys.argv[1] DataPath = sys.argv[2] ModlePath = sys.argv[3]...
null
Test.py
Test.py
py
2,001
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 17, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 18, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 19, "usage_type": "attribute" }, { "api_name": "numpy.uint32", "line_nu...
45341597
import tushare import tushare as ts import datetime import csv import re tickersRawData = tushare.get_stock_basics() tickers = tickersRawData.index.tolist() dateToday = datetime.datetime.today().strftime('%Y-%m-%d') file = 'D:\\Users\\Administrator\\Anaconda3'+dateToday+'.csv' tickersRawData.to_csv(file) # 此处去掉st和新的...
null
handle_stock/old_version/function_popups/GetPoint80Tickers.py
GetPoint80Tickers.py
py
4,926
python
en
code
null
code-starcoder2
76
[ { "api_name": "tushare.get_stock_basics", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime.today", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "attribute" }, { "api_name": "...
418967248
# -*- coding: utf-8 -*- import numpy as np from scipy.stats import chi2 # Goodness of Fit: Uniform Distribution Test (Frecuencial) # Pearson (Chi Squared) approach def goodness_fit_test(array): alpha_critic = 0.05 # Signification level for Critic Region validation n_total ...
null
TP2.1/tests.py
tests.py
py
5,920
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 14, "usage_type": "call" }, { "api_name": "scipy.stats.chi2.interval", "line_number": 26, "usage_type": "call" }, { "api_name": "scipy.stats.chi2", "line_number": 26, "usage_type": "name" }, { "api_name": "numpy.array", ...
60615510
#!/usr/bin/env python from spt3g import core, dfmux, gcp import socket, argparse, os parser = argparse.ArgumentParser(description='Record dfmux data to disk') parser.add_argument('hardware_map', metavar='/path/to/hwm', help='Path to hardware map directory') parser.add_argument('output', metavar='/path/to/files/file-%...
null
scratch/nwhitehorn/onlinescripts-sptpol/record_bolodata.py
record_bolodata.py
py
2,064
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "pywtl.common.DFML.HWM.HardwareMap.HardwareMap", "line_number": 18, "usage_type": "call" }, { "api_name": "pywtl.common.DFML.HWM.HardwareMap", "line_number": 18, "usage_type":...
364835552
import os import json import numpy as np import pandas as pd from sklearn.metrics import confusion_matrix from Persistance.team_repository import get_teams from sklearn.ensemble import RandomForestClassifier from Persistance.player_repository import get_player_name from Services.csv_service import create_csv_file_for_p...
null
Classifiers/Game_by_game/random_forest.py
random_forest.py
py
5,665
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.ensemble.RandomForestClassifier", "line_number": 21, "usage_type": "call" }, { "api_name": "sklearn.metrics.confusion_matrix", "line_number": 31, "usage_type": "call" }, { "api_name": "Services.timestamp.start_timestamp", "line_number": 37, "usage_t...
43990961
import torch import torch.nn as nn import torch.nn.functional as F class CapsuleLoss(nn.Module): def __init__(self): ''' Constructs a CapsuleLoss module ''' super(CapsuleLoss, self).__init__() self.reconstruction_loss = nn.MSELoss(reduction='sum') # cumulativ...
null
src/loss.py
loss.py
py
1,737
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.MSELoss", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.nn", "line_num...
276539910
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Commune', fields=[ ('id', models.AutoField(verb...
null
base/migrations/0001_initial.py
0001_initial.py
py
4,655
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 13, "usage_type": "call" }, ...
301708940
from glob import glob import pandas as pd import numpy as np from scipy.stats import linregress def rmse(datasets): """ Return the RMSE of each of the datasets. >>> datasets = {k:pd.read_csv('data/dataset_%d.csv' % k) for k in range(7)} >>> out = rmse(datasets) >>> len(out) == 7 True ...
null
discussions/08/disc08.py
disc08.py
py
1,555
python
en
code
null
code-starcoder2
76
[ { "api_name": "scipy.stats.linregress", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 25, "usage_type": "call" }, { "api_name": "pandas.Series", "lin...
486611901
from .classes import Cave, Player from .control import parse_command, Action INSTRUCTIONS = """ Blah blah blah something something cave something something wumpus something bats room pits etc etc 20 rooms connect in a dodecahedron yada yada yada """ print("welcome to pywump") if not input("would you like instruction...
null
pywump/__main__.py
__main__.py
py
896
python
en
code
null
code-starcoder2
76
[ { "api_name": "classes.Cave.construct_random", "line_number": 15, "usage_type": "call" }, { "api_name": "classes.Cave", "line_number": 15, "usage_type": "name" }, { "api_name": "control.parse_command", "line_number": 22, "usage_type": "call" }, { "api_name": "cont...
262638343
import bs4 import lxml from bs4 import BeautifulSoup import requests import string import codecs import json def main(): # Этап 1 - с каждой из 502 страниц считываем все ссылки на статьи -> записываем в текстовый файл news_url_list = [] for i in range(1, 502): r = requests.get(url =...
null
first_progect/Pars.py
Pars.py
py
2,867
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 42, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "...
648091560
# -*- coding: utf-8 -*- ''' Created on 18/09/2013 @author: Roberto Guimarães Morati Junior ''' from django.conf.urls import patterns, url from core.views import TipoObjetoUpdateView, TipoObjetoCreateView, TipoObjetoListView, TipoObjetoDeleteView, TipoObjetoGetJsonView,\ CondicaoAtivaCreateView from core.views impo...
null
Editores/editor_objetos/urls.py
urls.py
py
8,532
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 22, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 22, "usage_type": "name" }, { "api_name": "django.conf.urls.patterns", "line_number": 37, "usage_type": "call" }, { "...
586933001
''' from: https://wiki.fysik.dtu.dk/gpaw/tutorials/gw_tutorial/gw_tutorial.html ''' from ase.build import bulk from gpaw import GPAW, FermiDirac from gpaw.wavefunctions.pw import PW a = 3.567 atoms = bulk('C', 'diamond', a=a) calc = GPAW( mode=PW(300), # energy cutoff for plane wave basis (in eV) kpts={...
null
t4/diamond.py
diamond.py
py
649
python
en
code
null
code-starcoder2
76
[ { "api_name": "ase.build.bulk", "line_number": 11, "usage_type": "call" }, { "api_name": "gpaw.GPAW", "line_number": 13, "usage_type": "call" }, { "api_name": "gpaw.wavefunctions.pw.PW", "line_number": 14, "usage_type": "call" }, { "api_name": "gpaw.FermiDirac", ...
601121643
""" Time complexity: O(M + N) Where M is the length of S and N is the length of T Space complexity: O(N) we use auxillary hashmap of size N where N is the length of T Compiled on leetcode?: Yes Difficulties faced?: No """ from collections import Counter class Solution: def customSortString(self, S: str, T: str) -> ...
null
customSortString.py
customSortString.py
py
954
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.Counter", "line_number": 10, "usage_type": "call" } ]
322154576
import argparse import asyncio from matryoshka_tester.data import containers from matryoshka_tester.helpers import get_selected_runtime from prettytable import PrettyTable # Do real stuff async def pull_container(url): """Pulls the container given in url with docker CLI""" runtime = get_selected_runtime()...
null
matryoshka_tester/cmds.py
cmds.py
py
1,693
python
en
code
null
code-starcoder2
76
[ { "api_name": "matryoshka_tester.helpers.get_selected_runtime", "line_number": 15, "usage_type": "call" }, { "api_name": "asyncio.create_subprocess_shell", "line_number": 16, "usage_type": "call" }, { "api_name": "asyncio.subprocess", "line_number": 18, "usage_type": "att...
587682369
from transformers import AutoTokenizer """ Using the tokenizer from the transformer (Huggingface) framework """ TurnGPT_TOKENS = { "pad_token": "<|endoftext|>", "additional_special_tokens": [ "<speaker1>", "<speaker2>", ], } TurnGPT_EOT_TOKENS = { "pad_token": "<|endoftext|>", "a...
null
ttd/tokenizer.py
tokenizer.py
py
1,590
python
en
code
null
code-starcoder2
76
[ { "api_name": "transformers.AutoTokenizer.from_pretrained", "line_number": 57, "usage_type": "call" }, { "api_name": "transformers.AutoTokenizer", "line_number": 57, "usage_type": "name" } ]
633960191
# iCraft is Copyright 2010-2011 both # # The Archives team: # <Adam Guy> adam@adam-guy.com AKA "Adam01" # <Andrew Godwin> andrew@aeracode.org AKA "Aera" # <Dylan Lukes> lukes.dylan@gmail.com AKA "revenant" # <Gareth Coles> colesgareth2@hotmai...
null
core/plugins/grieferdetector.py
grieferdetector.py
py
4,126
python
en
code
null
code-starcoder2
76
[ { "api_name": "core.plugins.ProtocolPlugin", "line_number": 43, "usage_type": "name" }, { "api_name": "datetime.datetime.utcnow", "line_number": 66, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 66, "usage_type": "attribute" }, { "api_n...
601645765
# -*- coding: utf-8 -*- #-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-# """ Раскадровщик. Ест видео и выдает раскадровку на листах A4 или что там указано в settings.ini. date started 2018.11.26 last updated ...
null
raskadrovschik.py
raskadrovschik.py
py
17,152
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.split", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 113, "usage_type": "call" }, { "api_name": "os.path", "line_number": 113, "usage_type": "attribute" }, { "api_name": "errno.ENOENT", "line_numbe...
258093818
from math import e from sklearn.model_selection import train_test_split, GridSearchCV from sklearn.metrics import r2_score, accuracy_score from sklearn.linear_model import LinearRegression, SGDRegressor, RidgeCV, SGDClassifier, RidgeClassifier from sklearn.preprocessing import LabelEncoder from sklearn.neighbors import...
null
modeler/modeler.py
modeler.py
py
7,424
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.DataFrame", "line_number": 29, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 43, "usage_type": "call" }, { "api_name": "sklearn.model_selection.GridSearchCV", "line_number": 52, "usage_type": "call" }, { "api_name":...
208984019
import random from base64 import b64decode from io import BytesIO import pytest from PIL import Image as PILImage from django.conf import settings from django.http import Http404 from grandchallenge.retina_api.serializers import B64ImageSerializer from tests.cases_tests.factories import ( ImageFactoryWithImageFil...
null
app/tests/retina_api_tests/test_serializers.py
test_serializers.py
py
2,563
python
en
code
null
code-starcoder2
76
[ { "api_name": "tests.cases_tests.factories.ImageFactoryWithoutImageFile", "line_number": 24, "usage_type": "call" }, { "api_name": "grandchallenge.retina_api.serializers.B64ImageSerializer", "line_number": 25, "usage_type": "call" }, { "api_name": "pytest.raises", "line_numbe...
99150347
import matplotlib.pyplot as plt import numpy as np import pandas as pd from sklearn.linear_model import LinearRegression dt = pd.read_csv("hours.csv") X= dt['hrs'] y= dt['risk'] regressor = LinearRegression() regressor.fit(X,y) print("Accuracy : ", str(regressor.score(X, y) * 100)) y_pred=regressor.predict([[10]]) p...
null
1.Linear-Regression/ln.py
ln.py
py
674
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 20, "usage_type": "call" }, { "api_n...
518552011
from django import forms from personal.models import Comment, File, Post from taggit.forms import TagWidget class CommentForm(forms.ModelForm): class Meta: model = Comment fields = ['body'] widgets = { 'body': forms.Textarea(attrs={'placeholder': 'Comment...'}), } class...
null
personal/forms.py
forms.py
py
1,362
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.ModelForm", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 5, "usage_type": "name" }, { "api_name": "personal.models.Comment", "line_number": 7, "usage_type": "name" }, { "api_name": "django....
462653756
#!/usr/bin/env python import itertools import serial, os, re from serial.tools import list_ports import _winreg as winreg from Logger import Logger class COMMngr(): def __init__(self): self._windowsRegistry = 'HARDWARE\\DEVICEMAP\\SERIALCOMM' def getAllPorts(self): ports = [] ...
null
COMMngr.py
COMMngr.py
py
1,108
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.name", "line_number": 16, "usage_type": "attribute" }, { "api_name": "_winreg.OpenKey", "line_number": 18, "usage_type": "call" }, { "api_name": "_winreg.HKEY_LOCAL_MACHINE", "line_number": 18, "usage_type": "attribute" }, { "api_name": "Logger.L...
21499624
import cv2 cascade_src = 'cars.xml' video_src = 'video1.avi' cam = cv2.VideoCapture(video_src) cars_cascade = cv2.CascadeClassifier(cascade_src) while True: ret, img = cam.read() gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) cars = cars_cascade.detectMultiScale(gray, 1.1, 1) for (x, y, w, h) in cars:...
null
haar_cascade/cars_detection/cars_detection.py
cars_detection.py
py
477
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.VideoCapture", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY"...
114990655
import grokcore.component as grok from xml.sax.saxutils import escape from zope.app.form.interfaces import IInputWidget, IDisplayWidget from zope.publisher.interfaces.browser import IBrowserRequest from zope.app.form.browser import TextWidget, DisplayWidget from zope import component from zope.component.interfaces imp...
null
z3c.relationfieldui/trunk/src/z3c/relationfieldui/widget.py
widget.py
py
3,049
python
en
code
null
code-starcoder2
76
[ { "api_name": "hurry.resource.Library", "line_number": 20, "usage_type": "call" }, { "api_name": "hurry.resource.ResourceInclusion", "line_number": 21, "usage_type": "call" }, { "api_name": "grokcore.component.MultiAdapter", "line_number": 23, "usage_type": "attribute" ...