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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
164345902 | # -*- coding: utf-8 -*-
from flask import Flask
from flask import request
from Captcha import Captcha
app = Flask(__name__)
@app.route('/ocr', methods=['GET', 'POST'])
def index():
if request.method == 'POST':
url = request.form['url']
#app.logger.info('url :\n%s', url)
captcha = Captcha(... | null | webapi/api.py | api.py | py | 480 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "flask.request.form... |
502410406 | from functools import wraps
import inspect
from dataclasses import dataclass, field
from typing import Union, Optional, Callable
from numpy import cumsum, min, inf, ndarray, floor
from sklearn.decomposition import PCA, IncrementalPCA
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn.uti... | null | slang/spectrop.py | spectrop.py | py | 29,919 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.hanning",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "numpy.abs",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_numb... |
69113736 | from io import open
import os
import pytest
import requests_mock
from pymws import MWS
@pytest.fixture()
def mws_client():
return MWS(
'US',
access_key_id='ACESSKEY',
secret_key='SECRET',
merchant_id='MERCHANT_ID',
auth_token='amzn.mws.big-fat-token',
)
@pytest.fixt... | null | tests/conftest.py | conftest.py | py | 828 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pymws.MWS",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "requests_mock.Adapter",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"... |
77557154 | #!/usr/bin/env python3
import sys
import nltk
import sqlite3
from operator import itemgetter, attrgetter
from sqlite3 import Error
from nltk.stem.wordnet import WordNetLemmatizer
import utils as uts
def connectionDataBase(data_file_name):
#create a connection to database with file name "data_file_name", if error pr... | null | assignment1/Part4/zone_scorer.py | zone_scorer.py | py | 1,992 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlite3.connect",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sqlite3.Error",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "utils.theMain",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "utils.theMain",
"line... |
486249630 | import pytest
tf = pytest.importorskip("tensorflow")
trt = pytest.importorskip("tensorrt")
uff = pytest.importorskip("uff")
engine_glob = ''
def create_dummy_engine(resourcepath):
global engine_glob
model = tf.placeholder(tf.float32, [None, 28, 28, 1], name='input')
model = tf.layers.conv2d(model, 64,... | null | micropsi_core/tests/test_tensorrt.py | test_tensorrt.py | py | 2,496 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pytest.importorskip",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pytest.importorskip",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pytest.importorskip",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.makedirs"... |
280098911 | #QuadTree.py
from . import Log
import pygame
class QuadTree():
"""This class is used to store gui objects in an efficient way for mouse collision
testing. It might also be used for all objects that just don't need physics"""
MAXELEMENTS = 4
def __init__(self, startCoor, endCoor):
self._partition ... | null | QuadTree.py | QuadTree.py | py | 6,343 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.Rect",
"line_number": 141,
"usage_type": "call"
},
{
"api_name": "pygame.Rect",
"line_number": 147,
"usage_type": "call"
}
] |
97873245 | import math as m
import numpy as np
import pandas as pd
import argparse
import datetime
import scipy.sparse as sps
from scipy.interpolate import interp1d
from sklearn.preprocessing import normalize
import multiprocessing
import itertools as it
parser = argparse.ArgumentParser()
parser.add_argument('--rating_file', ty... | null | main/hybrid_imports/ItemContentBased.py | ItemContentBased.py | py | 33,788 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "... |
549739416 | import gym
from shiva.shiva.envs.Environment import Environment
class GymContinuousEnvironment(Environment):
def __init__(self,environment):
assert False, "Deprecated Environment. Use plain GymEnvironment"
super(GymContinuousEnvironment,self).__init__(environment)
self.env = gym.make(self.e... | null | shiva/archive/GymContinuousEnvironment.py | GymContinuousEnvironment.py | py | 2,359 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "shiva.shiva.envs.Environment.Environment",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "gym.make",
"line_number": 8,
"usage_type": "call"
}
] |
141371214 | # encoding: utf-8
import urllib2
import json
from django.core.exceptions import ObjectDoesNotExist
from django.db import IntegrityError
from django.http import JsonResponse, Http404
from django.views.generic import TemplateView
from django.conf import settings
from .models import Product, Size
class LoadDataView(Tem... | null | test_app/views.py | views.py | py | 3,259 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.views.generic.TemplateView",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "models.Size.objects.get_or_create",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "models.Size.objects",
"line_number": 21,
"usage_type": "attribute"
... |
254225845 | #
# TODO
# Python 3.3
# datetime.timestamp() # the number of seconds from 1970-01-01 UTC
#
# ----------------------------------------------------------------------------------------------------------------------
import bz2
import copy
import datetime
import gzip
import multiprocessing
import os
import ran... | null | src/pram/util.py | util.py | py | 15,050 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.randint",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "random.uniform",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "sqlite3.Row",
"line... |
603456989 | # -*- coding: utf-8 -*-
# created by Venom for Fenomscrapers (updated 7-19-2022)
"""
Fenomscrapers Project
"""
from json import loads as jsloads
import re
from cocoscrapers.modules import client
from cocoscrapers.modules import source_utils
class source:
priority = 2
pack_capable = False
hasMovies = True
hasEpi... | null | script.module.cocoscrapers/lib/cocoscrapers/sources_cocoscrapers/torrents/ytsmx.py | ytsmx.py | py | 2,765 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cocoscrapers.modules.client.request",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "cocoscrapers.modules.client",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 38,
"usage_type": "call"
},
{
"api_na... |
417684930 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r"^orders-requests/$",
views.orders_and_accepted_requests,
name="orders_and_requests"),
url(r"^orders-requests/history/$",
views.orders_and_requests_history,
name="orders_and_requests_history"),
url(r"... | null | django-project/dishes/urls.py | urls.py | py | 2,812 | 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": 9,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.c... |
600686381 | """
salesforce_utils/make_salesforce_datestr.py
Convert a source datestring to Salesforce API-ready datestr ("%Y-%m-%d")
"""
from datetime import datetime
from .constants import SALESFORCE_DATESTRING_FORMAT
def make_salesforce_datestr(source_datestring, source_format):
"""Convert source_datestring in source_for... | null | salesforce_utils/make_salesforce_datestr.py | make_salesforce_datestr.py | py | 1,520 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.today",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "... |
371997084 | """
urls
"""
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.inicio, name=''),
# Inicio
url(r'inicio$', views.inicio, name='inicio'),
# Perfil de Usuario
url(r'perfil/(?P<pk>\d+)$', views.PerfilUpdateView.as_view(), name='perfil'),
url(r'perfil/success_perf... | null | management/urls.py | urls.py | py | 2,441 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.... |
130650392 | #!/usr/bin/python
import wx
class rangka(wx.Frame):
"""
"""
def __init__(self,*args,**kwds):
super(rangka,self).__init__(*args,**kwds)
self.boxsizer = wx.BoxSizer()
self.boxsizer.Orientation = wx.HORIZONTAL
self.boxsizer.SetOrientation(self.boxsizer.Orientation)
pr... | null | GUIExamps/MyGUI/buatgui.py | buatgui.py | py | 577 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "wx.Frame",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "wx.BoxSizer",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "wx.HORIZONTAL",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "wx.Panel",
"line_numb... |
79949842 | import unittest
import mock
from django.conf import settings
from rest_framework import test
from rest_framework import status
from nodeconductor.structure import models as structure_models
from nodeconductor.structure.tests import factories as structure_factories
from . import factories
from .. import utils
class... | null | nodeconductor/logging/tests/test_events.py | test_events.py | py | 4,934 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.test.APITransactionTestCase",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.test",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.NODECONDUCTOR.copy",
"line_number": 17,
"usage_t... |
114172922 | from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from graphene import Int, Boolean, ObjectType, List
from rescape_graphene import DENY
def get_paginator(qs, page_size, page, paginated_type, **kwargs):
"""
Adapted from https://gist.github.com/mbrochh/f92594ab8188393bd83c892ef2af25e6
... | null | rescape_graphene/django_helpers/pagination.py | pagination.py | py | 2,558 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.core.paginator.Paginator",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.core.paginator.PageNotAnInteger",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "django.core.paginator.EmptyPage",
"line_number": 23,
"usage_type":... |
175989796 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 3 16:17:44 2018
@author: sascha
"""
import numpy as np
import matplotlib.pyplot as plt
import time
from matplotlib import animation as anim
from scipy.signal import savgol_filter
import time
class InitConcentration():
def __init__(self, ... | null | DiffusionEq.py | DiffusionEq.py | py | 2,850 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.exp",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.around",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "scipy.signal.savgol_filter",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.diff",
"l... |
458392701 | # Author: Brandon Liang
# Version: 7/22/18
from django.db import models
from django.utils import timezone
from notifications.models import *
def pkgen():
from base64 import b32encode
from hashlib import sha1
from random import random
pk = str(b32encode(sha1(str(random()).encode('utf-8')).dige... | null | clubs/models.py | models.py | py | 2,434 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "base64.b32encode",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "hashlib.sha1",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.db.models.Model",
... |
32454080 | import json, os, ast, re, sys
import unicodedata as ud
from text_utils import remove_stopwords, token_sylabling, is_word
from utils import load_file_with_newline
import urlmarker
# Load all dictionary
dict_path = './Dictionaries'
bi_dict = load_file_with_newline(os.path.join(dict_path, 'bi_gram.txt'))
tri_dict = l... | null | text_preprocessing.py | text_preprocessing.py | py | 3,390 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "utils.load_file_with_newline",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "utils.load_fil... |
641324839 | """Contains plotting code used by the web server."""
from datetime import timedelta
from bokeh.models import (
ColumnDataSource,
CustomJS,
DataRange1d,
Range1d,
Whisker,
LabelSet,
HoverTool,
)
from bokeh.models.formatters import DatetimeTickFormatter
from bokeh.layouts import row, Row
from ... | null | vast_pipeline/plots.py | plots.py | py | 9,539 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "vast_pipeline.models.Source",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "vast_pipeline.models.Measurement.objects.filter",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "vast_pipeline.models.Measurement.objects",
"line_number": 50,
... |
57177900 | from config.experiment_config_lib import ControllerConfig
from sts.topology import MeshTopology
from sts.control_flow import Fuzzer
from sts.input_traces.input_logger import InputLogger
from sts.simulation_state import SimulationConfig
# Use POX as our controller
start_cmd = "./pyretic.py -m p0 pyretic.examples.firewa... | null | fuzz_pyretic_mesh_proactive_firewall_no_close_check_loop/orig_config.py | orig_config.py | py | 1,031 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "config.experiment_config_lib.ControllerConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sts.topology.MeshTopology",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "sts.simulation_state.SimulationConfig",
"line_number": 14,
"usage_... |
604467511 | import requests
from termcolor import colored
import pyfiglet
arttext=pyfiglet.figlet_format('Dad joke Arena')
joke=input('Enter your prefer joke ')
limit=input('How many jokes? ')
welcome=colored(arttext, color='green')
print(welcome)
response = requests.get('https://icanhazdadjoke.com/search',
... | null | jokeappapi.py | jokeappapi.py | py | 738 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pyfiglet.figlet_format",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "termcolor.colored",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
}
] |
459558438 | #coding:utf-8
import re
import requests
from lxml import etree
import aiohttp
import asyncio
from aiohttp.client_exceptions import *
from collections import Iterable
"""
数据:
抖音名人:{
昵称,
抖音id,
分享id,
粉丝数,
关注数,
获赞数,
个性签名,
粉丝列表数据:{
昵称,
抖音id,
分享id,
... | null | douyin.py | douyin.py | py | 8,051 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "aiohttp.ClientTimeout",
"line_number": 90,
"usage_type": "call"
},
{
"api_name": "aiohttp.ClientSession",
"line_number": 91,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 103,
"usage_type": "call"
},
{
"api_name": "lxml.etree.... |
245669531 | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: build/bdist.linux-x86_64/egg/explore/migrations/0006_transfer_language.py
# Compiled at: 2020-05-05 16:46:09
# Size of source mod 2**32: 806 bytes
from django.db ... | null | pycfiles/buzzword-1.4.0-py3.7/0006_transfer_language.cpython-37.py | 0006_transfer_language.cpython-37.py | py | 1,029 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.RunPython",
"line_number": 24,
"usage_type": "call"
},
... |
79407008 | import io
import os
from google.cloud import vision
from google.cloud.vision import types
from google.oauth2 import service_account
from gtts import gTTS
import cv2
from PIL import Image, ImageDraw
import time
import RPi.GPIO as gpio
import threading
gpio.setmode(gpio.BOARD)
num_people = 0
output... | null | thirdeye.py | thirdeye.py | py | 8,243 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "RPi.GPIO.setmode",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "RPi.GPIO.BOARD",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_... |
484432713 | # Copyright (C) Red Hat Inc.
#
# autocloudreporter is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# This program is distributed in t... | null | pypi_install_script/wikitcms-2.5.1.tar/setup.py | setup.py | py | 2,405 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "setuptools.command.test.test",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "setuptools.command.test.test.initialize_options",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "setuptools.command.test.test",
"line_number": 29,
"usage_typ... |
308545853 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import sigmoid, optim
from random import shuffle
import os, engine
from time import time
from uuid import uuid1
class Engine(nn.Module):
'''
Engine - an engine for predicting the probability that white wins a
chess game, given a... | null | engine/torch_net.py | torch_net.py | py | 3,574 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
258378647 | import os
from dotenv import load_dotenv
from sitesearch.sites.redis_labs import DOCS_PROD, DOCS_STAGING
load_dotenv()
ENV = os.environ.get('ENV')
IS_DEV = ENV in ('development', 'test')
class Config:
def __init__(self):
if IS_DEV :
self.sites = [DOCS_STAGING]
self.default_sear... | null | sitesearch/config.py | config.py | py | 441 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sitesearch.sites.redis... |
503432115 | from __future__ import annotations
import typing
import aiohttp
import enum
from typing import List, Union, Optional
from .user import User
from pycordia import api
class Emoji:
"""Represents server specific emojis."""
def __init__(self, data: dict):
self.emoji_id = data.get("id")
self.name = ... | null | pycordia/models/guild.py | guild.py | py | 10,072 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "user.User",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "user.User",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 51... |
70048529 | import sublime
import sublime_plugin
try:
from typing import Any, List, Dict, Tuple, Callable, Optional
assert Any and List and Dict and Tuple and Callable and Optional
except ImportError:
pass
from .core.protocol import Request
from .core.events import global_events
from .core.settings import settings, c... | null | plugin/completion.py | completion.py | py | 8,206 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.Any",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 6,
... |
366196794 |
import numpy as np
import theano
from collections import OrderedDict
from theano import config
floatX = config.floatX
def ortho_weight(ndim):
"""
Random orthogonal weights, we take
the right matrix in the SVD.
Remember in SVD, u has the same # rows as W
and v has the same # of cols as W. So we
are ensuring tha... | null | Code/initializations.py | initializations.py | py | 2,479 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "theano.config.floatX",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "theano.config",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "numpy.random.randn",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.random... |
184177779 | #pip install spotipy
#pip install pynput
import sys
import spotipy
import spotipy.util as util
from pynput.keyboard import Key, Controller
keyboard = Controller()
import time
import webbrowser
import os
import json
#webbrowser.open("https://open.spotify.com/", new=1, autoraise=True)
scope = 'user-read-currently-play... | null | spotipy_ad_muter.py | spotipy_ad_muter.py | py | 2,102 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pynput.keyboard.Controller",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "spotipy.util.prompt_for_user_token",
"line_number": 25,
"usage_type": "call"
},
{
"api_name":... |
364707069 | import re
from peprrefdata.refgeo.models import Country, Airport
from peprrefdata import get_or_none, asciiname
from peprrefdata.autocomplete.ambiguous import disambiguate
from peprrefdata import alternate_names_list, getCityOrAirportCountryName
from peprrefdata import VALID_LANGUAGES, PSEUDO_LANG
import logging
lg = ... | null | peprrefdata/autocomplete/objects.py | objects.py | py | 5,568 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "peprrefdata.get_or_none",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "peprrefdata.getCity... |
300011979 | #!/usr/bin/python3
from copy import deepcopy
import pytest
from brownie import accounts, Wei
from brownie.project import build
from brownie.network.contract import Contract, ContractCall, ContractTx, OverloadedMethod
def test_namespace_collision():
b = deepcopy(build.get('Token'))
b['abi'].append({
... | null | tests/network/contract/test_contract.py | test_contract.py | py | 2,517 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "copy.deepcopy",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "brownie.project.build.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "brownie.project.build",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pytest.... |
26380836 | from sqlalchemy import create_engine, Table, MetaData, select, func
from sqlalchemy.orm import sessionmaker
import os
rspw = os.environ['RUNESTONEPW']
localengine = create_engine('postgresql://millbr02@localhost/runestoneanalysis')
remoteengine = create_engine('postgresql://bnmnetp_courselib:{}@web407.webfaction.com/... | null | scripts/nightlytransfer.py | nightlytransfer.py | py | 1,651 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.environ",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sqlalc... |
348719444 | """
EECS 445 - Introduction to Machine Learning
Fall 2018 - Project 2
Utility functions
"""
import os
import numpy as np
# import matplotlib.pyplot as plt
from sklearn import metrics
import trainer
from sklearn.utils import resample
import scipy
from matplotlib import pyplot as plt
def config(attr):
"""
Ret... | null | utils.py | utils.py | py | 15,578 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.max",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.ioff",
"line_numb... |
104482033 | import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap as lcm
from matplotlib.colors import hex2color as h2c
def plot(data):
plt.imshow(data, interpolation='none',
cmap = lcm(['white', #h2c('#ffffff'),
'skyblue','orange',
'green', 'red',
'... | null | CI/Bionts/tools.py | tools.py | py | 1,013 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.imshow",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "matplotlib.colors.ListedColormap",
"line_number": 7,
"usage_type": "call"
},
{
"api_name... |
88461148 | import matplotlib.pyplot as plt
import math, random, time
import kmp as kmp
import brute_pattern as bp
import numpy as np
def kmp_time(pat,txt):
start = time.clock()
kmp.KMPSearch(pat,txt)
end = time.clock()
result = end - start
return result
def brute_time():
start = time.clock()
bp.brute_pattern(pat,txt)
... | null | Estructura Avanzada/labo04/lab04_kmp_best_worst.py | lab04_kmp_best_worst.py | py | 1,731 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.clock",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "kmp.KMPSearch",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "time.clock",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "time.clock",
"line_number": 1... |
290002470 | # uncompyle6 version 3.7.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: build/bdist.linux-x86_64/egg/galaxy/util/image_util.py
# Compiled at: 2018-04-20 03:19:42
"""Provides utilities for working with image files."""
from __future__ ... | null | pycfiles/galaxy_lib-19.5.2-py2.7/image_util.py | image_util.py | py | 1,015 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PIL.Image",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_numb... |
249481377 | import argparse
from sys import stdout
from time import sleep
def fibonacci(n):
if n == 0:
return 0
if n == 1:
return 1
return fibonacci(n - 1) + fibonacci(n - 2)
def gen_fib():
yield 0
yield 1
a, b = 0, 1
while True:
yield a + b
# Mmmm... Python magic to ... | null | Numbers/fibonacci.py | fibonacci.py | py | 1,487 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.stdout.write",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "sys.stdout.flush",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_n... |
217560502 | from __future__ import absolute_import
try:
from six.moves import cPickle as pickle
except:
import pickle
from tblib import pickling_support
import time
from multiprocessing.pool import ThreadPool
pickling_support.install()
from pywren.future import JobState
import pywren.storage as storage
import pywren.wren... | null | pywren/wait.py | wait.py | py | 3,388 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tblib.pickling_support.install",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tblib.pickling_support",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "time... |
138481447 | import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits.axes_grid1
pi = np.pi
def subplot_colorbar(im, axes, **kwargs):
"""Adds colorbar to subplot."""
cax = (mpl_toolkits.axes_grid1.make_axes_locatable(axes)
.append_axes("right", size="5%", pad=0.05))
plt.colorbar(im, cax=cax... | null | grftools/plotting.py | plotting.py | py | 3,369 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.pi",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "mpl_toolkits.axes_grid1.axes_grid1.make_axes_locatable",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "mpl_toolkits.axes_grid1.axes_grid1",
"line_number": 11,
"usage_type":... |
212774769 | #!/usr/bin/python3
#######################################################
### Autor: Nico Hartung <nicohartung1@googlemail.com> #
### Modified by: Philippe Renault, Date: 20.08.2020 #
### Improvements: #
### - adapted for Synology NAS with pyMySQL, Python3 #
### - modified to use SvgLib+ReportLab to crea... | null | Server/cron_kindle-weather.py | cron_kindle-weather.py | py | 22,777 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "locale.setlocale",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "locale.LC_TIME",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "logging.INFO... |
340892027 | import wx
import guiManager
class MainAPP(wx.App):
def OnInit(self):
self.manager = guiManager.GUIManager(self.UpdateUI)
"""create login frame"""
self.frame = self.manager.GetFrame(0)
self.frame.Show(True)
return True
def UpdateUI(self, type, sid):
self.frame.Close()
self.frame = self.... | null | source/Automate Statistics.py | Automate Statistics.py | py | 463 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "wx.App",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "guiManager.GUIManager",
"line_number": 7,
"usage_type": "call"
}
] |
367763984 |
# coding: utf-8
# # Explore ERDDAP timeseries data using Jupyter Widgets
# Inspired by [Jason Grout's excellent ESIP Tech Dive talk on "Jupyter Widgets"](https://youtu.be/CVcrTRQkTxo?t=2596), this notebook uses the `ipyleaflet` and `bqplot` widgets
# to interactively explore the last two weeks of time series data fro... | null | ERDDAP_timeseries_explorer.py | ERDDAP_timeseries_explorer.py | py | 13,395 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pendulum.parse",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "pendulum.parse",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "pendulum.parse",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "pendulum.parse",
"li... |
344529718 | from xml.etree.ElementTree import SubElement
def do_funding(poa_article):
return bool(poa_article.funding_awards)
def set_fundref(parent, poa_article):
"""
Set the fundref data from the article funding_awards list
"""
if do_funding(poa_article):
fr_program_tag = SubElement(parent, "fr:pr... | null | elifecrossref/funding.py | funding.py | py | 1,665 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "xml.etree.ElementTree.SubElement",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.SubElement",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.SubElement",
"line_number": 31,
"usage_type": "ca... |
448818948 | # -*- coding: utf-8 -*-
'''
Черновой вариант решения задачи конкурса http://mlbootcamp.ru/round/12/tasks/
Классификатор - нейросетка на Keras.
Неочищенные данные.
При сабмите дает примерно 0.5447
(c) Козиев Илья inkoziev@gmail.com
'''
import os
import pandas as pd
import numpy as np
import codecs
from sklearn.preproce... | null | nn_baseline.py | nn_baseline.py | py | 3,673 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "codecs.open",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
81454171 | import numpy as np
import pandas as pd
import math, os
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from scipy.optimize import curve_fit
from collections import defaultdict
plt.style.use('seaborn-whitegrid')
from scipy import stats
from sklearn.impute import SimpleImputer
def read_dataset(file):... | null | src/main.py | main.py | py | 14,118 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 8,
"usage_type": "name"
},
{
"api_name"... |
468156222 | import discord
import discord.ext.commands as commands
from unibot.bot import Bot
from unibot.errors import UserError
class VerificationCog(commands.Cog):
def __init__(self, bot: Bot):
self.bot = bot
self.config = bot.config['cogs']['verification']
@commands.command()
async def verify(sel... | null | unibot/cogs/verification.py | verification.py | py | 1,198 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "unibot.bot.Bot",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "discor... |
99612211 | """
simplesnake.py - by Brendan Wilby 12/09/2019
A stripped down, first version of Snake written entirely in the main function.
"""
import pygame
import random
game_size = ((400, 400))
score_header_height = 100
grid_width = 25
cell_size = game_size[0] / grid_width
BLACK = ((0, 0, 0))
WHITE = ((255, 255, 255))
RED ... | null | Snake/python/simplesnake.py | simplesnake.py | py | 3,714 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.init",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "pygame.displa... |
169755344 | """
tests.py
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
from rest_framework.test import APIRequestFactory
from .utils import MovieTestData
from .views import MovieListByYearView, MovieListByGenreView
class MovieTest(TestCase):
"""
Movie Test
"""
... | null | api/tests.py | tests.py | py | 1,799 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.test.TestCase",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "rest_framework.test.APIRequestFactory",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "utils.MovieTestData.generate_data",
"line_number": 23,
"usage_type": "call"
... |
52418956 | # -*- coding: utf-8 -*-
import json
import inspect
import logging
try:
from html import unescape
except ImportError:
unescape = None
try:
from html.parser import HTMLParser
except ImportError:
from HTMLParser import HTMLParser
import six
import cherrypy
from cherrypy._cptools import HandlerWrapperToo... | null | exe/api/utils.py | utils.py | py | 3,659 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "html.unescape",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "cherrypy.request.params.has_key",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "cherr... |
161701575 | import numpy as np
import redis
import math
import numpy as np
import copy
import collections as col
import os
import subprocess
import time
import signal
from numpy import linalg as la
from datetime import datetime
from numpy import linalg as ln
class PcarsEnv:
default_speed = 50
speed_ok = False
initial... | null | utils/gym_pcars.py | gym_pcars.py | py | 17,590 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "redis.StrictRedis",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_numbe... |
653863041 | import webcam as wc
import API_Requests as r
import audio_test as at
import time
import json
import shutil
total_emotion = [0 for _ in range(7)]
total_emotion = {'sadness': 0, 'neutral': 0, 'disgust': 0, 'anger': 0, 'surprise': 0, 'fear': 0, 'happiness': 0}
total_count = 0
def start():
pic_location = 't... | null | main.py | main.py | py | 1,866 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "webcam.setup",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "audio_test.make_recording",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "webcam.single_picture",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "time.sle... |
281499610 | __author__ = "Kolay.Ne"
import requests
import atexit
from bs4 import BeautifulSoup
from time import time
from selenium import webdriver
from random import randint
from sys import stderr
from threading import Lock
class WikiArtAPI:
def __init__(self):
opts = webdriver.chrome.options.Options()
opts... | null | wikiart.py | wikiart.py | py | 4,290 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.chrome",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver",
"line_number": 14,
"usage_type": "name"
}... |
70598165 | import os
from shutil import copyfile
import torch
import torch.nn as nn
from copy import deepcopy
from collections import Counter, OrderedDict
from models.networks import model_val
class BaseModel():
def __init__(self, opt):
self.opt = opt
# self.device = torch.device('cuda' if opt['gpu_ids'] is ... | null | codes/models/base_model.py | base_model.py | py | 17,588 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.cuda.current_device",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.cuda.empty_cache",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torc... |
61625586 | # -*- coding: cp1252 -*-
# /usr/bin/env python
# Simon H. Larsen
# Buttons.py - example
# Project startet: d. 28. august 2012
# Import pygame modules and Buttons.py(it must be in same dir)
import pygame, Buttons
import sys
from pygame.locals import *
import os
# Initialize pygame
pygame.init()
music = 'music.mp3'
py... | null | Snake.py | Snake.py | py | 1,851 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.init",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.mixer.init",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pygame.mixer.music.lo... |
588385943 | from sklearn.model_selection import GridSearchCV
from Ensemble.PredictorModel import PredictorModel
class Predictor:
"""
Class for one predictor
"""
def __init__(self, name):
self.name = name
self.model = PredictorModel.get_model_by_name(name)
self.fitted_model = None
... | null | Titanic/ensembling/Ensemble/Predictor.py | Predictor.py | py | 787 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "Ensemble.PredictorModel.PredictorModel.get_model_by_name",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "Ensemble.PredictorModel.PredictorModel",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "Ensemble.PredictorModel.PredictorModel.get_parame... |
386126704 | # -*- coding: utf-8 -*-
from collections import defaultdict
import pprint
import re
_re_num = re.compile('\s(?P<num>\d+)\s+(?P<name>(RPL|ERR)_\w+)\s*(?P<_>.*)')
_re_mask = re.compile('^\s{24,25}(?P<_>("(<|:).*|\S.*"$))')
def main():
item = None
items = []
out = open('irc3/_rfc.py', 'w')
with open('... | null | irc3/_parse_rfc.py | _parse_rfc.py | py | 3,242 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.compile",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_nu... |
498258070 | """
Code to load pianoroll data (.pickle)
"""
import numpy as np
import os
from sklearn.externals import joblib
from numpy import array, arange, vstack, reshape, loadtxt, zeros
try:
# Python 3
import _pickle as cPickle
except:
# Python 2
import cPickle
try:
# Python 2
range
except:
# P... | null | vaelstmpredictor/utils/data_utils.py | data_utils.py | py | 11,037 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.where",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "numpy.vstack",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number"... |
283675888 | # -*- coding: utf-8 -*-
import re
import json
import os
from lxml import etree
import requests
import click
from urllib import parse
import time
from hashlib import md5
import random
from utils import ctx
headers = { "Origin": "https://www.instagram.com/",
"Referer": "https://www.instagram.com/",
... | null | itv2.py | itv2.py | py | 6,680 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.compile",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "re.MULTILINE",
"line_number": 48,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "requests.session",
"lin... |
502297478 | from bs4 import BeautifulSoup
import requests
import xlsxwriter
headers = {
'Content-Type': 'application/json; charset=UTF-8',
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36'
}
div_class_name = 'col-xs-4 col-sm-4 col-md-4 c... | null | 123.py | 123.py | py | 2,258 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"... |
334862255 | from django.shortcuts import render
from .forms import PostForm
from .models import Image
from account.models import Observation
from django.contrib.auth.models import User
# Create your views here.
def index(request):
all_users = User.objects.all()
observed_users = []
for object in all_users:
if... | null | board/views.py | views.py | py | 1,169 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.auth.models.User.objects.all",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User.objects",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.auth.models.User",
"line_number": 10,... |
104135884 | import shutil
import os
import jieba
import jieba.posseg as pseg
import os
import sys
from sklearn import feature_extraction
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.feature_extraction.text import CountVectorizer
def test1():
corpus = ["我 来到 北京 清华大学", # 第一类文本切词后的结果,词之间以空格隔开
... | null | Data/normal/white-list/jsp_move.py | jsp_move.py | py | 2,314 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sklearn.feature_extraction.text.CountVectorizer",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_extraction.text.TfidfTransformer",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 30,
"usage_ty... |
137218363 | #!/usr/bin/env python
"""
Set geospatial metadata on a Girder item for an OBJ file.
Requires information from 3 files:
- The OBJ file.
- A text file containing 3 lines with floating point values that indicate a
global (x, y, z), offset.
- A reference GeoTIFF image in the AOI from which to get the source coordinate
... | null | support/utilities/obj_geometa/obj_geometa.py | obj_geometa.py | py | 6,978 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gdal.Open",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "gdal.GA_ReadOnly",
"line_number": 81,
"usage_type": "attribute"
},
{
"api_name": "osr.SpatialReference",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "pyproj.Proj",
... |
598604871 | """ RUN.py
runfile for robot game project, ludum dare #27
TODO:
* GET MORE SHIT DID
"""
import pygame
import sprites
import sys
import random
from pygame.locals import *
from pygame.key import *
from maps import make_maze, x, y
# CONSTANTS
# dimensions
WIDTH = 968
HEIGHT = 668
SPRITEWIDTH = 32
# colours
WHITE ... | null | run.py | run.py | py | 8,614 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.init",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "maps.make_maze",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_... |
401220545 | from django.shortcuts import render
from django.http import HttpResponse
from django.template import loader
import sqlite3
import json
# Create your views here.
def index(request):
context = {
}
return render(request, 'index.html', context)
def shelf(request):
conn = sqlite3.connect('db.sqlite3... | null | dodam/dodamweb/views.py | views.py | py | 1,287 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.render",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "sqlit... |
421961796 | import json
import logging
from datetime import datetime
from io import BytesIO
import boto3
import pandas as pd
from app import LOG_LEVEL
log = logging.getLogger(__name__)
log.setLevel(LOG_LEVEL)
# noinspection PyTypeChecker
def get_fibi(path):
df = pd.read_excel("data/" + path)
df = df[df.columns[[3, 4, 5, ... | null | helpers.py | helpers.py | py | 3,555 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "app.LOG_LEVEL",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "pandas.read_excel",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
... |
148214539 | #!/usr/bin/env python
# stdlib imports
import os.path
import logging
# third party imports
import numpy as np
from libcomcat.search import get_event_by_id
from impactutils.rupture.tensor import fill_tensor_from_components
# local imports
from strec.slab import SlabCollection
from strec.cmt import getCompositeCMT
fro... | null | strec/subtype.py | subtype.py | py | 20,323 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "strec.gmreg.Regionalizer.load",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "str... |
630589929 | # import urllib.request
# import urllib.parse
# # import urllib2
# pnr_number = input("Enter the pnr number: ")
# url = 'http://www.railyatri.in/pnr-status/' + pnr_number
# # URL test
# # print(url)
# req = urllib.request.Request(url)
# resp = urllib.request.urlopen(req)
# resp_data = resp.read()
#
# print(resp_data)
i... | null | script.py | script.py | py | 1,464 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 17,
"usage_type": "call"
}
] |
416221799 | import re
import urllib3
import charts
def download_url_as_text(url):
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
http = urllib3.PoolManager()
response = http.request("GET", url)
contents = response.data.decode("utf-8")
return contents
def get_counts(words):
# now... | null | word_count.py | word_count.py | py | 2,507 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "urllib3.disable_warnings",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "urllib3.exceptions",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "urllib3.PoolManager",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "re... |
178487489 | import torch
import torch.nn as nn
import numpy as np
import gym
import torch.optim as optim
from torch.autograd import Variable
from torch.distributions import Categorical
from torch.distributions import MultivariateNormal
from tensorboardX import SummaryWriter
torch.manual_seed(0)
class Vnetwork(nn.Module):
def... | null | hw2/policyNetwork.py | policyNetwork.py | py | 7,967 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.manual_seed",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",... |
530685327 | import sys
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('bmh')
cores = [2, 4, 8, 16, 32, 64]
def plot(ax, encore, akka, name):
ax.plot(cores, encore, 'bo-', label="Encore")
ax.plot(cores, akka, 'r^-', label="Akka")
ax.set_title(name)
ax.set_xlabel('#cores', fontsize=16)
ax.set_ylabel('ti... | null | src/tests/stress/savina/plot-scalability.py | plot-scalability.py | py | 2,126 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 5,
"usage_type": "name"
},
{
"api_name"... |
585050837 | import os
import datetime
import time
files = []
path = '/Users/skingaby/anaconda3/pkgs/'
for file in os.listdir(path):
filetype = file[-8:]
if filetype == '.tar.bz2':
tim = datetime.datetime.fromtimestamp(os.path.getctime(path + file))
if tim > datetime.datetime(2019,6, 10):
dict =... | null | InstalledLibraries.py | InstalledLibraries.py | py | 504 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.listdir",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.p... |
552111149 | # Ejercicio5
# imprima el mensaje: "hola mundo!"
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
print("hola mundo!")
# Algo mas
x = np.linspace(0,10,100)
y = np.linspace(0,10,100)
print(x)
print(y)
plt.plot(x,y)
plt.savefig("hola1.pdf")
def oscar(miyagui):
return 500... | null | test.py | test.py | py | 490 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.use",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
... |
281146510 | #!/usr/bin/env python
# Elaine Short
# Dragonbot oculesic controller
import roslib; roslib.load_manifest('dragonbot_python')
import rospy
import actionlib
from dragon_msgs.msg import *
from cordial_sound.msg import *
from cordial_sound.msg import SoundRequest
from cordial_sound.libsoundplay import SoundClient
import... | null | cordial/cordial_speech/scripts/speech.py | speech.py | py | 5,888 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "roslib.load_manifest",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cordial_sound.libsoundplay.SoundClient",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "rospy.sleep",
"line_number": 25,
"usage_type": "call"
},
{
"api_name":... |
103350734 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
import redis
rclient = redis.StrictRedis(host='localhost', port=6379, db=0)
N_KEYS = 32
N_ITEMS_MIN = 0
N_ITEMS_MAX = 32
# create N_KEYS lists
with rclient.pipeline() as rpipe:
# generate list data
for keyi in xrange(0, N_KEYS):
# insert N_ITE... | null | tests/plumd_tests/plugins/readers/redis/gentestdat.py | gentestdat.py | py | 1,466 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "redis.StrictRedis",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "random.randrange",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "random.randrange",
"line_number": 28,
"usage_type": "call"
}
] |
496174083 | from collections import OrderedDict
import settings
from engine import GameScene
from engine import colors
from gui.labels import Label
from gui.menus import Menu
class NavigationMenuScene(GameScene):
"""Show a menu with links to other scenes."""
def __init__(
self,
title: str,
... | null | scenes/navigation_menu_scene.py | navigation_menu_scene.py | py | 1,312 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "engine.GameScene",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "collections.OrderedDict",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "settings.SCREEN_WIDTH",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "s... |
403144572 | import numpy as np
import cv2
import vispy
import vispy.scene
from vispy.scene import visuals
# Video capture
cap = cv2.VideoCapture(0)
# Make a canvas and add simple view
canvas = vispy.scene.SceneCanvas(keys='interactive', show=True)
view = canvas.central_widget.add_view()
# create scatter object
scatter = vis... | null | camvis.py | camvis.py | py | 1,230 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "vispy.scene.SceneCanvas",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "vispy.scene",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "vispy.scene... |
357807559 | # http://rosalind.info/problems/sseq/
def main():
from Bio import SeqIO
strings, result = [], ""
fasta_sequences = SeqIO.parse(open(f"{input('file name here: ')}.txt"), 'fasta')
for fasta in fasta_sequences:
strings.append(str(fasta.seq))
start = 0
for subsequence_pointer in strings[... | null | Rosalind Bioinformatics/Finding a Spliced Motif.py | Finding a Spliced Motif.py | py | 774 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "Bio.SeqIO.parse",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "Bio.SeqIO",
"line_number": 8,
"usage_type": "name"
}
] |
195530209 | '''
Created on Jan 21, 2019
@author: Suraj
'''
import labs.common.ConfigConst as ConfigConst
import labs.common.ConfigUtil as ConfigUtil
import smtplib
from email.mime.text import MIMEText as mimeText
from email.mime.multipart import MIMEMultipart as mimeMultipart
class SmtpClientConnector():
'''
Constru... | null | apps/project/SmtpClientConnector.py | SmtpClientConnector.py | py | 2,547 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "labs.common.ConfigUtil.ConfigUtil",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "labs.common.ConfigUtil",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "labs.common.ConfigConst.SMTP_CLOUD_SECTION",
"line_number": 29,
"usage_type": "a... |
431288042 | __author__ = 'dboyko'
from selenium import webdriver
from ui_map_general import my_credentials
#from pyvirtualdisplay import Display
#display = Display(visible=0, size=(1024, 768))
#display.start()
from event_ilt_classroom import ilt_classroom
from role_setup import logIn_acceptingTest
from TMS_PY.WIP.TMS_FAT.FAT_e... | null | TMS_PY/WIP/TMS_FAT/FAT_event_ilt_classroom/main_event_ilt_classroom.py | main_event_ilt_classroom.py | py | 925 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "ui_map_general.my_credentials",
"line_number": 23,
"usage_type": "call"
},
{
"api_n... |
133616122 | import pysnooper
import os
from collections import defaultdict
import timeit
import PathList
import pysnooper
import json
from os import listdir
from os.path import isfile, join
def word_count():
'''count words of palindrome and anagram respectively'''
dic_palindrome = {}
dic_anagram = {}
#json file... | null | spark-python/rdd/test_updateJSON.py | test_updateJSON.py | py | 4,325 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.listdir",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number"... |
366559900 | #!/usr/bin/env python3
# pip install -U scikit-learn
# pip install matplotlib
# https://github.com/llSourcell/gender_classification_challenge
# C:\Users\gilfm\AppData\Local\Programs\Python\Python35\Scripts\pip
from sklearn import tree
#from sklearn.tree import DecisionTreeClassifier
from sklearn import gaussia... | null | prj/datasci/gender.py | gender.py | py | 1,277 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sklearn.tree.DecisionTreeClassifier",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.tree",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "sklearn.gaussian_process.GaussianProcessClassifier",
"line_number": 13,
"usage_type": "c... |
309121059 | #!/usr/bin/env python
# pylint: disable=unused-wildcard-import
import sys
import logging
import traceback
from unicorn import *
from unicorn.x86_const import *
import shellcode_emulator.utils
logger = logging.getLogger(__name__)
class Hook:
def __init__(self, emulator):
self.Emulator = emulator
... | null | shellcode_emulator/api.py | api.py | py | 8,422 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "traceback.print_exc",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 71,
"usage_type": "attribute"
},
{
"api_name": "traceback.print... |
474391703 | from django_filters import rest_framework as pkg_filters
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import filters
from rest_framework import generics, serializers
from rest_framework.pagination import PageNumberPagination
from hyposoft.utils import get_version
from .serializers... | null | app/hyposoft/system_log/views.py | views.py | py | 3,938 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "models.username",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "models.display_name",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "rest_framework.mixins.CreateModelMixin",
"line_number": 27,
"usage_type": "name"
},
{
"api_na... |
613623084 | import csv
from django.core.management.base import BaseCommand
from django.core.management.base import CommandError
from django.utils.encoding import smart_str
from unit.models import PMA
# Import PMAs from a CSV file. Will update existing records.
# Run:
# python manage.py import_presstanks_from_csv C:\Users\Pete\D... | null | unit/management/commands/import_pmas_from_csv.py | import_pmas_from_csv.py | py | 1,656 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django.core.management.base.CommandError",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 32,
"usage_type": "call"
}... |
481894714 | #coding=utf-8
'''
【TODO】
1.调参
2.扩展模型组合方式
'''
import pandas as pd
import numpy as np
from sklearn.model_selection import StratifiedKFold
from sklearn.model_selection import cross_val_score
from xgboost import XGBClassifier
from lightgbm import LGBMClassifier
from catboost import CatBoostClassifier
from sklearn.linea... | null | src/featureEngineering_stacking.py | featureEngineering_stacking.py | py | 6,998 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_n... |
598987246 | from flask import Blueprint, jsonify, request
from banco import db
from models.modelProduto_pedido import Produto_pedido
from flask_cors import CORS
carrinho = Blueprint('produto_pedido', __name__)
@carrinho.route('/carrinho', methods=['POST'])
def addAll():
for x in request.json:
carrinho = Produto... | null | resources/produto_pedido.py | produto_pedido.py | py | 658 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Blueprint",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.request.json",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "models.modelProd... |
74876849 | import sys
import yaml
import jinja2
import json
from lxml import etree
from jnpr.junos import Device
from jnpr.junos.utils.config import Config
from jnpr.junos.exception import ConnectError
from jnpr.junos.exception import LockError
from jnpr.junos.exception import UnlockError
from jnpr.junos.exception import ConfigLo... | null | TAF/Management/plugins/junos/MyJunos.py | MyJunos.py | py | 6,641 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "jnpr.junos.Device",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "jnpr.junos.utils.config.Config",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "jnpr.junos.exception.ConnectError",
"line_number": 30,
"usage_type": "name"
},
{
... |
544035211 | from ctypes import c_float, cast, POINTER
from contextlib import contextmanager
import numpy as np
import OpenGL.GL as gl
import openvr
from openvr.gl_renderer import OpenVrFramebuffer as OpenVRFramebuffer
from openvr.gl_renderer import matrixForOpenVrMatrix as matrixForOpenVRMatrix
c_float_p = POINTER(c_float)
cla... | null | poolvr/pyopenvr_renderer.py | pyopenvr_renderer.py | py | 6,855 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ctypes.POINTER",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "ctypes.c_float",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "openvr.init",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "openvr.VRApplication_Sc... |
422179055 | import logging
import numpy as np
import pandas as pd
from sklearn.metrics import fbeta_score, precision_score, recall_score, accuracy_score
from sklearn.model_selection import train_test_split
from vadetisweb.parameters import F1_SCORE, PRECISION, RECALL, ACCURACY, NMI, RMSE
from vadetisweb.utils import unix_time_mil... | null | vadetisweb/anomaly_algorithms/detection/helper_functions.py | helper_functions.py | py | 5,530 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "vadetisweb.utils.unix_time_millis_to_dt",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "vadetisweb.utils.next_earlier_dt",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.warning",
"line_number": 16,
"usage_type": "call"
},
... |
267361160 | # import statements
import requests
import re
from bs4 import BeautifulSoup
class Lyrics():
def __init__(self):
# The lyrics website
self.website = "https://www.lyricsmode.com/"
self.website_search = "https://www.lyricsmode.com/search.php?search="
self.songsTable = []
se... | null | app/getSongs.py | getSongs.py | py | 5,518 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "requests.codes",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup"... |
17346360 | #! /usr/bin/python3
import time, argparse
def pinbreak(data="",user=""):
if len(data) < 14:
return "too short pin"
if len(data) > 14:
return "too long"
if len(data) == 14:
number=str(data)
breaker=3
pin=[number[i:i+breaker] for i in range(0,len(number),breaker)]
pinStr=""
delimiter=" "
for chunk in... | null | POS/pinbreak/pinbreak-cli.py | pinbreak-cli.py | py | 801 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.ctime",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 22,
"usage_type": "call"
}
] |
275118357 | '''
Filename: /scratch/gpfs/hgazula/247-project/tfs_pickling.py
Path: /scratch/gpfs/hgazula/247-project
Created Date: Tuesday, December 1st 2020, 8:19:27 pm
Author: Harshvardhan Gazula
Description: Contains code to pickle 247 data
Copyright (c) 2020 Your Company
'''
import os
import pickle
import numpy as np
import p... | null | code/tfspkl_main.py | tfspkl_main.py | py | 10,553 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "pickle.dump",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number"... |
100752408 | import logging
import datetime
import json
import random
from datetime import datetime, timedelta
import holidays
import numpy as np
import pandas as pd
from dispatch.plugins.kandbox_planner.travel_time_plugin import HaversineTravelTime
from dispatch.database import SessionLocal
from dispatch import config
import disp... | null | src/dispatch/plugins/kandbox_planner/data_adapter/kplanner_db_adapter.py | kplanner_db_adapter.py | py | 13,547 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "dispatch.plugins.bases.kandbox_planner.KandboxDataAdapterPlugin",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "dispatch.database.SessionLocal",
"line_number": 50,
"us... |
55474560 | # -*- coding: utf-8 -*-
# FLO-2D Preprocessor tools for QGIS
# Copyright ? 2017 Lutra Consulting for FLO-2D
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, ... | null | flo2d/gui/levee_and_breach_editor_widget.py | levee_and_breach_editor_widget.py | py | 11,618 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ui_utils.load_ui",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "user_communication.UserCommunication",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "ui_utils.set_icon",
"line_number": 38,
"usage_type": "call"
},
{
"api_name"... |
10848701 | # _*_ coding: utf-8 _*_
from bs4 import BeautifulSoup
import requests
pre_html = '''
<!DOCTYPE html>
<html>
<head>
<meta charset = 'utf-8'>
<title>中油油價歷史資料</title>
</head>
<body>
<h2>中油油價歷史資料 ( 取自中油官方網站 ) </h2>
<table width = 600 border = 1>
<tr><th>日期</th><th>92無鉛</th><th>95無鉛</th><th>98無鉛</th></... | null | oil_html.py | oil_html.py | py | 1,125 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 27,
"usage_type": "call"
}
] |
509192445 | import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_moons
import neural_network as nn
np.random.seed(0)
def plot_decision_boundary(pred_func, X, y):
x_min, x_max = X[:, 0].min() - .5, X[:, 0].max() + .5
y_min, y_max = X[:, 1].min() - .5, X[:, 1].max() + .5
h = .0... | null | machine_learning/project3/test.py | test.py | py | 1,112 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.random.seed",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "numpy.meshgrid",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.