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
237691954
from copy import deepcopy from typing import Dict, List, Set, Sequence, Union, Optional from NondeterministicFiniteStateMachine import NFA, StatesType as NfaStatesType from DeterministicFiniteStateMachine import DFA, StatesType as DfaStatesType def nfa_to_dfa(nfa: NFA) -> DFA: e_close = nfa.e_close() P = set...
null
transformation.py
transformation.py
py
11,749
python
en
code
null
code-starcoder2
76
[ { "api_name": "NondeterministicFiniteStateMachine.NFA", "line_number": 8, "usage_type": "name" }, { "api_name": "DeterministicFiniteStateMachine.DFA", "line_number": 52, "usage_type": "call" }, { "api_name": "DeterministicFiniteStateMachine.DFA", "line_number": 8, "usage_...
269736951
# -*- coding: utf-8 -*- """ Created on Wed Oct 27 21:54:13 2021 @author: xpess """ lat = [45.461516, 45.461448, 45.461383, 45.461641, 45.461534, 45.461595, 45.461562] long = [6.44461, 6.444426, 6.444239, 6.444035, 6.443879, 6.4437, 6.443521] alt = [1315.221, 1315.702, 1316.182, 1316.663, 1319.144, 1317.634, 1318.105]...
null
Exercices/03_tableaux/randonnee/programmes/ds_01.py
ds_01.py
py
5,358
python
en
code
null
code-starcoder2
76
[ { "api_name": "math.radians", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 51, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number": 53, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 5...
549604502
import olefile import zlib from hwp_tag import * import sys # #assert olefile.isOleFile("target.hwp") #assert olefile.isOleFile("test.hwp") def print_record_structure(filename): print("./Documents/"+filename) origin=olefile.OleFileIO("./Documents/"+filename) origin_section0=origin.openstream('Bodyte...
null
ole_parse.py
ole_parse.py
py
2,116
python
en
code
null
code-starcoder2
76
[ { "api_name": "olefile.OleFileIO", "line_number": 17, "usage_type": "call" }, { "api_name": "zlib.decompress", "line_number": 22, "usage_type": "call" }, { "api_name": "zlib.MAX_WBITS", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.scandir", ...
124261327
from django.contrib import admin from .models import Services # Register your models here. class MyModelAdmin(admin.ModelAdmin): def has_add_permission(self, request): num_objects = self.model.objects.count() if num_objects >= 1: return False else: return True admin.site.register(Services, MyModelAdmi...
null
services/admin.py
admin.py
py
322
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 7, "usage_type": "name" }, { "api_name": "django.contrib.admin.site.register", "line_number": 16, "usage_type": "call" },...
2581787
import logging import fnmatch from flexget.plugin import register_plugin, register_parser_option, PluginError log = logging.getLogger('feed_control') class OnlyFeed(object): """ Implements --feed option to only run specified feed(s) Example: flexget --feed feeda Multiple feeds: ...
null
flexget/plugins/operate/feed_execution.py
feed_execution.py
py
2,576
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" }, { "api_name": "fnmatch.fnmatchcase", "line_number": 35, "usage_type": "call" }, { "api_name": "flexget.plugin.PluginError", "line_number": 37, "usage_type": "call" }, { "api_name": "flexg...
600475572
# -*- coding: utf-8 -*- from brasil.gov.portal.interfaces import IBrasilGov from brasil.gov.portal.testing import INTEGRATION_TESTING from plone import api from zope.interface import alsoProvides import unittest class OverviewControlPanelTest(unittest.TestCase): layer = INTEGRATION_TESTING def setUp(self):...
null
src/brasil/gov/portal/tests/test_controlpanel_overview.py
test_controlpanel_overview.py
py
1,302
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "brasil.gov.portal.testing.INTEGRATION_TESTING", "line_number": 12, "usage_type": "name" }, { "api_name": "zope.interface.alsoProvides", "line_number": 19, "usage_type": "call...
309038748
#!/usr/bin/env python """ For selected site(s), download and save/extract latest batch export archive. By default, export is into SITE/SUBJECT/CURRENT_DATE; this can be modified with --target-dir, --no-subject-subdirs and --no-date-subdirs, respectively. """ import argparse import datetime import fitabase import iter...
null
ingest_latest_export.py
ingest_latest_export.py
py
7,579
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path.realpath", "lin...
55612161
#!/usr/bin/env python # coding: utf-8 from setuptools import setup, find_packages from tecdoc import VERSION import os def _read(rel_path): with open(os.path.join(os.path.dirname(__file__), rel_path)) as fp: return fp.read() setup( name='django-tecdoc', version=VERSION, description='Itegra...
null
setup.py
setup.py
py
801
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "setuptools.setup", "lin...
25356486
# -*- coding: utf-8 -*- import logging from dipy.io.stateful_tractogram import StatefulTractogram from dipy.tracking.streamlinespeed import (length, set_number_of_points) import numpy as np from scipy.interpolate import splev, splprep from scipy.ndimage.filters import gaussian_filter1d def filter_streamlines_by_len...
null
scilpy/tracking/tools.py
tools.py
py
7,298
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.inf", "line_number": 12, "usage_type": "attribute" }, { "api_name": "dipy.tracking.streamlinespeed.length", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.logical_and", "line_number": 39, "usage_type": "call" }, { "api_name": ...
510957381
from tkinter import * import threading import tkinter.messagebox as MessageBox from datetime import date import recognizer import crud import pymysql as mysql import pyttsx3 # ======================= FUNCOES DO SISTEMA ======================== # def speech(): label2audio = ('Qual o peso do seu pet?') en = py...
null
registro_peso.py
registro_peso.py
py
7,018
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyttsx3.init", "line_number": 15, "usage_type": "call" }, { "api_name": "pyttsx3.init", "line_number": 22, "usage_type": "call" }, { "api_name": "pyttsx3.init", "line_number": 29, "usage_type": "call" }, { "api_name": "pyttsx3.init", "line_numbe...
480258978
#!/usr/bin/env python import rospy from gazebo_msgs.srv import * from gazebo_msgs.msg import * from geometry_msgs.msg import * from sensor_msgs.msg import Image, CameraInfo import random import math import tf import numpy as np import cv2 from skimage import feature import pickle from matplotlib import pyplot as plt f...
null
.block_mover/scripts/camera_controller.py
camera_controller.py
py
39,050
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 97, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 98, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 100, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number":...
53442606
import asyncio import discord class Song: def __init__(self, message, player): self.requester = message.author self.channel = message.channel self.player = player def __str__(self): fmt = '*{0.title}* uploaded by {0.uploader} and requested by {1.display_name}' duration...
null
music.py
music.py
py
1,295
python
en
code
null
code-starcoder2
76
[ { "api_name": "asyncio.Event", "line_number": 20, "usage_type": "call" }, { "api_name": "asyncio.Queue", "line_number": 21, "usage_type": "call" } ]
623216949
#!/usr/bin/env python3 import argparse GROUP_SIZE = 0x60 DATA_OFFSET = 0x14 REGISTER_NAMES = " SOPQMYDUIZCNKXcsiWAVHGmnBdkb" def get_reg_macro(offset): reg = (offset - DATA_OFFSET) // 2 group = reg // GROUP_SIZE reg_in_group = reg % GROUP_SIZE return "%cREG(%d)\n" % (REGISTER_NAMES[group], reg_in_gr...
null
tools/regconvert.py
regconvert.py
py
626
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" } ]
284114198
__author__ = 'dmitrytolstov' import itertools from pyparsing import * import sys sys.setrecursionlimit(40000) def deep_join(l): def hj(l): s = '' for el in l: if isinstance(el, list): s += hj(el) elif isinstance(el, ParseResults): s += hj(e...
null
analyze_pyparsing.py
analyze_pyparsing.py
py
5,578
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.setrecursionlimit", "line_number": 7, "usage_type": "call" }, { "api_name": "itertools.chain", "line_number": 51, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 149, "usage_type": "call" } ]
138053698
from pandas.io.data import DataReader as DR from datetime import datetime as dt import matplotlib.pyplot as plt import numpy as np #The collection of data starting from 17/7/2010 to 16/7/2015. start = dt(2012, 7, 17) end = dt(2015, 7, 16) #Task 2 #Hong Leong Bank Berhad with stock code: 5819.KL is chosen HongLeong_cl...
null
download_data.py
download_data.py
py
1,478
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.io.data.DataReader", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.rep...
554714281
from __future__ import annotations import re from dataclasses import asdict, dataclass from datetime import date, datetime from functools import partial from pathlib import Path from typing import Any, Callable, Dict, List, Optional, Tuple, Union import sqlparse from basis.core.component import ComponentLibrary from ...
null
basis/core/sql/sql_function.py
sql_function.py
py
18,813
python
en
code
null
code-starcoder2
76
[ { "api_name": "basis.core.declarative.function.InputType", "line_number": 55, "usage_type": "name" }, { "api_name": "basis.core.function_interface.parse_input_annotation", "line_number": 57, "usage_type": "call" }, { "api_name": "basis.core.function_interface.ParsedAnnotation", ...
491217552
# -*- coding: utf-8 -*- import doctest import unittest2 as unittest from plone.testing import layered from genweb.banners.testing import ( GENWEBEXTRAS_FUNCTIONAL_TESTING, optionflags, ) functional_tests = [ # add here the functional doctest file names ] def test_suite(): suite = unittest.TestSuite()...
null
genweb/banners/tests/test_doctests.py
test_doctests.py
py
653
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest2.TestSuite", "line_number": 16, "usage_type": "call" }, { "api_name": "plone.testing.layered", "line_number": 18, "usage_type": "call" }, { "api_name": "doctest.DocFileSuite", "line_number": 18, "usage_type": "call" }, { "api_name": "genweb...
526647116
import pytest from gaphor import UML from gaphor.diagram.general import CommentItem, CommentLineItem from gaphor.diagram.tests.fixtures import connect from gaphor.UML.classes import ClassItem, GeneralizationItem from gaphor.UML.sanitizerservice import SanitizerService class MockUndoManager: def in_undo...
null
gaphor/UML/tests/test_sanitizerservice.py
test_sanitizerservice.py
py
6,157
python
en
code
null
code-starcoder2
76
[ { "api_name": "gaphor.UML.sanitizerservice.SanitizerService", "line_number": 17, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 15, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 22, "usage_type": "attribute" }, { "a...
366530821
# -*- coding: utf-8 -*- """ Created on Sun Feb 28 21:10:24 2021 @author: Nils """ import pandas as pd import numpy as np import datetime from tools import datePrefixISO from tools import nextguestListID from tools import idComposer from tools import idDecomposer def guestListID(path_guestListID, default=None): ...
null
guestLists.py
guestLists.py
py
8,493
python
en
code
null
code-starcoder2
76
[ { "api_name": "tools.datePrefixISO", "line_number": 44, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 44, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 44, "usage_type": "attribute" }, { "api_name": "tools.idCo...
85677777
import datetime import json from lib import article_of_gzh as aog, log, spider_config from lib.gzh_ring import GzhRing from lib.redis_queue import RedisQueue if __name__ == '__main__': # 公众号队列 gzh_rq = RedisQueue('gzh_rq') gzh_ring = GzhRing(spider_config.get_list("gzh")) start_time = datetime.datet...
null
consumer/gzh_article.py
gzh_article.py
py
1,051
python
en
code
null
code-starcoder2
76
[ { "api_name": "lib.redis_queue.RedisQueue", "line_number": 11, "usage_type": "call" }, { "api_name": "lib.gzh_ring.GzhRing", "line_number": 12, "usage_type": "call" }, { "api_name": "lib.spider_config.get_list", "line_number": 12, "usage_type": "call" }, { "api_na...
473811587
from discord.ext import commands from core.classes import Cog_Extension import json with open('setting.json', 'r', encoding='utf8') as jfile: jdata = json.load(jfile) class Common(Cog_Extension): #ping @commands.command(name= 'ping', aliases=['延遲' , '機器人延遲' , 'delay']) async def ping(self, ctx): ...
null
cmds/common.py
common.py
py
3,319
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 6, "usage_type": "call" }, { "api_name": "core.classes.Cog_Extension", "line_number": 8, "usage_type": "name" }, { "api_name": "discord.ext.commands.command", "line_number": 10, "usage_type": "call" }, { "api_name": "disco...
302774082
import numpy as np import torch import cv2 def enet_weighing(label, num_classes, c=1.02): """Computes class weights as described in the ENet paper: w_class = 1 / (ln(c + p_class)), where c is usually 1.02 and p_class is the propensity score of that class: propensity_score = freq_class / to...
null
utils/util.py
util.py
py
3,096
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.bincount", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.log", "line_number": 35, "usage_type": "call" }, { "api_name": "torch.from_numpy", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.min", "line_numbe...
495490833
import os import sys import re import json dir_path = os.path.dirname(sys.argv[0]) def getVersionFromVcs(): """ request from vcs tag like: major.minor.patch[-pre-release][+metadata]-\\d+ and parse it """ myCmd = '' try: myCmd = os.popen('git describe --tags --long').read() exc...
null
src/semver.py
semver.py
py
3,093
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.popen", "line_number":...
611720196
#=========================================================================== # # MQTT topic and payload template # #=========================================================================== import json import jinja2 import logging LOG = logging.getLogger('Main.'+__name__) class MsgTemplate: """MQTT message te...
null
MsgTemplate.py
MsgTemplate.py
py
6,488
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "jinja2.Template", "line_number": 53, "usage_type": "call" }, { "api_name": "jinja2.Template", "line_number": 56, "usage_type": "call" }, { "api_name": "jinja2.Template", ...
343555000
from rest_framework import serializers from ..models import Newsletter, Subscription class NewsletterSerializer(serializers.ModelSerializer): class Meta: model = Newsletter fields = ["title", "slug", "email", "sender"] # Don't try to use __all__! class SubscriptionSerializer(serializers.ModelSe...
null
newzila/newsletter/api/serializers.py
serializers.py
py
946
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 5, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 5, "usage_type": "name" }, { "api_name": "models.Newsletter", "line_number": 7, "usage_type": "name" }, ...
613464869
import cv2 import numpy as np import dlib def scale(x, feature_range=(-1, 1)): min, max = feature_range x = x * (max - min) + min return x def scale_back(x): min, max = feature_range x = (x + 1) / 2 * 255 return x def swap_faces(images_Y, images_X, batch_size): imgs_Y = images_Y id...
null
face_swapper.py
face_swapper.py
py
7,071
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 28, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 36, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_n...
320227443
# avito2rss import numpy as np from numpy import array,mean import matplotlib.pyplot as plt from scipy.signal import savgol_filter, butter, filtfilt,argrelextrema,hilbert,chirp from scipy.fftpack import fft from scipy import stats # Класс, считывающий и выдающий предварительно обработанные данные class data_signal(...
null
py/code_print_end.py
code_print_end.py
py
7,039
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.load", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 29, "usage_type": "call" }, { "api_name": "scipy.signal.savgol_filter", "line_number": 30, "usage_type": "call" }, { "api_name": "scipy.signal.but...
548637667
import webapp2 import logging import os import json import pdb import copy from google.appengine.api import urlfetch from google.appengine.api import app_identity from google.appengine.ext import ndb from google.appengine.ext import deferred from google.appengine.runtime import DeadlineExceededError from...
null
mplus.py
mplus.py
py
25,567
python
en
code
null
code-starcoder2
76
[ { "api_name": "google.appengine.ext.vendor.add", "line_number": 16, "usage_type": "call" }, { "api_name": "google.appengine.ext.vendor", "line_number": 16, "usage_type": "name" }, { "api_name": "google.appengine.ext.ndb.Key", "line_number": 31, "usage_type": "call" }, ...
637829849
import sys from unittest.mock import patch import pytest from tests.mocks.git_mock import execute_git_mock from tests.mocks.marquez_client import get_mock_marquez_client from tests.util import assert_marquez_calls, execute_dag import airflow.jobs # noqa: F401 @pytest.mark.skip(reason="need to revisit how DAGs are ...
null
tests/test_marquez_dag.py
test_marquez_dag.py
py
1,278
python
en
code
null
code-starcoder2
76
[ { "api_name": "tests.util.execute_dag", "line_number": 18, "usage_type": "call" }, { "api_name": "tests.util.assert_marquez_calls", "line_number": 19, "usage_type": "call" }, { "api_name": "pytest.mark.skip", "line_number": 12, "usage_type": "call" }, { "api_name"...
49669794
from django.forms import models, fields from .widgets import ( ColortagSelectMultiple, ColortagIEMultiWidget, ColortagIEAndOrWidget ) class ModelChoiceInstanceIterator(models.ModelChoiceIterator): def choice(self, obj): # Add the model instance to the iterated items. (value, label) = ...
null
django_colortag/fields.py
fields.py
py
2,104
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.models.ModelChoiceIterator", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.forms.models", "line_number": 10, "usage_type": "name" }, { "api_name": "django.forms.models.ModelMultipleChoiceField", "line_number": 16, "usage...
30490880
# coding=utf-8 # !/usr/bin/python """ This class in for config file """ import configparser class Config(object): def __init__(self): config_file = configparser.ConfigParser() config_file.read('config.ini') section_key = [] section_value = [] for each_section in config_f...
null
class/Config.py
Config.py
py
644
python
en
code
null
code-starcoder2
76
[ { "api_name": "configparser.ConfigParser", "line_number": 14, "usage_type": "call" } ]
46684902
import socket import time import picamera import struct from PIL import Image import io import os import datetime import subprocess as sp import sys import threading import logging import typing import json import codecs #from subprocess import STDOUT, PIPE # Start a socket listening for connections o...
null
Server Files/old servers/serverv2.py
serverv2.py
py
4,140
python
en
code
null
code-starcoder2
76
[ { "api_name": "socket.socket", "line_number": 19, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 20, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 51, "usage_type": "call" }, { "api_name": "datetime.datetime",...
301399441
''' This file is for Watson API. Uses Recorder2 to save audio and uses s2t and nlu api to get text, confidence of text, and sentiment. Last Updated: 2020.12.01 Update on 20201208 0950 to show text sentiment results and output ''' import os import json from os.path import join, dirname # from dotenv import load_dotenv ...
null
speech_sentiment_run2.py
speech_sentiment_run2.py
py
6,537
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.insert", "line_number": 25, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 25, "usage_type": "call" }, { "api_name": "config.config_s2t_api", "...
518815207
import yaml from django.conf import settings from django.urls import path from pydis_site.apps.redirect.views import CustomRedirectView app_name = "redirect" urlpatterns = [ path( data["original_path"], CustomRedirectView.as_view( pattern_name=data["redirect_route"], static...
null
pydis_site/apps/redirect/urls.py
urls.py
py
554
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "pydis_site.apps.redirect.views.CustomRedirectView.as_view", "line_number": 11, "usage_type": "call" }, { "api_name": "pydis_site.apps.redirect.views.CustomRedirectView", "line_number": ...
445516376
"""This module contains the virtual motion glove interface.""" import contextlib import io import ipaddress import struct import time from typing import ContextManager, Sequence import serial from .data import GloveSample, IMUSample from .error import GloveConnectionError, GloveError, GlovePacketError, GloveTimeoutE...
null
vmg30/glove.py
glove.py
py
8,597
python
en
code
null
code-starcoder2
76
[ { "api_name": "serial.Serial", "line_number": 28, "usage_type": "call" }, { "api_name": "struct.unpack", "line_number": 37, "usage_type": "call" }, { "api_name": "ipaddress.ip_address", "line_number": 40, "usage_type": "call" }, { "api_name": "ipaddress.ip_address...
529209208
import numpy as np from aiida.engine import calcfunction from aiida.orm import Str, ArrayData, load_node @calcfunction def get_elastic_symmetries(laue: Str) -> ArrayData: """ Load elastic symmetries for a given laue group from the AiiDA database. The elastic symmetries node _MUST_ be imported before this...
null
aiida_quantumespresso_elastic/utils/get_elastic_symmetries.py
get_elastic_symmetries.py
py
747
python
en
code
null
code-starcoder2
76
[ { "api_name": "aiida.orm.Str", "line_number": 8, "usage_type": "name" }, { "api_name": "aiida.orm.load_node", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 19, "usage_type": "call" }, { "api_name": "aiida.orm.ArrayData", ...
515485179
# -*- coding: utf-8 -*- """ facti.controller.claim_register ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 파일 업로드 모듈. 사진을 서버의 upload 디렉토리에 저장함. """ import os from flask import request, redirect, url_for, current_app, render_template, \ session from wtforms import Form, StringField, BooleanField, validators, Se...
null
facti/controller/admin_claim_upload.py
admin_claim_upload.py
py
4,098
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.request.form", "line_number": 30, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 30, "usage_type": "name" }, { "api_name": "flask.render_template", "line_number": 32, "usage_type": "call" }, { "api_name": "facti.fac...
16606024
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Extracting author level data 1. Main process: 1) Get author name from sample list 2) Get hash ID of the commits from authors dict "{author:[commits]}" for each author 3) Get hash ID of fix commit from bug-fixes dict "{bug:fix}" for each commit 4) Get the feature of t...
null
FinalProject/extractor/author_data.py
author_data.py
py
3,039
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 44, "usage_type": "call" }, { "api_name": "json.load", "line_number": 46, "usage_type": "call" }, { "api_name": "json.load", "line_number": 47, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_numb...
630361830
import time # from selenium import webdriver from selenium.webdriver.support.select import Select from pageObjects.LoginPage import LoginPage from pageObjects.checkout_address_page import check_out_address from pageObjects.checkout_overview_page import checkout_overview from pageObjects.orderconfirmation_page i...
null
tests/checkout_test.py
checkout_test.py
py
3,158
python
en
code
null
code-starcoder2
76
[ { "api_name": "utilities.BaseClass.baseclass", "line_number": 14, "usage_type": "name" }, { "api_name": "pageObjects.LoginPage.LoginPage", "line_number": 17, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 21, "usage_type": "call" }, { "api_name...
191923057
#!/usr/bin/env python3 import json import glob import os import requests from cachecontrol import CacheControl from defusedxml import ElementTree as ElementTree import xml.etree.ElementTree as ET try: import urllib.parse except ImportError: import urllib def getUsers(userfile = 'users.json'): with open(...
null
update_contributors.py
update_contributors.py
py
5,501
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 19, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 23, "usage_type": "call" }, { "api_name": "cachecontrol.CacheControl", "line_number": 28, "usage_type": "call" }, { "api_name": "requests.session", ...
421256725
# -*- coding: utf-8 -*- """ Created on Tue May 19 16:14:15 2020 @author: eshor """ import matplotlib.pyplot as plt import seaborn as sns from Graphing import clcolor, kcolor, xcolor,nacolor #import Class_Single_Compartment_PLM as PLM import Class_Single_Compartment_Analytical as analytical_PLM ### FIGURE 2 ### #L...
null
Single compartment/Fig2_Single_Compartment_PLM.py
Fig2_Single_Compartment_PLM.py
py
1,342
python
en
code
null
code-starcoder2
76
[ { "api_name": "Class_Single_Compartment_Analytical.SingleCompartment_PumpLeak_Analytical", "line_number": 31, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 50, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 50, ...
153373530
#!/usr/bin/env python3 import os import stat import subprocess import sys import tempfile from compiler.provides import ProvidesFile from compiler.requires import require_directory from find_built_subvol import find_built_subvol from fs_image.fs_utils import Path from tests.temp_subvolumes import TempSubvolumes from ...
null
fs_image/compiler/items/tests/test_install_file.py
test_install_file.py
py
4,576
python
en
code
null
code-starcoder2
76
[ { "api_name": "common.image_source_item", "line_number": 24, "usage_type": "call" }, { "api_name": "install_file.InstallFileItem", "line_number": 25, "usage_type": "argument" }, { "api_name": "common.DUMMY_LAYER_OPTS", "line_number": 25, "usage_type": "name" }, { ...
631144536
#!/usr/bin/python3 # Copyright: (c) 2018, Xiao Mo <95112082@qq.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } DOCUMENTATION = ''' --- module: kubeconfig ...
null
plugins/library/kubeconfig.py
kubeconfig.py
py
7,281
python
en
code
null
code-starcoder2
76
[ { "api_name": "ansible.module_utils.basic.AnsibleModule", "line_number": 125, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 130, "usage_type": "call" }, { "api_name": "os.path", "line_number": 130, "usage_type": "attribute" }, { "api_name"...
44532713
from twisted.plugin import IPlugin from heufybot.moduleinterface import IBotModule from heufybot.modules.commandinterface import BotCommand from zope.interface import implements class ConnectionControlCommands(BotCommand): implements(IPlugin, IBotModule) name = "ConnectionControl" def triggers(self): ...
null
heufybot/modules/commands/connectioncontrol.py
connectioncontrol.py
py
2,945
python
en
code
null
code-starcoder2
76
[ { "api_name": "heufybot.modules.commandinterface.BotCommand", "line_number": 7, "usage_type": "name" }, { "api_name": "zope.interface.implements", "line_number": 8, "usage_type": "call" }, { "api_name": "twisted.plugin.IPlugin", "line_number": 8, "usage_type": "argument" ...
14826921
"""PleskDeployer""" import logging import os from tempfile import mkstemp from letsencrypt import errors logger = logging.getLogger(__name__) class PleskDeployer(object): """Class performs deploy operations within the Plesk configurator.""" def __init__(self, plesk_api_client, domain): """Initializ...
null
letsencrypt_plesk/deployer.py
deployer.py
py
5,644
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "letsencrypt.errors.PluginError", "line_number": 74, "usage_type": "call" }, { "api_name": "letsencrypt.errors", "line_number": 74, "usage_type": "name" }, { "api_name": "le...
74784265
import os import sys import gc import requests from collections import defaultdict from typing import List from threading import Thread from mycloud.helper import operation_timeout from mycloud.mycloudapi import ( MyCloudRequestExecutor, ObjectResourceBuilder, RenameRequest, MetadataRequest, Directo...
null
mycloud/filesync/remote_file_conversion.py
remote_file_conversion.py
py
13,604
python
en
code
null
code-starcoder2
76
[ { "api_name": "mycloud.mycloudapi.MyCloudRequestExecutor", "line_number": 46, "usage_type": "name" }, { "api_name": "mycloud.mycloudapi.ObjectResourceBuilder", "line_number": 50, "usage_type": "call" }, { "api_name": "mycloud.logger.log", "line_number": 61, "usage_type": ...
417635779
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author: vita import functools from types import FunctionType from django.utils.safestring import mark_safe from django.urls import re_path, reverse from django.shortcuts import render, redirect, HttpResponse from django.http import QueryDict from stark.service.StarkModelFo...
null
PHM/stark/service/StarkHandler.py
StarkHandler.py
py
18,971
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.reverse", "line_number": 116, "usage_type": "call" }, { "api_name": "django.http.QueryDict", "line_number": 120, "usage_type": "call" }, { "api_name": "django.urls.reverse", "line_number": 166, "usage_type": "call" }, { "api_name": "star...
43196577
#!/usr/bin/env python3 import RPi.GPIO as GPIO import time, sys, os from datetime import datetime import datetime as DT import math import mysql.connector import threading import io import fcntl import syslog import getpass import select import serial import busio import board import adafruit_shtc3 DrainBed1 = 25 Drai...
null
Growbot9.py
Growbot9.py
py
26,947
python
en
code
null
code-starcoder2
76
[ { "api_name": "getpass.getuser", "line_number": 30, "usage_type": "call" }, { "api_name": "RPi.GPIO.setwarnings", "line_number": 31, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 31, "usage_type": "name" }, { "api_name": "RPi.GPIO.setmode", ...
124103951
import json import tweepy import requests import pandas as pd import numpy as np from datetime import datetime, timedelta def lambda_handler(event, context): #opens and reads sckey.json a1key={} with open("a1keys/a1key.json") as file: a1key = json.loads(file.read()) # Consumer keys and acces...
null
lambda_function.py
lambda_function.py
py
2,669
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.loads", "line_number": 12, "usage_type": "call" }, { "api_name": "tweepy.OAuthHandler", "line_number": 21, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 24, "usage_type": "call" }, { "api_name": "json.loads", "line_numb...
348371189
import math import random import tcod from components.ai import BasicMonster, ConfusedMonster from components.equipment import Equipment from components.equippable import Equippable from components.fighter import Fighter from components.item import Item from components.inventory import Inventory from components.level...
null
entity.py
entity.py
py
12,171
python
en
code
null
code-starcoder2
76
[ { "api_name": "render_functions.RenderOrder.CORPSE", "line_number": 22, "usage_type": "attribute" }, { "api_name": "render_functions.RenderOrder", "line_number": 22, "usage_type": "name" }, { "api_name": "components.item.Item", "line_number": 68, "usage_type": "call" },...
292819103
import argparse import torch import numpy as np from torch import nn from torch import optim import torch.nn.functional as F from torchvision import datasets, transforms, models from PIL import Image from datetime import datetime import os import glob import copy import sys from collections import OrderedDict #argumen...
null
train.py
train.py
py
7,576
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 37, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 37, "usage_type": "call" }, { "api_name": "torch.cu...
135247657
import os import sys from sqlalchemy import Column, ForeignKey, Integer, String from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship from sqlalchemy import create_engine from eralchemy import render_er Base = declarative_base() class Person(Base): __tablename__ = 'person...
null
src/models.py
models.py
py
1,371
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 9, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 13, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 13, "usage_type": "argument" }, { ...
462055365
""" Test WebSocket Transport """ import asyncio import pytest from agent_core.transport import websocket, ConnectionClosed from agent_core.compat import create_task @pytest.mark.asyncio async def test_websocket_transport(unused_tcp_port_factory): """ Test WebSocket Transport """ port = unused_tcp_port_factor...
null
agent_core/tests/test_transport/test_websocket.py
test_websocket.py
py
1,250
python
en
code
null
code-starcoder2
76
[ { "api_name": "asyncio.Queue", "line_number": 13, "usage_type": "call" }, { "api_name": "agent_core.transport.websocket.WebSocketInboundTransport", "line_number": 14, "usage_type": "call" }, { "api_name": "agent_core.transport.websocket", "line_number": 14, "usage_type": ...
105018650
#!/usr/bin/env python3 #Importiere notwendige Pakete import sys import argparse import numpy as np import matplotlib import matplotlib.pyplot as plt import scipy.odr as sodr from numpy import genfromtxt import argparse #Welche Olimere dargestellt werden sollen cell = sys.argv[1] file_0 = cell+"_0.txt" file_90 = cell+...
null
Versuch_441/plot_0_90.py
plot_0_90.py
py
1,019
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.genfromtxt", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.genfromtxt", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.fig...
196172305
from selenium import webdriver import time from bs4 import BeautifulSoup import requests from html_parse import * import os from lxml import etree from ticker_lookup import get_holdings_info from sec_edgar_downloader import Downloader from SQL import test_mysql_connection as sql_functions #driver.get('https://www.s...
null
data_parse/13f_scraper.py
13f_scraper.py
py
4,995
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.sleep", "line_number": 39, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 46, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 48, "usage_type": "call" }, { "api_name": "SQL.test_mysql_connection.i...
626345624
# module importieren from KratosMultiphysics import * from KratosMultiphysics.IgaApplication import * from KratosMultiphysics.StructuralMechanicsApplication import * import new_linear_solver_factory # modell erzeugen model_part = ModelPart('Model') # variablen definieren die jeder knoten speichern soll model_part.Add...
null
python_base/Two Bar Truss/two_bar_truss.py
two_bar_truss.py
py
6,397
python
en
code
null
code-starcoder2
76
[ { "api_name": "new_linear_solver_factory.ConstructSolver", "line_number": 121, "usage_type": "call" }, { "api_name": "xlsxwriter.Workbook", "line_number": 161, "usage_type": "call" } ]
406564990
#! /usr/bin/env python """ File: .py Copyright (c) 2016 Austin Ayers License: MIT Course: PHYS227 Assignment: Date: Feb 11, 2016 Email: ayers111@mail.chapman.edu Name: Austin Ayers Description: Implementing a prime sieve """ import Lagrange_poly1 as L1 import sympy as sp import numpy as np import matplotlib.pyplot ...
null
Lagrange_poly2.py
Lagrange_poly2.py
py
1,005
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.sin", "line_number": 22, "usage_type": "call" }, { "api_name": "Lagrange_poly1.p_L", "line_number": 45, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 47, "usage_type": "call" }, { "api_name": "matplotlib.pyplot...
385625190
from typing import Callable, Tuple, Union import torch from ignite.contrib.metrics.regression._base import _BaseRegression from ignite.metrics.metric import reinit__is_reduced, sync_all_reduce class ManhattanDistance(_BaseRegression): r""" Calculates the Manhattan Distance: :math:`\text{MD} = \sum_{j=1...
null
ignite/contrib/metrics/regression/manhattan_distance.py
manhattan_distance.py
py
1,427
python
en
code
null
code-starcoder2
76
[ { "api_name": "ignite.contrib.metrics.regression._base._BaseRegression", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.Callable", "line_number": 27, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 27, "usage_type": "name" }, { ...
407161297
from __future__ import division import copy import csv import time from collections import Counter from datetime import datetime, timedelta from math import sqrt import distance import matplotlib.pyplot as plt import numpy as np import unicodecsv from jellyfish._jellyfish import damerau_levenshtein_distance from ker...
null
pdm/pdm_monitoring.py
pdm_monitoring.py
py
7,395
python
en
code
null
code-starcoder2
76
[ { "api_name": "pickle.load", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 61, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 74, "usage_type": "call" }, { "api_name": "category_encoders.Binar...
490272434
import sys sys.path.append("src/") import os import random import numpy as np import sklearn.datasets import tensorflow as tf import tensorflow_utils as tf_utils import utils as utils import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import pandas as pd from scipy import stats from dataset_ma...
null
archieve/dirichlet_train_gan.py
dirichlet_train_gan.py
py
6,471
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "matplotlib.use", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.join", "line_n...
416811855
"""empty message Revision ID: 376786960ba6 Revises: 55540bae47a Create Date: 2017-07-07 02:06:19.332578 """ # revision identifiers, used by Alembic. revision = '376786960ba6' down_revision = '55540bae47a' from alembic import op import sqlalchemy as sa import geoalchemy2 def upgrade(): ### commands auto genera...
null
migrations/versions/376786960ba6_.py
376786960ba6_.py
py
759
python
en
code
null
code-starcoder2
76
[ { "api_name": "alembic.op.add_column", "line_number": 20, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 20, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 20, "usage_type": "call" }, { "api_name": "sqlalchemy.String"...
343734576
# -*- coding: utf-8 -*- from openerp import fields, models, api, exceptions, _ from datetime import datetime, timedelta from openerp.tools import DEFAULT_SERVER_DATE_FORMAT from dateutil import rrule from dateutil.relativedelta import relativedelta from dateutil import easter class ClbDaysOffWizard(models.TransientM...
null
tk_days_off/wizard/days_off_wizard.py
days_off_wizard.py
py
4,791
python
en
code
null
code-starcoder2
76
[ { "api_name": "openerp.models.TransientModel", "line_number": 11, "usage_type": "attribute" }, { "api_name": "openerp.models", "line_number": 11, "usage_type": "name" }, { "api_name": "openerp.fields.Integer", "line_number": 14, "usage_type": "call" }, { "api_name...
357941921
""" Plot the percent of correctly decoded on a heatmap, as a function of active ORNS (x) and odor complexity Kk (y) Created by Nirag Kadakia at 09:55 05-17-2018 This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. To view a copy of this license, visit htt...
null
figures_2018_09_05/4_primacy_coding/scripts/plot_latency_intensity.py
plot_latency_intensity.py
py
3,944
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 24, "usage_type": "call" }, { "api_name": "sys.path", "line_nu...
30031640
# 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, software # distributed under the...
null
ironic_discoverd/main.py
main.py
py
5,062
python
en
code
null
code-starcoder2
76
[ { "api_name": "eventlet.monkey_patch", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 33, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 34, "usage_type": "call" }, { "api_name": "flask.request.get...
113993760
import sys import time import pprint import pandas as pd import numpy as np import pickle as pk from collections import defaultdict sys.path.append("../../Common/NLP") sys.path.append("../../Common/Mysql") sys.path.append("../../Common") from libmysql import dbConMysql from DataScience import mod_ds_help...
null
NLP/chatbot/modChatbot.py
modChatbot.py
py
4,463
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_numb...
350961555
# -*- coding: utf-8 # pyKol - Gestion de colles en CPGE # Copyright (c) 2018 Florian Hatat # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at you...
null
views/direction/user.py
user.py
py
5,606
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 36, "usage_type": "call" }, { "api_name": "pykol.forms.user.FullUserForm", "line_number": 42, "usage_type": "call" }, { "api_name": "django.contrib.messages.success", "line_number": 45, "usage_type": "call...
186674553
#!/usr/bin/env python # -*- coding: utf-8 -*- # Python version: 3.6 import torch from torch import nn, autograd from torch.utils.data import DataLoader, Dataset from torchvision import transforms import numpy as np import random import sys from torchvision import datasets as dataset import pickle import os from sklea...
null
dataset/cov_dataset.py
cov_dataset.py
py
5,488
python
en
code
null
code-starcoder2
76
[ { "api_name": "torchvision.datasets.MNIST", "line_number": 41, "usage_type": "call" }, { "api_name": "torchvision.datasets", "line_number": 41, "usage_type": "name" }, { "api_name": "torchvision.datasets.SVHN", "line_number": 42, "usage_type": "call" }, { "api_nam...
271007063
import cx_Oracle import re import chart_studio import plotly.graph_objects as go import chart_studio.plotly as py import chart_studio.dashboard_objs as dashboard #---------------------------------------------------------- chart_studio.tools.set_credentials_file(username='viplash4', api_key='7wRkW7UNx1GSEZfh48AE') usern...
null
main.py
main.py
py
3,312
python
en
code
null
code-starcoder2
76
[ { "api_name": "chart_studio.tools.set_credentials_file", "line_number": 8, "usage_type": "call" }, { "api_name": "chart_studio.tools", "line_number": 8, "usage_type": "attribute" }, { "api_name": "cx_Oracle.connect", "line_number": 12, "usage_type": "call" }, { "a...
545570714
"""Tools to manage the properties of a feature Classes ------- Property The class `Property`, which represents the values of a property of a feature. A Property be: * A constant (initialization with, e.g., a number, a tuple) * A sequence of variables (initialization with, e.g., an iterator) * A ran...
null
deeptrack/properties.py
properties.py
py
9,846
python
en
code
null
code-starcoder2
76
[ { "api_name": "backend.core.DeepTrackNode", "line_number": 31, "usage_type": "name" }, { "api_name": "backend.core.DeepTrackNode", "line_number": 38, "usage_type": "argument" }, { "api_name": "numpy.ndarray", "line_number": 63, "usage_type": "attribute" }, { "api_...
10116150
#high boost filtering import cv2 # Load the image image = cv2.imread("Images/images.jpg") # Blur the image gauss = cv2.GaussianBlur(image, (7, 7), 0) # Apply Unsharp masking unsharp_image = cv2.addWeighted(image, 2, gauss, -1, 0) cv2.imshow("animesh",unsharp_image) cv2.waitKey(0)
null
Chapter 2/high_boost_filtering.py
high_boost_filtering.py
py
281
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.GaussianBlur", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.addWeighted", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_numbe...
371511051
import matplotlib.pyplot as plt import numpy as np from astropy.io import fits from scipy.ndimage import gaussian_filter # Create empty image nx, ny = 512, 512 image = np.zeros((ny, nx)) # Set number of stars n = 10000 # Generate random positions r = np.random.random(n) * nx theta = np.random.uniform(0., 2. * np.pi,...
null
synthetic.py
synthetic.py
py
851
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.random.random", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.random.uniform...
292957917
#pylint: disable=unused-argument, unused-import, no-name-in-module import pytest from utils import create_tables, setup_sleepers class FakeRequest(): def __init__(self): self.id = "1" class FakeTask(): def __init__(self): self.request = FakeRequest() self.state = 0 def update_sta...
null
services/sidecar/tests/test_sidecar.py
test_sidecar.py
py
1,113
python
en
code
null
code-starcoder2
76
[ { "api_name": "sidecar.core.SIDECAR.inspect", "line_number": 23, "usage_type": "call" }, { "api_name": "sidecar.core.SIDECAR", "line_number": 23, "usage_type": "name" }, { "api_name": "utils.create_tables", "line_number": 35, "usage_type": "call" }, { "api_name": ...
592795273
from PyQt5 import uic from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtSql import * from reportlab.pdfgen import canvas from reportlab.lib.pagesizes import A4 from reportlab.lib.colors import Color from PyPDF2 import PdfFileReader, PdfFileWriter import sys import...
null
CentrepayApp.py
CentrepayApp.py
py
24,933
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.abspath", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.curdir", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_...
463518430
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect from django.urls import reverse from tutorial.auth_helper import get_sign_in_url, get_token_from_code, store_token, store_user, remove_user_and_token, ...
null
tutorial/views.py
views.py
py
5,723
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.render", "line_number": 15, "usage_type": "call" }, { "api_name": "tutorial.auth_helper.get_sign_in_url", "line_number": 37, "usage_type": "call" }, { "api_name": "django.http.HttpResponseRedirect", "line_number": 41, "usage_type": "call" ...
502287283
import random from collections import defaultdict # Representation of a crossword, includes the grid and list boxes for the clues class Crossword: def __init__(self, grid_size): self.grid_size = grid_size # Contains all the clues self.clues = {} # Contains all the squares that can be filled self.blank_squar...
null
Crossword.py
Crossword.py
py
1,519
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 16, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 19, "usage_type": "call" }, { "api_name": "random.random", "line_number": 37, "usage_type": "call" }, { "api_name": "random....
80991029
import datetime from django.db import models from django.utils.safestring import mark_safe from pygments import highlight from pygments.formatters import get_formatter_by_name from pygments.lexers import get_lexer_by_name from django.utils.translation import ugettext_lazy as _ from wagtail.admin.edit_handlers import ...
null
core/abstracts.py
abstracts.py
py
5,625
python
en
code
null
code-starcoder2
76
[ { "api_name": "wagtail.core.blocks.StructBlock", "line_number": 40, "usage_type": "name" }, { "api_name": "wagtail.core.blocks.ChoiceBlock", "line_number": 41, "usage_type": "call" }, { "api_name": "wagtail.core.blocks.CharBlock", "line_number": 42, "usage_type": "call" ...
77910485
import tcod from components.ai import BasicMonster from death_functions import kill_monster, kill_player from entity import get_blocking_entity_at from fov_functions import initialize_fov, recompute_fov from game_messages import Message from game_states import GameStates from input_handlers import handle_keys, handle_m...
null
engine.py
engine.py
py
11,116
python
en
code
null
code-starcoder2
76
[ { "api_name": "loader_functions.initialize_new_game.get_constants", "line_number": 15, "usage_type": "call" }, { "api_name": "tcod.console_set_custom_font", "line_number": 17, "usage_type": "call" }, { "api_name": "tcod.FONT_TYPE_GREYSCALE", "line_number": 17, "usage_type...
520761995
import math import itertools import numpy as np import matplotlib.pyplot as plt import networkx as nx from sklearn.neighbors import DistanceMetric from node import LatLon, Individual, Household from raster import RasterLayer def surface_area(age): if age > 20: return 1.0 elif age > 2: return ...
null
network.py
network.py
py
2,975
python
en
code
null
code-starcoder2
76
[ { "api_name": "math.pi", "line_number": 24, "usage_type": "attribute" }, { "api_name": "math.sqrt", "line_number": 25, "usage_type": "call" }, { "api_name": "math.cos", "line_number": 26, "usage_type": "call" }, { "api_name": "math.sin", "line_number": 26, ...
469244096
from django.http import Http404, HttpResponse from django.shortcuts import render, get_object_or_404, get_list_or_404 from .models import Product, ImageThumbnail, ImageList # go to /doctor url in control panel to obtain this s3_media_url = "http://s3.amazonaws.com/superstone-test-d06381107ca84061a003a8f-611378c.aldryn...
null
products/views.py
views.py
py
2,499
python
en
code
null
code-starcoder2
76
[ { "api_name": "models.Product.objects.all", "line_number": 14, "usage_type": "call" }, { "api_name": "models.Product.objects", "line_number": 14, "usage_type": "attribute" }, { "api_name": "models.Product", "line_number": 14, "usage_type": "name" }, { "api_name": ...
250419470
import cgitb import os import sys from PyQt5.QtWidgets import QMainWindow, QFileDialog, QApplication, QMessageBox from utils.AtpBat import AtpBat from view.MenuBarTest import MenuBar from view.ui.ui_Welcom import Ui_WelcomeWindow class WelcomWindow(QMainWindow, Ui_WelcomeWindow): def __init__(self): sup...
null
view/WelcomWindow.py
WelcomWindow.py
py
6,619
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 12, "usage_type": "name" }, { "api_name": "view.ui.ui_Welcom.Ui_WelcomeWindow", "line_number": 12, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": 25, "usage_type": "call" }, { "api...
359620573
import subprocess import statistics import numpy as np import math import json import time import cv2 import sys import os IQA_TYPES = { 'aesthetic': '{pwd}/models/MobileNet/weights_mobilenet_aesthetic_0.07.hdf5', 'technical': '{pwd}/models/MobileNet/weights_mobilenet_technical_0.11.hdf5' } SVM_CLASS_MAP = { ...
null
score.py
score.py
py
6,728
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.abspath", "line_number": 49, "usage_type": "call" }, { "api_name": "os.path", "line_number": 49, "usage_type": "attribute" }, { "api_name": "math.sqrt", "line_number": 62, "usage_type": "call" }, { "api_name": "math.pow", "line_number": ...
378027117
import asyncio import itertools import os import sys import traceback from functools import partial from random import shuffle import discord import mutagen from async_timeout import timeout from discord.ext import commands class MusicPlayer: def __init__(self, ctx): self.bot = ctx.bot self._guild = ctx.guild ...
null
cogs/utilities/musicPlayer.py
musicPlayer.py
py
4,387
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.listdir", "line_number": 23, "usage_type": "call" }, { "api_name": "random.shuffle", "line_number": 24, "usage_type": "call" }, { "api_name": "asyncio.Event", "line_number": 25, "usage_type": "call" }, { "api_name": "os.listdir", "line_number...
612553316
import sys import os import math import psycopg2 from psycopg2 import sql import sqlalchemy import pandas as pd from Controller.DatasetHistoryManager import DatasetHistoryManager from Model.SQLTypeHandler import SQLTypeHandler class TableTransformer: """Class that performs transformations and various actions on ...
null
client/Controller/TableTransformer.py
TableTransformer.py
py
53,095
python
en
code
null
code-starcoder2
76
[ { "api_name": "Controller.DatasetHistoryManager.DatasetHistoryManager", "line_number": 32, "usage_type": "call" }, { "api_name": "psycopg2.sql.Identifier", "line_number": 77, "usage_type": "call" }, { "api_name": "psycopg2.sql", "line_number": 77, "usage_type": "name" }...
298376893
from imutils.object_detection import non_max_suppression import numpy as np import cv2 cap = cv2.VideoCapture(1) # define the two output layer names for the EAST detector model that # we are interested -- the first is the output probabilities and the # second can be used to derive the bounding box coordinates of text...
null
EASTTextDetector/TextDetectorForVideos.py
TextDetectorForVideos.py
py
4,040
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.VideoCapture", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.dnn.readNet", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.dnn", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_...
359824898
import random from collections import Counter import pytest from models.scenes.skill_checks import Difficulty, sample_weights # To ensure deterministic tests random.seed(0) @pytest.mark.parametrize("base,modifier,expected", [(Difficulty.MODERATE, 2, Difficulty.VERY_HARD), ...
null
src/models/scenes/tests/skills_test.py
skills_test.py
py
1,579
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.seed", "line_number": 9, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 12, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 12, "usage_type": "attribute" }, { "api_name": "models.scenes.ski...
42315011
import gym import argparse import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data.sampler import BatchSampler, SubsetRandomSampler from collections import namedtuple from tensorboardX import SummaryWriter # Environment Config env = gym.make("pushBox-v0") num_sta...
null
value_function_approximate/DQN/DQN_PushBox_Game.py
DQN_PushBox_Game.py
py
4,994
python
en
code
null
code-starcoder2
76
[ { "api_name": "gym.make", "line_number": 15, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.manual_seed", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.nn.Module", ...
348371060
# Django settings for reglog project. import django.conf.global_settings as DEFAULT_SETTINGS DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('admin', 'admin@reglog.apu'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'login_register', 'U...
null
reglog/settings.py
settings.py
py
2,891
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.global_settings.TEMPLATE_CONTEXT_PROCESSORS", "line_number": 64, "usage_type": "attribute" }, { "api_name": "django.conf.global_settings", "line_number": 64, "usage_type": "name" } ]
400338724
from keras.utils.np_utils import to_categorical from keras.datasets import reuters from keras import models from keras import layers import numpy as np import matplotlib.pyplot as plt def VectorizeSequence(sequences, dimension=10000): results = np.zeros((len(sequences), dimension)) for i, sequence in enumera...
null
Examples/ReutersKeras/reuters_retrain_less.py
reuters_retrain_less.py
py
2,301
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 10, "usage_type": "call" }, { "api_name": "keras.datasets.reuters.load_data", "line_number": 20, "usage_type": "call" }, { "api_name": "keras.datasets.reuters", "line_number": 20, "usage_type": "name" }, { "api_name": "k...
348504315
import math import numpy as np import curses Students=[] StudentID=[] Courses=[] CoursesID=[] Credit=[] Mark=[] value=[] Gpa=[] dhp= curses.initscr() class Student_s: def __init__(self, s_id, name, dob): self.a=s_id self.b=name self.c=dob Students.append(self) StudentID.a...
null
3.student.mark.oop.math.py
3.student.mark.oop.math.py
py
5,550
python
en
code
null
code-starcoder2
76
[ { "api_name": "curses.initscr", "line_number": 14, "usage_type": "call" }, { "api_name": "math.floor", "line_number": 119, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 128, "usage_type": "call" }, { "api_name": "numpy.array", "line_numbe...
484871606
#@Time :2018/12/28 19:50 import os import jieba # 保存文件的函数 def savefile(savepath,content,type=1): if type == 1: fp = open(savepath,'w',encoding='GBK',errors='ignore') else: fp = open(savepath,'a',encoding='GBK',errors='ignore') fp.write(content) fp.close() # 读取文件的函数 def readfile(path...
null
util/lda/testJieba.py
testJieba.py
py
1,633
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.listdir", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number...
536011999
from airflow.hooks.postgres_hook import PostgresHook from airflow.models import BaseOperator from airflow.utils.decorators import apply_defaults class LoadFactOperator(BaseOperator): ui_color = '#F98866' @apply_defaults def __init__(self, redshift_conn_id, table, create_stmt, sql_query, ...
null
DataEngineerNanoDegree/Project5-Airflow/plugins/operators/load_fact.py
load_fact.py
py
1,194
python
en
code
null
code-starcoder2
76
[ { "api_name": "airflow.models.BaseOperator", "line_number": 5, "usage_type": "name" }, { "api_name": "airflow.utils.decorators.apply_defaults", "line_number": 9, "usage_type": "name" }, { "api_name": "airflow.hooks.postgres_hook.PostgresHook", "line_number": 25, "usage_ty...
235046143
import json from kivy.clock import Clock from kivy.factory import Factory # NOQA: F401 from kivy.uix.screenmanager import ScreenManager import utils utils.load_kv("root.kv") class Root(ScreenManager): """ The Root (or Assembler) of the App. """ def __init__(self, **kwargs): super().__init...
null
libs/uix/baseclass/root.py
root.py
py
1,849
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.load_kv", "line_number": 9, "usage_type": "call" }, { "api_name": "kivy.uix.screenmanager.ScreenManager", "line_number": 12, "usage_type": "name" }, { "api_name": "kivy.clock.Clock.schedule_once", "line_number": 19, "usage_type": "call" }, { "...
650139011
from pathlib import Path from typing import List import ujson from config.abc import Config, ValueProvider from config.exceptions import ( BrokenConfig, ConfigNotFound, InvalidField, UnknownConfigFormat, ) from config.fields import BoolField, FloatField, IntField, NestedField, StrField from config.pro...
null
src/config/__init__.py
__init__.py
py
2,368
python
en
code
null
code-starcoder2
76
[ { "api_name": "config.abc.Config", "line_number": 33, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 33, "usage_type": "name" }, { "api_name": "config.abc.ValueProvider", "line_number": 33, "usage_type": "name" }, { "api_name": "config.abc.__f...
285250500
import configparser import json from datetime import date, datetime import pyodbc import os import ftplib import logging import requests import re import urllib.request import datetime as dt from random import randint import json import re try: from PIL import Image except ImportError: import Image import pyte...
null
inst_img_parse/inst_img.py
inst_img.py
py
5,175
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.post", "line_number": 31, "usage_type": "call" }, { "api_name": "pyodbc.connect", "line_number": 39, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 56, "usage_type": "call" }, { "api_name": "os.path.join", "line_number"...
161886295
import logging import struct from ingest import Ingest from appAux import loadFile import pyregf from AmCacheParser import _processAmCacheFile_StringIO import settings import ntpath logger = logging.getLogger(__name__) # Module to ingest AmCache data # File extension must be '.hve' # Hostname = File name # Note: Exact...
null
Ingest/amcache_raw_hive.py
amcache_raw_hive.py
py
3,875
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "ingest.Ingest", "line_number": 16, "usage_type": "name" }, { "api_name": "appAux.loadFile", "line_number": 28, "usage_type": "call" }, { "api_name": "pyregf.file", "li...
275352801
import matplotlib.pyplot as plt import json a = input("Enter file name: \n") if a.endswith(".json") is False: a = a + ".json" dic = {} with open(a, 'r') as file: dic = json.load(file) color = ['r', 'b', 'g'] for i, j in dic["classes"].items(): x1 = [] x2 = [] for k in j: x1.append(k[0]) ...
null
Code/Classification/print_cdata.py
print_cdata.py
py
432
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 20, "usage_type": "name" }, { "api_name": "matplotlib.pypl...
374062918
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Camera', fields=[ ('id', models.AutoField(seria...
null
bacheca/migrations/0001_initial.py
0001_initial.py
py
5,128
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 13, "usage_type": "call" }, ...
332603332
import os import sys import json import re import glob import click from cget.package import Package class Config: def __init__(self, new=False): self.file_name = 'cget.json' self.package_dir = os.path.abspath('packages') self.name = None self.options = {} self.configs = {}...
null
cget/config.py
config.py
py
4,617
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.abspath", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "json.dump", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_nu...
400579839
import maya.cmds as cmds def addMatchInfo( fkobj, ikobj ): cmds.addAttr( fkobj, ln='ikMp', at='double3' ) cmds.addAttr( fkobj, ln ='ikMpX', at='double', p='ikMp' ) cmds.addAttr( fkobj, ln ='ikMpY', at='double', p='ikMp' ) cmds.addAttr( fkobj, ln ='ikMpZ', at='double', p='ikMp' ) cmds.addAttr(...
null
rebind/baseRig/manual/biped/addMatchInfo.py
addMatchInfo.py
py
2,339
python
en
code
null
code-starcoder2
76
[ { "api_name": "maya.cmds.addAttr", "line_number": 5, "usage_type": "call" }, { "api_name": "maya.cmds", "line_number": 5, "usage_type": "name" }, { "api_name": "maya.cmds.addAttr", "line_number": 6, "usage_type": "call" }, { "api_name": "maya.cmds", "line_numb...
303035050
############################################################################## # # Copyright (c) 2002 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SO...
null
Zope3/tags/ZopeX3-3.0.0a2/src/zope/app/index/text/queries.py
queries.py
py
1,033
python
en
code
null
code-starcoder2
76
[ { "api_name": "zope.interface.implements", "line_number": 24, "usage_type": "call" }, { "api_name": "zope.app.index.interfaces.interfaces.IBatchedTextIndexQuery", "line_number": 24, "usage_type": "argument" } ]