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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
620643765 | from rest_framework.permissions import IsAuthenticatedOrReadOnly, IsAuthenticated
from rest_framework import permissions
from rest_framework import generics
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from django.http import Http404
from django... | null | authors/apps/profiles/views.py | views.py | py | 3,909 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.generics.ListAPIView",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.generics",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "rest_framework.permissions.IsAuthenticated",
"line_number": 21,
"usage_t... |
481294637 | from pytest import mark # type: ignore
from graphql import graphql
from .star_wars_schema import StarWarsSchema
@mark.asyncio
async def test_correctly_fetches_id_name_rebels():
query = """
query RebelsQuery {
rebels {
id
name
}
}
"""
expected = {
... | null | tests/test_star_wars_object_identification.py | test_star_wars_object_identification.py | py | 2,054 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "graphql.graphql",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "star_wars_schema.StarWarsSchema",
"line_number": 21,
"usage_type": "argument"
},
{
"api_name": "pytest.mark.asyncio",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_n... |
549893531 | from django.conf.urls import url
from django.contrib import admin
from .views import (
shapefile_list,
maps_create,
maps_createsvg,
delete_svg,
svg_list,
svg_detail,
update_svg,
translation_word,
)
urlpatterns = [
url(r'^shplist/$', shapefile_list, name='shplist'),
url(r'^l... | null | maps/urls.py | urls.py | py | 718 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "views.shapefile_list",
"line_number": 16,
"usage_type": "argument"
},
{
"api_name": "django.conf.urls.url",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "vi... |
502371222 | import argparse
import math
import numpy as np
import os
import sys
import torch
import provider
import torch.nn as nn
import models.model_cls
import torch.optim as optim
from torch.optim import lr_scheduler
import datetime
import matplotlib.pyplot as plt
begin_time = datetime.datetime.now()
BASE_DIR = os.path.dirname... | null | classification_train.py | classification_train.py | py | 7,383 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.now",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path"... |
252027188 | import datetime
import io
import os
import sys
import time
import azure.storage.blob as azureblob
import azure.batch.batch_service_client as batch
import azure.batch.batch_auth as batchauth
import azure.batch.models as batchmodels
sys.path.append('.')
sys.path.append('..')
BATCH_ACCOUNT_NAME = ''
BATCH_ACCOUNT_KEY =... | null | batch-rawlinksnapshot-wiki.py | batch-rawlinksnapshot-wiki.py | py | 16,638 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_nu... |
168468126 | """Run LDA on Amazon reviews."""
import itertools
import click
from gensim.models.ldamulticore import LdaMulticore as LDA
from nlp_playground.data import amazon_book_reviews
from nlp_playground.exceptions import BadValidation
from nlp_playground.lib.data import groups_of_minimum_size
from nlp_playground.lib.gensim.co... | null | nlp_playground/scripts/reviews_lda.py | reviews_lda.py | py | 1,707 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "nlp_playground.exceptions.BadValidation",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "nlp_playground.data.amazon_book_reviews",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "nlp_playground.data.amazon_book_reviews",
"line_number": 40,
... |
466015394 | import argparse
import os
import shutil
import sys
from yaml import load as yaml_load
try:
from yaml import CLoader as Loader
except ImportError:
from yaml import Loader
parser = argparse.ArgumentParser(description='Ubuntu ISO Generator API Server')
parser.add_argument('-c', '--config', dest='config_file', me... | null | ubuntu_isogen_apiserver/appconfig.py | appconfig.py | py | 2,392 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 56,
"usage_type": "attribute"
},
{
"api_name": "os.path.isfile",
... |
336694326 | from captionbot import CaptionBot
import nltk
import random
import importlib
import sys
import urllib
import json
import ast
import gCloudStorage
import im2metadata
import gVision
import questions
import traceback
class QuestionGeneration(object):
def __init__(self):
pass
def askGeneralQ(self):
... | null | backend/gcloud/im2Prompt.py | im2Prompt.py | py | 5,528 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.choice",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_n... |
164261025 | '''this is the script of the main game play'''
import pygame
import time
import random
pygame.init()
#set the game display window height and width
display_width = 800
display_height = 600
#color definitions
black = (0,0,0)
white = (255, 255, 255)
red = (255, 0, 0)
dark_gray = (50, 50, 50)
light_gray = (158, 163, 16... | null | swerve.py | swerve.py | py | 5,073 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.init",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "pygame.display... |
206436277 | import pytest
import time
import json
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.c... | null | tests/test_slurm.py | test_slurm.py | py | 2,275 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.by.By.XPATH",
"line_number": 28,
"usage_type": "attribute"
},
... |
472890498 | import pyrr
import math
import pygame
import quaternion
class Camera:
def __init__(self, view_point=None):
if view_point is None:
self.view_point = [0.0, 0.0, 5]
else:
self.view_point = view_point
self.up_axis = [0.0, 1.0, 0.0]
self.snap_view_point = self.vi... | null | camera.py | camera.py | py | 3,442 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "quaternion.cross",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "quaternion.cross",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pyrr.matrix44.create_look_at",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "pyrr.m... |
365661830 | ##
# fluxonium_display contains the Display class which takes in a fluxonium
# object from scqubits and handles the plotting and display of
# the GUI interface
#
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import TextBox, Button
import os
from datetime import date
import csv
import sc... | null | Simulation/GUI_Class/fluxonium_display.py | fluxonium_display.py | py | 14,071 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 69,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 75,
"usage_type": "call"
},
{
"api_name"... |
246768676 | from dragonfly import (Grammar, AppContext, MappingRule, Key, Text, Dictation, Integer)
grammar = Grammar("global")
global_rules = MappingRule(
name="global rules",
mapping={
# WINDOW MANAGEMENT
"switch app": Key("alt:down, tab/10, alt:up"),
"double switch": Key("alt:down, tab:2/10, alt:up"),
"switch me... | null | _global.py | _global.py | py | 2,386 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "dragonfly.Grammar",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "dragonfly.MappingRule",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "dragonfly.Key",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "dragonfly.Key",
... |
629304413 | #!/usr/bin/env python
# Extract selected components for analysis
from common import *
import argparse
import csv
import numpy as np
import scipy as sp
from pprint import pprint
import networkx as nx
from cluster_common import *
def analyse(G_sim, threshold_sim):
print_err("Finding connected components")
... | null | data/external/repositories_2to3/42139/KDDCup13Track2-master/analyseGraph.py | analyseGraph.py | py | 1,784 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "networkx.connected_component_subgraphs",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "networkx.read_weighted_edgelist",
"line_number": 41,
"usage_type": "call"
... |
357952947 | from django.shortcuts import render, redirect, get_list_or_404, get_object_or_404
from django.contrib.auth.decorators import login_required
from django.views.decorators.http import require_POST
from django.db.models import Q
from itertools import chain
from django.http import JsonResponse
from .models import Post, Imag... | null | 2019.05.02 - 자바스크립트(helper, dog image, 좋아요)/insta_project/posts/views.py | views.py | py | 7,100 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "models.Post.objects.filter",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "models.Post.objects",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "models.Post",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "djang... |
140553786 | import json
from collections import namedtuple
from os import listdir
from os import path
import re
import arrow
# import modin.pandas as pd # this line enable multi core support for Pandas: https://modin.readthedocs.io/en/latest/
import pandas as pd
import requests
from tqdm import tqdm
from config import AWASU_API_... | null | manipulators.py | manipulators.py | py | 15,195 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.compile",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "arrow.now",
"l... |
384913656 | import os
import io
import chess.pgn
import pickledb
from datetime import datetime
files = os.listdir('./queue')
db = pickledb.load("./evaluations.db", True)
now = datetime.now()
i = 0
def searchTree(root):
global i
for variation in root.variations:
searchTree(variation)
b = root.board()
eval... | null | main-pickle.py | main-pickle.py | py | 862 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.listdir",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pickledb.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
426841373 | import sys
from google.cloud import storage
import re
from titanic.config import Config
import numpy as np
import pandas as pd
from pandas import DataFrame
def extract_maritial(name):
""" extract the person's title, and bin it to Mr. Miss. and Mrs.
assuming a Miss, Lady or Countess has more change to survive ... | null | titanic/preprocess.py | preprocess.py | py | 6,021 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.findall",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.isnull",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_number": 69... |
274295 | import json
dictionary = {}
lines = open('content2.rdf', mode='r', encoding='utf-8')
for line in lines:
v = json.loads(line)
s = v['d:Description']
words
if s in stat.keys():
cpl[s.count('/')+1]+=1
stat[s]+=1
| null | tf_idf.py | tf_idf.py | py | 257 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.loads",
"line_number": 8,
"usage_type": "call"
}
] |
177726390 | """change current_review column in worker table to current_url
Revision ID: 2a535a54aa95
Revises: f851ec9af09
Create Date: 2013-11-18 15:05:07.519054
"""
# revision identifiers, used by Alembic.
revision = '2a535a54aa95'
down_revision = 'f851ec9af09'
from alembic import op
import sqlalchemy as sa
def upgrade():
... | null | holmes/migrations/versions/2a535a54aa95_change_current_revie.py | 2a535a54aa95_change_current_revie.py | py | 829 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "alembic.op.add_column",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Text",
... |
329040084 | import argparse
import parse
import math
parser = parse.Parser('''{:g}
{:d}
{:d} {:g}
''')
def parse(filename):
with open(filename) as file:
data = file.read()
return parser.parse(data)
def validate(fa, fb):
a = parse(fa)
if a is None:
return False, f'Failed to parse {fa!r}'
b ... | null | HW5/validate.py | validate.py | py | 1,031 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "parse.Parser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "math.isclose",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "math.isclose",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"... |
232785203 | """
sudo.views
~~~~~~~~~~
:copyright: (c) 2014 by Matt Robenolt.
:license: BSD, see LICENSE for more details.
"""
try:
from urllib.parse import urlparse, urlunparse
except ImportError: # pragma: no cover
# Python 2 fallback
from urlparse import urlparse, urlunparse # noqa
from django.contrib.auth.decora... | null | sudo/views.py | views.py | py | 4,360 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sudo.settings.SUDO_FORM.split",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sudo.settings.SUDO_FORM",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "django.utils.importlib.import_module",
"line_number": 32,
"usage_type": "call"
},... |
560687869 | from django.shortcuts import render_to_response
from django.template import RequestContext
from product.utils import find_best_auto_discount
from product.models import Category, Product
from product.signals import index_prerender
from satchmo_utils.views import bad_or_missing
from django.utils.translation import ugette... | null | localsite/views.py | views.py | py | 6,804 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.template.RequestContext",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render_to_response",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "product.models.Category.objects.get_by_site",
"line_number": 36,
"usag... |
581366855 | """
Flask Documentation: http://flask.pocoo.org/docs/
Jinja2 Documentation: http://jinja.pocoo.org/2/documentation/
Werkzeug Documentation: http://werkzeug.pocoo.org/documentation/
This file creates your application.
"""
from app import app, db, login_manager
from flask import render_template, request, redirec... | null | app/views.py | views.py | py | 4,321 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.render_template",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "app.app.route",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "app.app",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "flask.render_template",
... |
562970365 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | null | dags/spark_batch_job_distributed_mode.py | spark_batch_job_distributed_mode.py | py | 3,276 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.environ.get",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "airflow.contrib.kubernetes.pod_runtime_info_env.PodRuntimeInfoEnv",
"line_number": 47,
"usage_type": "call... |
106606133 | """
saltfactories.plugins.sysstats
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Process stats PyTest plugin interface
"""
import os
from collections import OrderedDict
import psutil
import pytest
from saltfactories.utils.processes.stats import SaltTerminalReporter
def pytest_addoption(parser):
"""
register a... | null | saltfactories/plugins/sysstats.py | sysstats.py | py | 2,038 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.OrderedDict",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "psutil.Process",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "os.getpid",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "saltfactories.utils.... |
141156931 | import numpy as np
import matplotlib.pyplot as plt
print("Enter a function");
print("1. Sin");
print("2. Cos");
a = input(">>");
x = np.linspace(-np.pi,np.pi,4);
if a == 1:
y = np.sin(x);
else:
y = np.cos(x);
plt.plot(x,y);
plt.show();
| null | Plot.py | Plot.py | py | 246 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.linspace",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.sin",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number":... |
613674333 | import argparse
import numpy as np
import os
import time
import torch
import torch.utils.data
import torch.nn as nn
import torch.optim as optim
from torch.utils.data.dataset import Dataset
from torch.autograd import Variable
import torch_dataset_cancer
from torch.nn import functional as F
import constants
class Encode... | null | torch_vae_gan_copy_model.py | torch_vae_gan_copy_model.py | py | 5,855 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torch_dataset_cancer.n_input_layer",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": ... |
467634302 | """
HN Frontpage Parser
===================
Description:
parse hn front page and collect's titles, links, comment links and votes
Dependency:
requests
bs4
pandas
Output:
a csv file containing the column: title, link, comment, vote
"""
import requests
from bs4 import ... | null | hacker_scraper.py | hacker_scraper.py | py | 1,946 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 23,
"usage_type": "call"
}
] |
219613408 | import scrapy
from zhihudaily.items import ZhihudailyItem
import pymongo
class zhihudailyconSpider(scrapy.Spider):
name = 'zhihudaily_getcont'
allowed_domains = ['zhihu.com']
'''通过查询数据库获得URL地址,返回生成start_urls'''
# 第一稿:所有参数固定不接受入参和调整
# 获取目标数据库以及表
tar_client = pymongo.MongoClient(host=... | null | Playground/Python/Scrapy/zhihudaily/zhihudaily/spiders/zhihudaily_getcont.py | zhihudaily_getcont.py | py | 1,905 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scrapy.Spider",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "zhihudaily.items.ZhihudailyItem",
"line_number": 26,
"usage_type": "call"
}
] |
478963039 | #
# Copyright 2020-2023 -Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... | null | tests/utils.py | utils.py | py | 17,224 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "pytest.raises",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "contextlib.contextmanager",
"line_number": 55,
"usage_type": "name"
},
{
"api_name": "uuid.uui... |
54804937 | #!/usr/bin/env python3
#Time-stamp: <2017-06-11 19:17:43 hamada>
import argparse
import numpy as np
import cv2
from datetime import datetime
import mkdir
def put_text(image, text):
font_size = 1.0
font_type = cv2.FONT_HERSHEY_PLAIN
font_color = (0xf, 0xf, 0xff)
cv2.putText(image, text, (440, 15), font_... | null | src/pycam.py | pycam.py | py | 1,652 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.FONT_HERSHEY_PLAIN",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "cv2.putText",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.V... |
328913119 | #!/usr/bin/python3
import re
import sys
import shutil
import zipfile
import os.path
import tempfile
import urllib.request
from subprocess import run
c_prj_name = re.compile(r'^[a-z\-]+$')
def cmd_exists(cmd):
return shutil.which(cmd) != ''
def call_new(name):
assert c_prj_name.match(name), '' \
'In... | null | fvsd.py | fvsd.py | py | 1,813 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.compile",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "shutil.which",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "urllib.request.request.urlretrieve",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "urllib.req... |
374465183 | import os
import time
import shlex
import subprocess as sp
import multiprocessing as mp
from . import blender
from . import freesurfer
from .db import surfs
def init_subject(subject, filename):
cmd = "recon-all -i {fname} -s {subj}".format(subj=subject, fname=filename)
sp.call(shlex.split(cmd))
freesurfer... | null | cortex/segment.py | segment.py | py | 3,174 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "subprocess.call",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "shlex.split",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "subprocess.call",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "shlex.split",
"line_n... |
237609877 | from flask import json, url_for
from annotator.app import app, setup_app
from annotator.model import Annotation
from annotator.model.couch import rebuild_db, Metadata
def setup():
setup_app()
class TestStore():
def setup(self):
app.config['AUTH_ON'] = False
assert app.config['MOUNTPOINT'] == ... | null | tests/annotator/test_store.py | test_store.py | py | 9,006 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "annotator.app.setup_app",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "annotator.app.app.config",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "annotator.app.app",
"line_number": 12,
"usage_type": "name"
},
{
"api_name":... |
139709414 | from collections import OrderedDict
import numpy as np
import pytest
import unittest
import torchup
import torch
import torch.nn as nn
import torch.optim as optim
from torchup.models import (DQNModel, DDPGActorModel, DDPGCriticModel)
from torchup.agents.agent_base import (BaseAgent, BaseActorCriticAgent)
from torchup.r... | null | tests/test_agent.py | test_agent.py | py | 13,804 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "unittest.TestCase",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torchup.models.DQNModel",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "torch.nn",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "torch.op... |
629092773 | import sys
import requests
import time
def get_initial_port(ip):
# Quick and dirty parsing
r = requests.get(f'http://{ip}:3010')
t = r.text.split('id="onPort">')[1]
t = t.split("</a>")[0]
return int(t)
ip = "10.10.56.89"
print("Waiting for port 1337...")
port = get_initial_port(ip)
while port != 1337:
port = g... | null | tryhackme/scriptme/ape.py | ape.py | py | 1,133 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 5... |
65675410 | from flask import Flask, request, redirect, url_for, flash, jsonify
import numpy as np
import pickle as p
import json
from numpy.lib.function_base import vectorize
app = Flask("Job Title Rest_API")
@app.route('/job_title_api/', methods=['POST'])
def makecalc():
data = request.get_json()
job_title_vect = ve... | null | Ahmed Mohamed Abd ElGhani_IndustryClassificationTask/01_Code/rest_API.py | rest_API.py | py | 715 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "flask.jsonify",
"... |
69709139 | # -*- encoding: utf-8 -*-
import requests
from datetime import datetime, timezone
import random
from darksky import forecast as ds_forecast
from geopy.geocoders import Nominatim
from dateutil import parser as date_parser
import pytz
import json
class slt:
def __init__(self, slotTuple):
self.key = slotTupl... | null | weather.py | weather.py | py | 10,573 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.loads",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "geo... |
452273187 | import os
import pickle
import imageio
import numpy as np
import pandas as pd
from sklearn.utils import shuffle
from nltk.corpus import stopwords
from skimage.color import rgb2gray
from collections import defaultdict
from sklearn.preprocessing import MinMaxScaler, StandardScaler
from sklearn.model_selection import tr... | null | code/util.py | util.py | py | 25,602 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 90,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
525524282 | import fast_adaptation_embedding.env
import fast_adaptation_embedding.models.embedding_nn as nn_model
from fast_adaptation_embedding.models.ffnn import FFNN_Ensemble_Model
from fast_adaptation_embedding.controllers.cem import CEM_opt
from fast_adaptation_embedding.controllers.random_shooting import RS_opt
from fast_a... | null | fast_adaptation_embedding/exp/arm_env_adaptation.py | arm_env_adaptation.py | py | 14,633 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.concatenate",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.norm",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"l... |
441911159 | #!/usr/bin/env python
"""
Script fills a base PDF with 20 pictures at the right locations
Reusability small
features:
read, change and save a PDF with PyPDF2
The Image module of the PIL library to work with pictures
"""
from PyPDF2 import PdfFileWriter, PdfFileReader
from reportlab.pdfge... | null | Polyglot/Python/assokoto_pdf_generator.py | assokoto_pdf_generator.py | py | 5,867 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PIL.Image.open",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 54,
"usage_type": "name"
},
{
"api_name": "numpy.sum",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "numpy.hstack",
"line_number": ... |
322442982 | # Copyright 2018 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... | null | mlrun/artifacts/dataset.py | dataset.py | py | 9,201 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "base.Artifact",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "base.Artifact._dict_fields",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "base.Artifact",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "pathlib.P... |
495527421 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Script to add propertysheets
# bin/instance run opengever.maintenance/opengever/maintenance/scripts/add_propertysheets.py -j opengever.maintenance/opengever/maintenance/scripts/example_propertysheets.json
#
# -D option clears propertysheet storage completly
from opengev... | null | opengever/maintenance/scripts/add_propertysheets.py | add_propertysheets.py | py | 3,343 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "logging.StreamHandler",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "logging.root.... |
108479907 |
import unittest
from phloem.loaders.mysql import MySQLLoader
import logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
class TestMySQLLoader(unittest.TestCase):
def test_mysql_loader(self):
"""
Test the mysql loader
"""
try:
MySQLLo... | null | src/phloem/loaders/test/test_mysql.py | test_mysql.py | py | 523 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "unittest.TestCa... |
391430057 | import find_mxnet
import mxnet as mx
import os,sys
import argparse
# train_model haven't been finished yet
import train_model
def get_iterator(data_shape):
def get_iterator_impl(args,kv):
data_dir = args.data_dir
flat = False if len(data_shape)==3 else True
train = mx.io.ImageRec... | null | AFEW_recognition_existed_model_AlexNet/AFEW_classification.py | AFEW_classification.py | py | 5,231 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "mxnet.io.ImageRecordIter",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "mxnet.io",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "mxnet.io.ImageRecordIter",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "mxnet... |
340031357 | # encoding: utf-8
import os
from pyquery import PyQuery as pq
from floo_powder.add_cls_cluster import add_clusters
from floo_powder.load_n_save import load_data, save_data
from floo_powder.contents_trans import contents_trans
def add_js_files(db_name: str, ref: str, path_htm: str, js_to_add: str):
htm_data = l... | null | floo_powder/html_process.py | html_process.py | py | 1,000 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "floo_powder.load_n_save.load_data",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pyquery.PyQuery",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "floo_powder.add_cls_cluster.add_clusters",
"line_number": 17,
"usage_type": "call"
},... |
139682 | from enum import Enum
from threading import Condition
from typing import Dict # noqa
from typing import cast, List
from ymmsl import Port, Reference
class _InstanceStatus(Enum):
EXPECTED = 0,
REGISTERED = 1,
DEREGISTERED = 2
class InstanceRegistry:
"""Keeps track of running instances.
The Ins... | null | libmuscle/python/libmuscle/manager/instance_registry.py | instance_registry.py | py | 3,609 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "enum.Enum",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "threading.Condition",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "ymmsl.Reference",
"line_... |
620930582 | from django import forms
from django.forms import ModelForm
from .models import Evento
#Se requiere modificar este form
class EventoForm(ModelForm):
class Meta:
model = Evento
fields = [
'NombreEvent',
'FechaEvent',
'EventInicio',
'EventTermino',
'LocalAdmin',
'Direccion',
]
labels={
'Nomb... | null | Proyecto -As You Wish (All Version)/ProyectosUNAB (v1.2)/AsYouWish/Base_Evento/forms.py | forms.py | py | 834 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "models.Evento",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.forms.TextInput",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "django.form... |
545767886 | import os
import cv2
import numpy as np
from lib.misc import *
from lib.filter import *
from lib.histogram import *
class Solver:
def __init__(self, imori_path, imori_noise_path, imori_dark_path, imori_gamma_path):
assert os.path.exists(imori_path), f"No such file exists: '{imori_path}'"
ass... | null | Gasyori100/solver.py | solver.py | py | 5,418 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.exists",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
593999444 | from django.conf.urls import url
import views
app_name = 'proxies_service'
urlpatterns = [
url(r'^$', views.test, name='index'),
url(r'^getProxies/$', views.getProxies, name='proxies'),
url(r'^getParsers/$', views.getParsers, name='parsers')
] | null | delasport/proxies_service/urls.py | urls.py | py | 257 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.test",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "views.getProxi... |
229160543 | import cv2
import numpy as np
import pytesseract
import matplotlib.pyplot as plt
import pyte
pytesseract.pytesseract.tesseract_cmd=r'C:\\Program Files (x86)\\Tesseract-OCR\\tesseract.exe'
font_scale=1.5
font=cv2.FONT_HERSHEY_PLAIN
cap=cv2.VideoCapture(0)
if not cap.isOpened():
cap=cv2.VideoCapture(0)
if not ... | null | NLP/Text_Detection/main_Video.py | main_Video.py | py | 1,164 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pytesseract.pytesseract",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cv2.FONT_HERSHEY_PLAIN",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 13,
"usage_type": "call"
},
{
"api_name... |
104535377 |
"""
Given an array which consists of non-negative integers and an integer m, you can split the array into m non-empty continuous subarrays. Write an algorithm to minimize the largest sum among these m subarrays.
Note:
If n is the length of array, assume the following constraints are satisfied:
1 ≤ n ≤ 1000
1 ≤ m ≤ m... | null | LeetcodeNew/python/LC_410.py | LC_410.py | py | 3,736 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "functools.lru_cache",
"line_number": 43,
"usage_type": "call"
}
] |
525308785 | from discord.ext import commands
from discord.utils import get
import json, time, discord, os, asyncio
class Warn:
"""Warns a user"""
def __init__(self, bot):
self.bot = bot
self.channel = 369662065469685760 # Replace with the channel id we want to log the warn to
self.path =... | null | warn.py | warn.py | py | 4,853 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "discord.Member",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "discord.Embed",
"line_num... |
290635811 | import cv2
import sys
import numpy as np
from matplotlib import pyplot as plt
def detect_jpg(img):
pass
def detect_bmp(img):
for x in xrange(img.shape[0]):
for y in xrange(img.shape[1]):
blue_brightness = 255 * (img[x, y, 0] & 1)
img[x, y] = [blue_brightness, blue_brightness,... | null | detector.py | detector.py | py | 594 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.imread",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "cv2.imshow",
"line_number"... |
35323045 | from util import event_folders
from pathlib import Path
from matplotlib import pyplot as plt
from sklearn.model_selection import train_test_split
from tensorflow import keras
from sklearn.preprocessing import LabelEncoder
import numpy as np
from keras.utils import to_categorical
def get_files(event: Path, cond=None):... | null | merveille/ubuntu/event_classification_case1.py | event_classification_case1.py | py | 3,022 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pathlib.Path",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "readsac.read_sac",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_numbe... |
326857147 |
def getImageVector(img,sw,sh):
import cv2
import numpy as np
# 白い領域(ピクセル値が0でない領域)の座標を集める
nonzero = cv2.findNonZero(img)
# その領域を囲う四角形の座標と大きさを取得
xx, yy, ww, hh = cv2.boundingRect(nonzero)
# 白い領域を含む最小の矩形領域を取得
img_nonzero = img[yy:yy+hh, xx:xx+ww]
# 白い領域を(sw, sh)サイズに縮小するため... | null | python file/webcam_getVector.py | webcam_getVector.py | py | 1,276 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.findNonZero",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.boundingRect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_n... |
5615746 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# ecnet/models/mlp.py
# v.3.0.1
# Developed in 2019 by Travis Kessler <travis.j.kessler@gmail.com>
#
# Contains the "MultilayerPerceptron" (feed-forward neural network) class
#
# Stdlib imports
from re import compile, IGNORECASE
from os import devnull, environ
import sys... | null | ecnet/models/mlp.py | mlp.py | py | 5,821 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.stderr",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.devnull",
"line_number": 19,
"usage_type": "argument"
},
{
"api_name": "sys.stderr",
"line... |
139022948 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from .models import Post, Tagi
from django.shortcuts import render, get_object_or_404
from django.utils import timezone
from django.db.models import Q
def post_list(request):
po... | null | blog/views.py | views.py | py | 3,605 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "models.Post.objects.filter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "models.Post.objects",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "models.Post",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "djang... |
252963662 | import matplotlib
matplotlib.use("TkAgg")
from matplotlib import pyplot
#1. Prepare data
labels = ['ios', 'android', 'web', 'python']
values = [20,15,40,15]
colors = ["red", "blue", 'yellow', 'black']
explode = [0,0,0,0.2]
#2. Plot
pyplot.pie(values, labels = labels, colors = colors, explode= explode)
pyplot.axi... | null | Lab01/c4e-plot.py | c4e-plot.py | py | 354 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.use",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.pie",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "matplotlib.pypl... |
487631247 | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 15 22:07:47 2019
@author: Nataly
"""
#from readimg import read_img
import cv2
import numpy as np
import glob
from skimage.feature import greycomatrix, greycoprops
import skimage.feature
from scipy.stats import kurtosis
import statistics as stats
import pywt
import pywt.d... | null | TODAAS/500x500/DM/color/TransformadaWa.py | TransformadaWa.py | py | 10,160 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.fft.fft2",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.fft",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "numpy.fft.fftshift",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.fft",
"lin... |
530177813 | import os
from sqlalchemy import create_engine, Column, String, Integer, Date, desc
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
engine = create_engine(os.getenv("AIRFLOW__CORE__SQL_ALCHEMY_CONN"), isolation_level="READ UNCOMMITTED")
Session = sessionmaker(bind=engine... | null | python_tutorial/healthcheck/healthcheck_sql.py | healthcheck_sql.py | py | 1,045 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sqlalchem... |
216389243 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "potara",
version = "0.1.0",
author = "Remi Bois",
author_email = "remi.bois@etu.univ-nantes.fr",
description ... | null | setup.py | setup.py | py | 583 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_n... |
243495041 | import os
import pandas as pd
from openSecrets import lobbying
from matplotlib_venn import venn3
import matplotlib.pyplot as plt
from regcomments.dirs import *
orgCommentStringsDF = pd.read_csv(os.path.join(dataDir,'orgs','commentOrgStrings_corpHashComponents.csv'),encoding='utf8')
compustatDF = pd.read_csv(os.path.j... | null | analysis/summarizeCommentLinking.py | summarizeCommentLinking.py | py | 2,374 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_nu... |
106561764 | """Initial migration
Revision ID: 7bc6eb79e09b
Revises:
Create Date: 2020-01-30 16:28:46.130563
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
from sqlalchemy.schema import FetchedValue
# revision identifiers, used by Alembic.
revision = '7bc6eb79e09b'
down_revision =... | null | pryce/database/migrations/versions/7bc6eb79e09b_initial_migration.py | 7bc6eb79e09b_initial_migration.py | py | 6,891 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "alembic.op.create_table",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
170620915 | """
In this script we calculate H_min(AB|XY) for the CHSH game constrained by some
CHSH winning probability.
"""
def ent(SDP):
# Returns the entropy of the computed solution
return -1 * log2(-SDP.dual)
from itertools import product
from math import sqrt, log2
import ncpol2sdpa as ncp
# Global level of NPA ... | null | ncpol2sdpa_chsh_min.py | ncpol2sdpa_chsh_min.py | py | 4,899 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "math.sqrt",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "ncpol2sdpa.generate_measurements",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "ncpol2sdpa.generate_measurements",
"line_number": 37,
"usage_type": "call"
},
{
"api_n... |
245421232 | import numpy as np
import glob
import cv2
import pickle
def camera_calibrate():
# Camera calibration
# prepare object points
nx = 9 # number of inside corners in x
ny = 6 # number of inside corners in y
# prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0)
objp = np.zeros((nx*ny... | null | camera.py | camera.py | py | 2,124 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.zeros",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.mgrid",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "glob.glob",
"line... |
126847967 | import pygame
import math
displayWidth, displayHeight = 800, 600
pygame.init()
screenDisplay = pygame.display.set_mode((displayWidth, displayHeight))
pygame.display.set_caption("we still need a name for our game")
clock = pygame.time.Clock()
islands = {}
drawType = 4
png_test = pygame.image.load("mapAssets/Land/Sand... | null | islandMaker.py | islandMaker.py | py | 1,811 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.s... |
266669820 | # -*- coding: utf-8 -*-
import urllib2, requests
from bs4 import BeautifulSoup
# from tqdm import tqdm
import requests
# url = "http://www.nature.com/nature/podcast/archive.html"
url = "http://www.nature.com/multimedia/podcast/nature/v533/n7603/nature-2016-05-19.mp3"
headers = {'User-Agent': 'Mozilla/5.0 (Macintosh;... | null | nature_podcast.py | nature_podcast.py | py | 1,209 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
}
] |
349618967 | # -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException... | null | Chrome_RFDWeb/test_logina.py | test_logina.py | py | 2,031 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "unittest.TestCase",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "u... |
549938022 | import serial
import random
import time
class serialReader():
def __init__(self, parent, nrOfLines):
self.serialConn = None
self.parent = parent
self.console = parent.consoleController
self.prevStr = ""
self.nrOfLines = nrOfLines
self.prevTime = 0
self.should... | null | V2/serialReader/serialReader.py | serialReader.py | py | 3,940 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "serial.Serial",
"line_number": 19,
"usage_type": "call"
}
] |
302094923 | # -*- coding: utf-8 -*-
import re
import os
import datetime
import shutil
from backup_control.config import config as CONFIG
class BackupPath(object):
def __init__(self, path):
self.path = path
self.size = None
def __repr__(self):
return self.path
def __str__(self):
re... | null | backup_control/core/backup_path.py | backup_path.py | py | 1,748 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.walk",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "os.path.getsize",
"line_number"... |
202538453 | from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def hello(request):
return HttpResponse('<h1>Hola ' + request.method + '</h1>')
def adios(request, parametro):
return HttpResponse('<h1>Adios ' + parametro + '</h1>')
def sumador(request, parametro):
try:
... | null | calc/views.py | views.py | py | 2,120 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.http.HttpResponse",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 18,
"usage_type": "call"
},
{
"api_nam... |
514420778 | import numpy as np
from scipy import interpolate
from constants import *
import matplotlib.pyplot as plt
import random
import stl
from stl import mesh
from stl_gen import STL_Gen
import subprocess as sp
import shutil
from shutil import copyfile, copytree
import sys
import string
import re
import os
import time
import c... | null | optimisation_code/airfoil_Class.py | airfoil_Class.py | py | 18,181 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.zeros",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": ... |
169474346 | from collections import OrderedDict
import numpy as np
import os
import time
from pathlib import Path
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
from cs285.infrastructure.rl_trainer import RL_Trainer
from cs285.agents.bc_agent import BCAgent
from cs285.policies.loaded_gaussian_policy im... | null | hw1/cs285/scripts/hw1_3.py | hw1_3.py | py | 11,570 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pathlib.Path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "cs285.infrastructure.utils.sample_trajectories",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": ... |
537935474 | #!/usr/bin/env python
import os
import sys
import hashlib
import csv
import datetime
import calendar
from datetime import date
"""
Collects preference data from students using a terminal input system.
"""
# TODO: MAYBE, if we have time, put in a Session class that acts instead of
# current_student in Controller. Th... | null | data_collection.py | data_collection.py | py | 19,019 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",... |
123487451 | """
Preprocessing for PAWS wiki_labeled_swap.tar
Preprocessing for PAWS wiki_labeled_final.tar
Convert tar files to tsv files
"""
import csv
import json
def main():
train_swap = []
train_final = []
with open('data/PAWS_train_swap.tsv', 'r', encoding= 'utf8') as tsvfile:
read = csv.reader(tsvfile, delimiter =... | null | preprocessing/PAWS_split.py | PAWS_split.py | py | 1,122 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "csv.reader",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 43,
... |
77344087 | from rest_framework.serializers import ModelSerializer, SlugRelatedField
from django.contrib.auth.models import User
from api.models import Task, Post, UserIcon
class UserIconSerializer(ModelSerializer):
class Meta:
model = UserIcon
fields = ('icon',)
class UserSerializer(ModelSerializer):
... | null | api/serializers.py | serializers.py | py | 1,023 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "api.models.UserIcon",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 13,
"usage_type"... |
604380257 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Support MySQL
"""
import ast
import time
from pymysql import cursors
from pymysql import connect
try:
from . import utility
except ImportError:
import utility
try:
from . import base
except ImportError:
import base
Row = utility.Row
GraceDict = utility... | null | saiorm/MySQL.py | MySQL.py | py | 10,240 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "utility.Row",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "utility.GraceDict",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "base.BaseConnection",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "pymy... |
412648172 | #---------------------------------------------------------------------
# Ensures we have the artifact bucket and zip files needed by our CloudFormation
# Only need to run this when the artifacts change
#---------------------------------------------------------------------
import yaml, os, sys, uuid, tempfile, urllib, ... | null | predeploy_artifacts.py | predeploy_artifacts.py | py | 4,773 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "boto3.client",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19... |
524758205 | from django.conf.urls import url
from . import apis
urlpatterns = [
url(r'^account/login/$', apis.AccountLogin.as_view()),
url(r'^account/logout/$', apis.AccountLogout.as_view()),
url(r'^users/$', apis.UsersResource.as_view(), name="users-resource"),
url(r'^users/(?P<username>\w+)/$', apis.UserDetail... | null | api/urls.py | urls.py | py | 3,937 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.co... |
84026916 | from django.shortcuts import render
from django.views.generic import View
from django.http import HttpResponse, JsonResponse
from django.core import serializers
from schoolclass.models import TClass
from .models import TempStu
from page.index import get_page
import json
# Create your views here.
class GetTempStu(View... | null | temparystudent/views.py | views.py | py | 1,425 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.views.generic.View",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "page.index.get_page",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "models.TempStu",
"line_number": 17,
"usage_type": "argument"
},
{
"api_name": "djan... |
622517824 | import motor.motor_asyncio,asyncio,aiomysql,datetime,time
basicdata = motor.motor_asyncio.AsyncIOMotorClient('mongodb://' + 'basicdata' + ':' + 'luban123*' + '@' + '192.168.3.122' + ':' + '27017'+'/'+'basicdata')
basicdataDB = basicdata['basicdata']
LBUserOperLog = basicdataDB['LBUserOperLog']
CollectionSequence=... | null | bussiness/InsertToLBUserOperLog.py | InsertToLBUserOperLog.py | py | 2,849 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "motor.motor_asyncio.motor_asyncio.AsyncIOMotorClient",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "motor.motor_asyncio.motor_asyncio",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "motor.motor_asyncio",
"line_number": 3,
"usage_... |
353655642 | """
Project: Farnsworth
Authors: Karandeep Singh Nagra and Nader Morshed
"""
from django.db import models
from base.models import UserProfile
from managers.models import Manager
class Petition(models.Model):
""" Petition model. """
title = models.CharField(blank=False,
null=False,
max_length... | null | elections/models.py | models.py | py | 6,338 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.models.Model",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 14,
"usage_type": "call"
},
{
"api_name"... |
617640004 | import csv
import ast
import nested_dict as nd
import matplotlib.pyplot as plt
import numpy as np
file = "transactions_mixed.csv"
file1 = "results_mixed.csv"
transactions = nd.nested_dict()
attacks = nd.nested_dict()
ads = [2634,5422, 8075, 5347, 1083, 5093,4326, 4126, 2836, 5361, 10572,5389, 3599, 9819, 4828, 3474, ... | null | results.py | results.py | py | 3,355 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "nested_dict.nested_dict",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "nested_dict.nested_dict",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "ast.litera... |
241153504 | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# 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 applicab... | null | coltran/test_configs/colorizer.py | colorizer.py | py | 3,044 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ml_collections.ConfigDict",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "ml_collections.ConfigDict",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "ml_collections.ConfigDict",
"line_number": 49,
"usage_type": "call"
},
{
"api... |
511634603 | import argparse
import csv
import pickle
from nltk.tokenize import word_tokenize
import sys
from nltk.corpus import stopwords
from collections import defaultdict
#stopwords = ['is', 'are', 'be', 'does', 'do', 'have', '\'s', 'does', 'was', 'you', 'has', 'come', 'use', 'let', 'make', 'get', 'beef', 'chicken', 'give']
fr... | null | read_data.py | read_data.py | py | 2,965 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pickle.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "collect... |
544389789 | from flask import (
Flask,
render_template,
jsonify,
request,
redirect)
from random import *
import pandas as pd
import movies.movie_prediction as mp
u_cols = ['user_id', 'age', 'sex', 'occupation', 'zip_code', '#_ratings', 'RMSE']
users = pd.read_csv('matrix_factorization/user_data.csv'... | null | movies/app.py | app.py | py | 3,427 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "flask.request",... |
201485867 | import pygame
screen = pygame.display.set_mode([800,600])
#programming is in American english lol
# color = [Red,Green,Blue]
#busy looping because you constantly check for an event
running = True
while running:
event = pygame.event.poll() #asks if anything happened
print(event.type)
if event.type == pyg... | null | don't name it pygame.py | don't name it pygame.py | py | 542 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.display.set_mode",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "pygame.event.poll",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.ev... |
7696887 | import suds
from suds.client import Client
def maq(Ref_act, Ref_nueva, maquina):
client = Client(url='http://srvappswebleo.leonisa.com/Aplicativos_Informaticos/FichaTecnicaTextilService/ConsultasService.svc?wsdl')
request = client.factory.create('tns:GetFichaTejidoPuntoUrdimbr... | null | referencias.py | referencias.py | py | 2,668 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "suds.client.Client",
"line_number": 8,
"usage_type": "call"
}
] |
583105088 | import requests
import json
from datetime import date
import urllib.parse
accuweatherAPIKey = 'ACC-WEATHER-API-KEY'
mapboxToken = 'MAP-BOX-TOKEN'
week_days = ['Domingo', 'Segunda-feira', 'Terça-feira','Quarta-feira', 'Quinta-feira', 'Sexta-feira', 'Sábado']
def getCoord():
r = requests.get('http://www.geoplugin.... | null | weather_app.py | weather_app.py | py | 5,769 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": ... |
357186630 | #!/usr/bin/env python
# Author: Michael Karres
# Date: 02/2017
# Descr: Get tweets for a particular user <arg1>
# Usage: To use this module, create a file called twitter_keys.py and
# store your APP_KEY and APP_SECRET as strings
from twython import Twython
import cPickle
import sys, argparse
sys.dont_wri... | null | getTweets.py | getTweets.py | py | 2,549 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.dont_write_bytecode",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "twython.Twython",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "twitter_keys.APP_KEY",
"line_number": 18,
"usage_type": "argument"
},
{
"api_name": ... |
337576352 | import json
import urllib2
from bs4 import BeautifulSoup
def open_link(url):
f = urllib2.urlopen(url)
html_doc = f.read()
f.close()
return BeautifulSoup(html_doc, 'html.parser')
def open_link_cookies(url, cookies):
f = urllib2.build_opener()
cookies_str = ''
for ... | null | AIIVideogames/vg/scraping/common.py | common.py | py | 767 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "urllib2.urlopen",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "urllib2.build_opener",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSo... |
59992556 | from conans import ConanFile, CMake, tools
from conans.errors import ConanException, ConanInvalidConfiguration
import functools
import os
import yaml
required_conan_version = ">=1.35.0"
class MoltenVKConan(ConanFile):
name = "moltenvk"
description = "MoltenVK is a Vulkan Portability implementation. It " \
... | null | recipes/moltenvk/all/conanfile.py | conanfile.py | py | 5,917 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "conans.ConanFile",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "os.path.isfile",
"line... |
400819627 | from datetime import datetime
from django.conf import settings
from django.contrib.sites.models import Site
def site(request):
"""Adds site wide context variables"""
return {
'site': Site.objects.get_current(),
'now': datetime.now(),
'production': settings.PRODUCTION,
'google_analytics_tracking_id': setting... | null | filbert/context_processors.py | context_processors.py | py | 437 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.sites.models.Site.objects.get_current",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.contrib.sites.models.Site.objects",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.sites.models.Site",
"line_num... |
608698580 | from pymongo import (
MongoClient,
ReturnDocument,
ASCENDING,
DESCENDING,
)
from bson.objectid import ObjectId
from bson.json_util import dumps, RELAXED_JSON_OPTIONS
import json
import os
client = MongoClient(os.environ['MONGODB_URI'])
db = client.get_database()
def get_db_dat... | null | mongo.py | mongo.py | py | 1,912 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pymongo.ASCENDING",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "pymongo.DESCEND... |
46053589 | # Modèle d'échanges ioniques et de régulation dans le globule rouge
# IMPORTATION des bibliothèques Python qui nosu serons utiles par la suite
from scipy.integrate import odeint # Ici on importe seulement la commande odeint (solveur de système d'edo) de la bibliothèque scipy.integrate, car c'est la seule qui nous ... | null | code_sans_sol_tampon.py | code_sans_sol_tampon.py | py | 8,888 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.log",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 59,
... |
424997583 | #!/usr/bin/python
import sys
from bs4 import BeautifulSoup
# from selenium import webdriver
# from selenium.common.exceptions import TimeoutException
import time
import requests
import random
import pandas as pd
import boto3
import botocore
import json
import logging
from datetime import date, datetime, ... | null | 1_data_scraping/archive/indeed-id-scraper.py | indeed-id-scraper.py | py | 3,404 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup"... |
485039613 | from setuptools import setup, Extension
import os
exec(open('openctm/version.py').read())
long_description = ''
if os.path.exists('README.md'):
with open('README.md', 'r') as f:
long_description = f.read()
setup(
name='python-openctm',
version=__version__,
description='Python Interface for th... | null | setup.py | setup.py | py | 1,298 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.exists",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "setuptools.setup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "setuptools.Extension",
... |
65767022 | from controller import app
import os
import logging
if not app.debug and os.environ.get('HEROKU') is None:
from logging.handlers import RotatingFileHandler
file_handler = RotatingFileHandler('pgtc.log', 'a', 1 * 1024 * 1024, 10)
file_handler.setLevel(logging.INFO)
file_handler.setFormatter(
lo... | null | app/__init__.py | __init__.py | py | 854 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "controller.app.debug",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "controller.app",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "os.environ.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.