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
170849544
from django.views.generic import TemplateView from LiutaioDiLeo import settings_dev as settings # from LiutaioDiLeo import settings from showcase.apps import ShowcaseConfig class BaseMixin(TemplateView): def get_context_data(self, **kwargs): context = super(BaseMixin, self).get_context_data() cont...
null
showcase/mixins.py
mixins.py
py
3,420
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.views.generic.TemplateView", "line_number": 7, "usage_type": "name" }, { "api_name": "showcase.apps.ShowcaseConfig.name", "line_number": 15, "usage_type": "attribute" }, { "api_name": "showcase.apps.ShowcaseConfig", "line_number": 15, "usage_type": "...
575193652
import argparse # for parsing arguments import serial # for reading from serial/usb port import os # for opening files import signal # for catching ctrl+c import sys # for catching ctrl+c import time # for sleep from datetime import datetime # for storing timestamps BAUDR...
null
usbtemp.py
usbtemp.py
py
3,045
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.exit", "line_number": 16, "usage_type": "call" }, { "api_name": "serial.Serial", "line_number": 22, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 48, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number":...
362055817
from pytest学习过程与作业.pytest01.Calculator import Calculator import pytest import yaml def get_add_datas(): try: with open("./datas/data_add.yaml", encoding='utf-8')as f: datas = yaml.safe_load(f) return datas # safe_load(stram),传入的是文件流,所以将打开的yam文件流传入; # 目的就是将y...
null
pytest学习过程与作业/pytest01/test_add.py
test_add.py
py
3,063
python
en
code
null
code-starcoder2
76
[ { "api_name": "yaml.safe_load", "line_number": 10, "usage_type": "call" }, { "api_name": "yaml.safe_load", "line_number": 16, "usage_type": "call" }, { "api_name": "yaml.safe_load", "line_number": 23, "usage_type": "call" }, { "api_name": "yaml.safe_load", "li...
593904811
#-*-coding:utf-8-*- from aip import AipImageClassify import os.path from aip import AipOcr from urllib import request from bs4 import BeautifulSoup from urllib.parse import quote import string import numpy as np import os,shutil from wxpy import * from aip import AipFace import base64 import shutil import...
null
wechat3.3.py
wechat3.3.py
py
12,311
python
en
code
null
code-starcoder2
76
[ { "api_name": "aip.AipImageClassify", "line_number": 50, "usage_type": "call" }, { "api_name": "aip.AipOcr", "line_number": 56, "usage_type": "call" }, { "api_name": "aip.AipFace", "line_number": 62, "usage_type": "call" }, { "api_name": "base64.b64encode", "l...
372114559
from random import randint, choice from argparse import ArgumentParser from sys import exit from sortalgos.insertsort import insertion from sortalgos.selsort import selection from sortalgos.qsort import quicksort from sortalgos.msort import mergesort from sortalgos.radixsort import radixsort parser = ArgumentParser() ...
null
clisort.py
clisort.py
py
1,640
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 21, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 25, "usage_type": "call" }, { "api_name": "random.randint", "line_...
244258760
import torch import torch.nn as nn import math import torch.nn.functional as F class PositionalEncoding(nn.Module): def __init__(self, d_model, dropout=0.1, max_len=5000): super(PositionalEncoding, self).__init__() self.dropout = nn.Dropout(p=dropout) self.scale = nn.Parameter(torch.ones(1)...
null
experiments_transformers/transformerDecoderConvPytorch.py
transformerDecoderConvPytorch.py
py
5,649
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.nn.Dropout", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
425066921
# -*- coding: utf-8 -*- """ Created on Fri Aug 30 14:30:17 2019 @author: jannett chabbeh """ # -*- coding: utf-8 -*- """ Created on Mon Jul 29 22:37:00 2019 @author: jannett chabbeh """ import pymongo import math import numpy as np import matplotlib.pyplot as plt from sklearn.svm import SVR from...
null
algorithmes/svr2.py
svr2.py
py
1,814
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymongo.MongoClient", "line_number": 22, "usage_type": "call" }, { "api_name": "sklearn.svm.SVR", "line_number": 48, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 60, "usage_type": "call" }, { "api_name": "matplotlib...
351954599
import sys import os import random import string import click from pyflow import WorkflowRunner class PreAnalyzer(WorkflowRunner): def __init__(self, run_dp): self.run_dp = run_dp def workflow(self): """ method invoked on class instance run call """ self.addTask("test", ...
null
omics_shotgun/src/preanalysis.py
preanalysis.py
py
1,065
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyflow.WorkflowRunner", "line_number": 9, "usage_type": "name" }, { "api_name": "random.choice", "line_number": 31, "usage_type": "call" }, { "api_name": "string.ascii_uppercase", "line_number": 31, "usage_type": "attribute" }, { "api_name": "string...
141992550
import socket import random import pickle import sys import os import time import gc import csv import math import torch import numpy as np from collections import defaultdict from beta_CROWN_solver import LiRPAConvNet, set_mip_refine_timeout from batch_branch_and_bound import relu_bab_parallel from utils import * fro...
null
src/bab_verification_general.py
bab_verification_general.py
py
30,436
python
en
code
null
code-starcoder2
76
[ { "api_name": "arguments.common_argparser", "line_number": 28, "usage_type": "call" }, { "api_name": "beta_CROWN_solver.set_mip_refine_timeout", "line_number": 41, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 54, "usage_type": "call" }, { "a...
176165713
""" :mod:`runinfo` -- RunInfo ====================================================== .. module:: runinfo :synopsis: RunInfo and Related Elements .. moduleauthor: Ahmad Barghout <abarghou@cisco.com> Jean-Benoit Aubin <jeaubin@cisco.com> This module contains the RunInfo class that is used by several AEReport e...
null
lib/python3.7/site-packages/pyats/aereport/runinfo/__init__.py
__init__.py
py
4,559
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyats.aereport.toplevel.aereportelement.AEReportElement", "line_number": 22, "usage_type": "name" }, { "api_name": "pyats.aereport.toplevel.simplelist.SimpleList", "line_number": 62, "usage_type": "call" }, { "api_name": "pyats.aereport.toplevel.simplelist.SimpleLi...
593006663
# For training parameters SG_winlen and SG_order import inspect import fit import signal import multiprocessing as mpc import numpy as np def init_worker(): signal.signal(signal.SIGINT, signal.SIG_IGN) ## Counts number of continuous trailing '1's # Used in the convergence criteria # # params ...
null
modules/optimizer.py
optimizer.py
py
12,941
python
en
code
null
code-starcoder2
76
[ { "api_name": "signal.signal", "line_number": 11, "usage_type": "call" }, { "api_name": "signal.SIGINT", "line_number": 11, "usage_type": "attribute" }, { "api_name": "signal.SIG_IGN", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.zeros", ...
127396459
import numpy as np import matplotlib.pyplot as plt N = 10000 M = 50 F = np.zeros([N,M]) # Nested list with M microstates for N systems S = np.zeros(N) # List with all sums. The sum is number of S+ P = np.zeros(M) # List of sums sorted for i in range(N): for j in range(M): F[i,j]...
null
FYS2160/Oblig1/oblig1m.py
oblig1m.py
py
1,266
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random.random", "line_numb...
281564780
from func import * from const import * from param import * import sys, pygame class groupe: def __init__(self,screen, nbPers): self.screen = screen self.Arial = pygame.font.SysFont("Arial", 15) self.pos = origin self.velo = False i=0 self.nbPers = nbPers self...
null
1.1/personne.py
personne.py
py
4,987
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.font.SysFont", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pygame.image.load", "line_number": 15, "usage_type": "call" }, { "api_name": "pygame.image", ...
467514904
import unittest import json from main import json_parser class JsonParserTestCase(unittest.TestCase): def test_get_class_id_from_perfectgym_classess_list(self): file = open('parser_test_data') json_test_data = json.loads(file.read()) file.close() classDetails = { "c...
null
tests/json_parser_test.py
json_parser_test.py
py
926
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 12, "usage_type": "call" }, { "api_name": "main.json_parser.get_class_id_from_perfectgym_classess_list", "line_number": 23, "usage_type": "call" ...
618539244
################################### # 请根据需求自己补充头文件、函数体输入参数。 import numpy as np import math import torch import torch.nn.functional as F ################################### # 2 Vectorization ################################### def vectorize_sumproducts(array1_1, array1_2): """ Takes two 1-dim...
null
hw0/homework_0.py
homework_0.py
py
5,601
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.sum", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 27...
387390975
#!/usr/bin/env python2 # coding: utf-8 # vim: set ts=4 sw=4 expandtab sts=4: # Copyright (c) 2011-2014 Christian Geier & contributors # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without...
null
khal/calendar_display.py
calendar_display.py
py
6,497
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.date.isocalendar", "line_number": 44, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 44, "usage_type": "attribute" }, { "api_name": "khal.aux.rstring", "line_number": 63, "usage_type": "call" }, { "api_name": "datetim...
168656411
from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import reverse, reverse_lazy from django.http import HttpResponseRedirect from django.shortcuts import render, render_to_response from django.template import RequestContext from django.views.generic import TemplateView, View, UpdateVi...
null
apps/behaviors/views.py
views.py
py
5,566
python
en
code
null
code-starcoder2
76
[ { "api_name": "apps.accounts.mixins.LoginRequiredMixin", "line_number": 15, "usage_type": "name" }, { "api_name": "django.views.generic.TemplateView", "line_number": 15, "usage_type": "name" }, { "api_name": "apps.behaviors.models.Behavior.objects.all", "line_number": 21, ...
234969914
import scipy as sp from scipy.signal import resample import matplotlib.pyplot as plt import sys sys.path.insert(0,'..') #from sinc_interp import * #from mapspec.sinc_interp2 import SincInterp from mapspec.sinc_interp import SincInterp x = sp.r_[-1:0.85:51j] dt = 0.5*(x[1] - x[0]) #try different functions #y = sp.sin(2...
null
examples/test_sincinterp.py
test_sincinterp.py
py
1,350
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.insert", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "scipy.r_", "line_number": 10, "usage_type": "attribute" }, { "api_name": "scipy.signal.resample", ...
522027723
# Copyright 2013 OpenStack Foundation # # 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...
null
keystone/credential/core.py
core.py
py
5,662
python
en
code
null
code-starcoder2
76
[ { "api_name": "keystone.common.conf", "line_number": 26, "usage_type": "attribute" }, { "api_name": "keystone.common", "line_number": 26, "usage_type": "name" }, { "api_name": "keystone.common.manager.Manager", "line_number": 31, "usage_type": "attribute" }, { "ap...
272488689
# uncompyle6 version 3.7.4 # Python bytecode 3.4 (3310) # 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/mediagoblin/tools/metadata.py # Compiled at: 2016-02-04 13:34:40 # Size of source mod 2**32: 6601 bytes from io import open import os...
null
pycfiles/mediagoblin-0.9.0-py3.4/metadata.cpython-34.py
metadata.cpython-34.py
py
5,296
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.compile", "line_number": 16, "usage_type": "call" }, { "api_name": "re.IGNORECASE", "line_number": 16, "usage_type": "attribute" }, { "api_name": "jsonschema.compat.str_types", "line_number": 22, "usage_type": "argument" }, { "api_name": "jsonsch...
307185311
import ctypes lib = ctypes.cdll.LoadLibrary('./exe/exe.so') import torch from torch.autograd import Function from torch.nn import Module import torch.nn as nn # ------------------------------------------------------------------------------ Clover Dot_4 Network class Dot4Module(Module): def forward(self, input1, ...
null
NN_Extensions/linear/dot.py
dot.py
py
3,360
python
en
code
null
code-starcoder2
76
[ { "api_name": "ctypes.cdll.LoadLibrary", "line_number": 3, "usage_type": "call" }, { "api_name": "ctypes.cdll", "line_number": 3, "usage_type": "attribute" }, { "api_name": "torch.nn.Module", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.autograd...
520895387
from datetime import datetime as dt import os import pandas as pd import re import sys sys.path.append(os.path.dirname(os.path.realpath(__file__))) import dynadb.db as dynadb import smsclass import volatile.memory as mem import volatile.static as static #---------------------------------------------------------------...
null
gsm/smsparser2/rain.py
rain.py
py
9,933
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number...
527689835
from django.urls import re_path, path from rest_framework import routers from accounting import views tax_router = routers.DefaultRouter() tax_router.register(r'^api/tax', views.TaxViewset) settings_router = routers.DefaultRouter() settings_router.register(r'^api/settings', views.AccountingSettingsAPIView) account_...
null
accounting/urls.py
urls.py
py
11,344
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 6, "usage_type": "call" }, { "api_name": "rest_framework.routers", "line_number": 6, "usage_type": "name" }, { "api_name": "accounting.views.TaxViewset", "line_number": 7, "usage_type": "attribute" }, ...
18722298
import numpy as np import torch from PIL import Image from bitarray import bitarray from torchvision.transforms.functional import to_tensor import schedule # device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') device = 'cpu' mask = 4 codir = str(mask) mapping_type = {0:'Center', 1:'Donut', 2:'Edge-Lo...
null
Data-Driven E2E Latency Estimation/1.Latency Sample Generation/1)Profiling and Modeling/(2)Services/b.Defect Detection/Train/1.auto-cnn/waferPredict.py
waferPredict.py
py
1,906
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.load", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.load", "line_number": 15, "usage_type": "call" }, { "api_name": "torchvision.transforms.functional.to_tensor", "line_number": 20, "usage_type": "call" }, { "api_name": "num...
501230744
# Copyright (c) 2016 Cisco Systems, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
null
networking_vpp/tests/unit/test_vppforwarder.py
test_vppforwarder.py
py
10,959
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.modules", "line_number": 20, "usage_type": "attribute" }, { "api_name": "mock.MagicMock", "line_number": 20, "usage_type": "call" }, { "api_name": "sys.modules", "line_number": 21, "usage_type": "attribute" }, { "api_name": "mock.MagicMock", ...
425563621
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved from typing import List, Tuple import torch from pytext.config import ConfigBase from pytext.data.roberta_tensorizer import RoBERTaTensorizer from pytext.data.tensorizers import LabelTensorizer from pytext.models.bert_classi...
null
pytext/models/roberta.py
roberta.py
py
5,657
python
en
code
null
code-starcoder2
76
[ { "api_name": "pytext.models.representations.transformer_sentence_encoder_base.TransformerSentenceEncoderBase", "line_number": 25, "usage_type": "name" }, { "api_name": "pytext.models.representations.transformer_sentence_encoder_base.TransformerSentenceEncoderBase.Config", "line_number": 28,...
332071116
import argparse import json import getpass from glueCodeTypes import ALInterfaceMode, SolverCode, LearnerBackend, SchedulerInterface, ProvisioningInterface, DatabaseMode def processGlueCodeArguments(): """Process command line arguments to GLUE code Raises: Exception: Failure to pass a JSON configurati...
null
GLUECode_Service/glueArgParser.py
glueArgParser.py
py
2,069
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "json.load", "line_number": 26, "usage_type": "call" }, { "api_name": "glueCodeTypes.ALInterfaceMode", "line_number": 32, "usage_type": "call" }, { "api_name": "glueC...
450840352
import flask from canonicalwebteam.discourse_docs import ( DiscourseAPI, DiscourseDocs, DocParser, ) from canonicalwebteam.search import build_search_view def init_docs(app, url_prefix): discourse_index_id = 1087 discourse_api = DiscourseAPI(base_url="https://discourse.jujucharms.com/") dis...
null
webapp/docs/views.py
views.py
py
1,125
python
en
code
null
code-starcoder2
76
[ { "api_name": "canonicalwebteam.discourse_docs.DiscourseAPI", "line_number": 15, "usage_type": "call" }, { "api_name": "canonicalwebteam.discourse_docs.DocParser", "line_number": 16, "usage_type": "call" }, { "api_name": "canonicalwebteam.discourse_docs.DiscourseDocs", "line_...
540767271
import urllib.request import urllib.parse import json content=0 while True: if content!='end': content=input() url='http://fanyi.youdao.com/translate?smartresult=dict&smartresult=rule' head={} head['User-Agent']='Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox...
null
翻译.py
翻译.py
py
1,025
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib.request.parse.urlencode", "line_number": 23, "usage_type": "call" }, { "api_name": "urllib.request.parse", "line_number": 23, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 23, "usage_type": "name" }, { "api_name"...
299008960
from django.shortcuts import get_object_or_404, redirect, render from django.http import HttpResponse, HttpResponseRedirect, response from ip_tracker.models import Network from django.urls import reverse, reverse_lazy from ip_tracker.forms import NetworkForm from .filters import NetworkFilter from django.contrib.auth...
null
ip_tracker/views.py
views.py
py
3,064
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.http.response", "line_number": 16, "usage_type": "name" }, { "api_name": "django.http.HttpResponse", "line_number": 16, "usage_type": "call" }, { "api_name": "django.http.response", "line_number": 17, "usage_type": "name" }, { "api_name": "cs...
166438396
from wechat.wechatViews.baseMsg import Msg from wechat.models import PersonalImg from django.conf import settings import requests import json class ImgMsg(Msg): def __init__(self, xmlData): super().__init__(xmlData) self.get_msg(xmlData) self.do_func() def get_msg(self, xmlData): ...
null
wechat/wechatViews/imgMsg.py
imgMsg.py
py
1,894
python
en
code
null
code-starcoder2
76
[ { "api_name": "wechat.wechatViews.baseMsg.Msg", "line_number": 7, "usage_type": "name" }, { "api_name": "django.conf.settings.ACCESS_TOKEN", "line_number": 21, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 21, "usage_type": "name" }, ...
489262876
import RPi.GPIO as GPIO import time from flask import Flask, render_template #GPIO Mode (BOARD / BCM) GPIO.setmode(GPIO.BCM) #set GPIO Pins GPIO_TRIGGER = 23 GPIO_ECHO = 24 #set GPIO direction (IN / OUT) GPIO.setup(GPIO_TRIGGER, GPIO.OUT) GPIO.setup(GPIO_ECHO, GPIO.IN) def distance(): # set Trigger to ...
null
combined.py
combined.py
py
1,393
python
en
code
null
code-starcoder2
76
[ { "api_name": "RPi.GPIO.setmode", "line_number": 8, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 8, "usage_type": "name" }, { "api_name": "RPi.GPIO.BCM", "line_number": 8, "usage_type": "attribute" }, { "api_name": "RPi.GPIO.setup", "line_n...
541048435
import pandas as pd import pygal as pg from pygal.style import NeonStyle def rangeage(): """pop indicator""" #----input----# Country = input() #----------------------------------------------------------------------------------# #-----read file-----# df_male = pd.read_csv("../../DATA Update/Male ag...
null
psit/project กลุ่มอื่น/Worldpopulation-master/Python/Pyramid Graph/range_age_fix_loop.py
range_age_fix_loop.py
py
2,773
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 20, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
270671280
""" SMI Types / Structure types which are not defined in :term:`X.690`. See `RFC 1155 section 3.2.3`_ for a description of the types and `RFC 3416`_ for the definition of the new types. .. _RFC 1155 section 3.2.3: https://tools.ietf.org/html/rfc1155#section-3.2.3 .. _RFC 3416: https://tools.ietf.org/html/rfc3416 """ ...
null
puresnmp/types.py
types.py
py
2,479
python
en
code
null
code-starcoder2
76
[ { "api_name": "x690.types.OctetString", "line_number": 19, "usage_type": "name" }, { "api_name": "x690.util.TypeInfo.APPLICATION", "line_number": 23, "usage_type": "attribute" }, { "api_name": "x690.util.TypeInfo", "line_number": 23, "usage_type": "name" }, { "api...
244921255
from train import train import os import sys import json import argparse import numpy as np import warnings from pathlib import Path from time import time import pickle from tabulate import tabulate from hyperopt import hp, fmin, tpe warnings.filterwarnings('ignore') # Add project source to path root = Path(os.path....
null
deeply/deeply.py
deeply.py
py
7,537
python
en
code
null
code-starcoder2
76
[ { "api_name": "warnings.filterwarnings", "line_number": 15, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "l...
108882236
""" Tests the evaluation of the potential for single and array-valued arguments for SHO, bump and KP potentials """ import numpy as np import pytest from basis.potential import Potential def test_getattr(): """Tests the attributes re-routing to potential.params. """ pot= Potential("potentials/kp.cfg") ...
null
tests/test_potential.py
test_potential.py
py
2,347
python
en
code
null
code-starcoder2
76
[ { "api_name": "basis.potential.Potential", "line_number": 11, "usage_type": "call" }, { "api_name": "basis.potential.Potential", "line_number": 14, "usage_type": "call" }, { "api_name": "basis.potential.Potential", "line_number": 17, "usage_type": "call" }, { "api...
224487750
# parser.py import requests from bs4 import BeautifulSoup import os import json # Python이 실행될 때 DJANGO_SETTINGS_MODULE이라는 환경 변수에 현재 프로젝트의 settings.py파일 경로를 등록합니다. os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webcrawl.settings") # 이제 장고를 가져와 장고 프로젝트를 사용할 수 있도록 환경을 만듭니다. import django django.setup() from django_crawl...
null
parse_job_recommend.py
parse_job_recommend.py
py
1,196
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ.setdefault", "line_number": 7, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.setup", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.dirname", ...
379683608
import cv2 import csv import glob import math import serial import imutils import numpy as np import cv2.aruco as aruco from imutils import paths #Settings CameraIndex = 0 CameraWidth = 720 CameraHeight = 360 CameraFPS = 60 #Functions def translate(value, leftMin, leftMax, rightMin, rightMax): leftSpan = leftMa...
null
RegularVersion/UrbanVer1.py
UrbanVer1.py
py
10,289
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.VideoCapture", "line_number": 32, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 33, "usage_type": "call" }, { "api_name": "serial.Serial", "line_number": 38, "usage_type": "call" }, { "api_name": "cv2.CAP_PROP_FPS", ...
249438275
"""dogs_site URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-...
null
dogs_site/dogs_site/urls.py
urls.py
py
1,439
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 21, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 21, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 21, "usage_type": "name" }, { "api_name...
587156984
# Copyright 2020 The SQLNet Company GmbH # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, ...
null
getml/communication.py
communication.py
py
23,269
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.JSONEncoder", "line_number": 76, "usage_type": "attribute" }, { "api_name": "json.JSONEncoder.default", "line_number": 113, "usage_type": "call" }, { "api_name": "json.JSONEncoder", "line_number": 113, "usage_type": "attribute" }, { "api_name":...
422830000
# This file is part of the Adblock Plus web scripts, # Copyright (C) 2006-2015 Eyeo GmbH # # Adblock Plus is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # Adblock Plus is distributed in the hope t...
null
sitescripts/extensions/android.py
android.py
py
1,330
python
en
code
null
code-starcoder2
76
[ { "api_name": "subprocess.check_output", "line_number": 25, "usage_type": "call" }, { "api_name": "xml.dom.minidom.parseString", "line_number": 27, "usage_type": "call" }, { "api_name": "xml.dom.minidom", "line_number": 27, "usage_type": "name" } ]
337510928
#!/usr/bin/python import MFRC522 import signal import ConfigParser import os import pygame Config = ConfigParser.ConfigParser() Config.read("/home/pi/MFRC522-python/rfidconfig.txt") #from https://wiki.python.org/moin/ConfigParserExamples def ConfigSectionMap(section): dict1 = {} options = Config.options(secti...
null
rfid2mp3.py
rfid2mp3.py
py
2,029
python
en
code
null
code-starcoder2
76
[ { "api_name": "ConfigParser.ConfigParser", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.init", "line_number": 26, "usage_type": "call" }, { "api_name": "pygame.mixer.init", "line_number": 27, "usage_type": "call" }, { "api_name": "pygame.mixer",...
445657597
import json import argparse p = argparse.ArgumentParser() p.add_argument("-f", "--file", help="Filename", required=True) p.add_argument("id", nargs="+", type=str, help="IR codes") args = p.parse_args() with open(args.file, "r") as f: records = json.load(f) for arg in args.id: if arg in records: code = recor...
null
decode.py
decode.py
py
766
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 4, "usage_type": "call" }, { "api_name": "json.load", "line_number": 11, "usage_type": "call" } ]
562524853
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from sklearn.linear_model import LinearRegression as LR from sklearn.linear_model import LogisticRegression as LGR from sklearn.model_selection import train_test_split from sklearn.metrics import classification_report as CR fro...
null
LogisticRegression/LogisticRegressionProject.py
LogisticRegressionProject.py
py
1,507
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 11, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 11, "usage_type": "name" }, { "api_na...
283726951
"""Data model source parameters.""" from pydantic import Field, HttpUrl, validator from .base import MappedModel, NamedModel, StrEnum class ParameterType(StrEnum): """Parameter type.""" DATE = "date" INTEGER = "integer" MULTIPLE_CHOICE = "multiple_choice" MULTIPLE_CHOICE_WITH_ADDITION = "multip...
null
components/shared_code/src/shared_data_model/meta/parameter.py
parameter.py
py
4,689
python
en
code
null
code-starcoder2
76
[ { "api_name": "base.StrEnum", "line_number": 8, "usage_type": "name" }, { "api_name": "base.NamedModel", "line_number": 21, "usage_type": "name" }, { "api_name": "pydantic.Field", "line_number": 25, "usage_type": "call" }, { "api_name": "pydantic.HttpUrl", "li...
395780605
# -*- coding: utf-8 -*- import json import time import logging import requests from requests import ReadTimeout from odoo.exceptions import UserError from odoo import api, fields, models from .ding_robot_api import DingtalkChatbot, ActionCard, FeedLink, CardItem _logger = logging.getLogger(__name__) MESSAGETYPE = [ ...
null
dindin_message/models/ding_robot.py
ding_robot.py
py
7,370
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "odoo.models.Model", "line_number": 21, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 21, "usage_type": "name" }, { "api_name": "odoo.fields.Bool...
60145227
#!/usr/bin/python3 # -*- coding: utf-8 -*- from .views import * from django.urls import path # place app url patterns here urlpatterns = [ # display reports path('report/', ReportHome.as_view(), name='report_home'), path('report_data/project/', ProjectReportData.as_view(), name='project_report_...
null
reports/urls.py
urls.py
py
622
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 13, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 15, "usage_type": "call" }, { "api_name": "django.urls.path",...
172508538
from sklearn.svm import LinearSVC , SVC from sklearn.metrics import accuracy_score # from m03_xor.py # 1. 데이터 x_data = [ [0,0], [1,0], [0,1], [1,1]] # -> xor 연산 // 같으면 0, 다르면 1 y_data = [ 0, 1, 1, 0] # 2. 모델 # model = LinearSVC() model = SVC() # 3. 훈련 model.fit(x_data, y_data) # 4. 평가 및 예측 x_test = [ [0,...
null
ML/m04_xor_solution.py
m04_xor_solution.py
py
636
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.svm.SVC", "line_number": 15, "usage_type": "call" }, { "api_name": "sklearn.metrics.accuracy_score", "line_number": 27, "usage_type": "call" } ]
72950242
import keyboard import pygame import os import time playing = False interrupt = False def pressed_letter(): for c in 'abcdefghijklmnopqrstuvwxyz': if keyboard.is_pressed(c): return True else: return False def play_parts(s): global playing global interr...
null
src/keyboard_music_file.py
keyboard_music_file.py
py
963
python
en
code
null
code-starcoder2
76
[ { "api_name": "keyboard.is_pressed", "line_number": 12, "usage_type": "call" }, { "api_name": "pygame.mixer.unpause", "line_number": 23, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 23, "usage_type": "attribute" }, { "api_name": "time.sleep...
248939303
# Copyright 2018, 2019, 2020 CNRS - Airbus SAS # Author: Florent Lamiraux, Joseph Mirabel, Alexis Nicolin # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # 1. Redistributions of source code must retain the above copy...
null
talos/manipulate_boxes/script_hpp.py
script_hpp.py
py
12,256
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 36, "usage_type": "call" }, { "api_name": "hpp.corbaserver.createContext", "line_number": 45, "usage_type": "call" }, { "api_name": "hpp.corbaserver.loadServerPlugin", "line_number": 48, "usage_type": "call" }, {...
257477332
import torch def train(model, trainloader, validationloader, epoches, optimizer, criterion, device): best_val = 0 val_l = len(validationloader) train_l = len(trainloader) for epoch in range(epoches): model.train() train_loss = 0.0 for i, data in enumerate(trainloader): image, depth = data ...
null
assignments/assignment4/.ipynb_checkpoints/train-checkpoint.py
train-checkpoint.py
py
1,178
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.no_grad", "line_number": 30, "usage_type": "call" } ]
111753242
import networkx as nx import numpy as np import matplotlib.pyplot as plt import scipy.sparse as sparse class SpectralGraph: def __init__(self, name): self.name = name def make_graph(self, *matrix): if not matrix: graph = nx.Graph() graph.add_edges_from([(1...
null
SpectralGraph.py
SpectralGraph.py
py
836
python
en
code
null
code-starcoder2
76
[ { "api_name": "networkx.Graph", "line_number": 13, "usage_type": "call" }, { "api_name": "networkx.from_numpy_matrix", "line_number": 18, "usage_type": "call" }, { "api_name": "networkx.spectral_layout", "line_number": 24, "usage_type": "call" }, { "api_name": "ne...
430860777
# from tsne import * from tsne import bh_sne # from tsne_orig import tsne import numpy as np import torch import matplotlib.pyplot as plt # could use argparse... modelpath = '/export02/data/peterd/Projects/Tedlium/model/models/' tier = 'combined' modelname = 'tedlium_yesdurs_'+tier+'_setting_6' modelfile = modelpath+m...
null
model/compute_tsne_embeddings.py
compute_tsne_embeddings.py
py
1,877
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.RandomState", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 16, "usage_type": "attribute" }, { "api_name": "torch.load", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.load", ...
246942072
# In[] import pandas as pd df = pd.read_csv('D:/idea_workspace/mici-learning/1.4-1.5/housing.data.txt', header=None, sep='\s+') # '\s+'表示匹配任意多个空白字符/空格 df.columns = ['CRIM', 'ZN', 'INDUS', 'CHAS', 'NOX', 'RM', 'AGE', 'DIS', 'RAD', 'TAX', 'PTRATIO', 'B', '...
null
1.7/boston.py
boston.py
py
1,064
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 3, "usage_type": "call" }, { "api_name": "seaborn.pairplot", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.tight_layout", "line_number": 18, "usage_type": "call" }, { "api_name": "matplo...
460745300
from tkinter import * from tkinter import ttk from PIL import Image, ImageTk from csv import * tujuan = [] with open('dom_nondom.csv') as file_csv: reader_csv = reader(file_csv, delimiter=',') for row in reader_csv: if row[0] != 'NO': tujuan.append(row) waktu = [] with open('w...
null
main_windows.py
main_windows.py
py
6,614
python
en
code
null
code-starcoder2
76
[ { "api_name": "PIL.Image.open", "line_number": 39, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 39, "usage_type": "name" }, { "api_name": "PIL.ImageTk.PhotoImage", "line_number": 40, "usage_type": "call" }, { "api_name": "PIL.ImageTk", "li...
187598116
from rest_framework.reverse import reverse from rest_framework.status import HTTP_200_OK, HTTP_201_CREATED, HTTP_400_BAD_REQUEST from thenewboston.third_party.pytest.asserts import assert_objects_vs_dicts def test_confirmation_block_list(client, confirmation_blocks, django_assert_max_num_queries): with django_ass...
null
v1/confirmation_blocks/tests/confirmation_block.py
confirmation_block.py
py
1,327
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.reverse.reverse", "line_number": 9, "usage_type": "call" }, { "api_name": "rest_framework.status.HTTP_200_OK", "line_number": 11, "usage_type": "name" }, { "api_name": "thenewboston.third_party.pytest.asserts.assert_objects_vs_dicts", "line_numbe...
262634544
import sqlite3 import random import datetime from neu_news import get_news from stu_org import get_stu_org from neu_news_interface import get_content from crawling import crawling_data import datetime import os class visitor: def __init__(self): self.pid = [] self.id = 0 # 账号 ...
null
edition4.0.py
edition4.0.py
py
20,178
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlite3.connect", "line_number": 21, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 77, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 81, "usage_type": "call" }, { "api_name": "os.getcwd", "line_n...
170739143
# -*- coding:utf-8 -*- # The second implementation of the balanced version of ESGR-mix (in the paper, I only report the result of the # first implementation of ESGR-mix (setting FLAGS.balanced to True). The difference is the composition of the # training samples of the new classes. In the first implementation, onl...
null
cifar_train_esgr_mix_balanced_v2.py
cifar_train_esgr_mix_balanced_v2.py
py
42,702
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.set_random_seed", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 17, "usage_type": "attribute" }, { "api_name": "tensor...
631026200
# -*- coding: utf-8 -*- """ Created on Thu Apr 16 17:41:53 2020 @author: NGG6KOR """ import numpy as np import cv2 #from numba import jit def get_pred(image, W, H, input_w, input_h, net, ln, input_conf, input_thres): blob = cv2.dnn.blobFromImage(image, 1 / 255.0, (input_w, input_h), swapRB=False, crop=False) ...
null
CV/object_detection/pre-trained_inferencing/SD/people_detection_v2.py
people_detection_v2.py
py
2,877
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.dnn.blobFromImage", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.dnn", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.argmax", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.array", "li...
401447154
import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from sense_emu import SenseHat import time from time import asctime sense = SenseHat() fromaddr = "saeid69.rezaei@gmail.com" toaddr = "saeid70.rezaei@gmail.com" msg = MIMEMultipart() msg['From'] = fromaddr msg['To'] = t...
null
SendEmail.py
SendEmail.py
py
758
python
en
code
null
code-starcoder2
76
[ { "api_name": "sense_emu.SenseHat", "line_number": 8, "usage_type": "call" }, { "api_name": "email.mime.multipart.MIMEMultipart", "line_number": 12, "usage_type": "call" }, { "api_name": "email.mime.text.MIMEText", "line_number": 22, "usage_type": "call" }, { "api...
395557453
# Starting to Crawl from urllib.request import urlopen from bs4 import BeautifulSoup import datetime import random import re #Traversing a single domain ''' random.seed(datetime.datetime.now()) def getLinks(articleUrl): html = urlopen("https://en.wikipedia.org"+articleUrl) bsObj = BeautifulSoup(html, "html.pa...
null
Ch3.py
Ch3.py
py
4,415
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.seed", "line_number": 69, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 69, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 69, "usage_type": "attribute" }, { "api_name": "re.compile",...
380561040
import unittest,time,os import smtplib from email.mime.text import MIMEText from email.header import Header from email.mime.multipart import MIMEMultipart from email.mime.base import MIMEBase from email import encoders from HTMLTestRunner import HTMLTestRunner from test_case.login.login_spec import LoginSpec # from te...
null
runtest_meng.py
runtest_meng.py
py
9,692
python
en
code
null
code-starcoder2
76
[ { "api_name": "email.mime.multipart.MIMEMultipart", "line_number": 58, "usage_type": "call" }, { "api_name": "email.header.Header", "line_number": 60, "usage_type": "call" }, { "api_name": "email.mime.text.MIMEText", "line_number": 63, "usage_type": "call" }, { "a...
291276988
from binascii import unhexlify import qrcode.image.svg try: from urllib.parse import urlencode except ImportError: from urllib import urlencode try: from unittest.mock import patch, Mock, ANY, call except ImportError: from mock import patch, Mock, ANY, call from django import forms from django.conf im...
null
tests/tests.py
tests.py
py
31,347
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.auth.models.User", "line_number": 20, "usage_type": "name" }, { "api_name": "django.contrib.auth.get_user_model", "line_number": 20, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects.create_user", "line_number": 44, ...
556961439
from rest_framework import serializers from .models import Propietario, Inquilino, Servicio from ..authentication.serializers import ProfileSerializer class PropietarioSerializer(serializers.ModelSerializer): user = ProfileSerializer(read_only=True) owner = serializers.StringRelatedField(many=True, required=...
null
server/profiles/serializers.py
serializers.py
py
2,576
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 7, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 7, "usage_type": "name" }, { "api_name": "authentication.serializers.ProfileSerializer", "line_number": 8, ...
313102777
# diversity model import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers from keras.models import Model from keras.layers import Input, Add, Activation, Dropout, Flatten, Dense, Conv2D from keras.layers.convolutional import Convolution2D, MaxPooling2D, AveragePooling2D, ZeroPadding2D f...
null
diversity_models.py
diversity_models.py
py
19,762
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.backend.image_data_format", "line_number": 18, "usage_type": "call" }, { "api_name": "keras.backend", "line_number": 18, "usage_type": "name" }, { "api_name": "keras.layers.normalization.BatchNormalization", "line_number": 20, "usage_type": "call" }...
52478019
import pygame, os, random pygame.init() #kolory SKYBLUE = pygame.color.THECOLORS['skyblue'] DARKRED = pygame.color.THECOLORS['darkred'] LIGHTRED = pygame.color.THECOLORS['palevioletred'] DARKGREEN = pygame.color.THECOLORS['darkgreen'] BLACK = pygame.color.THECOLORS['black'] LIGHTGREEN = pygame.color.THECOLORS['lightgre...
null
game_module.py
game_module.py
py
4,007
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.init", "line_number": 2, "usage_type": "call" }, { "api_name": "pygame.color", "line_number": 4, "usage_type": "attribute" }, { "api_name": "pygame.color", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pygame.color", "line...
41696499
""" Implementation of the data structure "Binary Search Tree" """ from typing import Optional, Union from dataclasses import dataclass @dataclass class SuccessfulStatus: """ Custom class for Successful cases """ message: str @staticmethod def code(): """ Get code of the statu...
null
binary_tree/binary_tree.py
binary_tree.py
py
4,790
python
en
code
null
code-starcoder2
76
[ { "api_name": "dataclasses.dataclass", "line_number": 9, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 24, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 44, "usage_type": "name" }, { "api_name": "typing.Option...
187247120
import csv from time import sleep from string import Template from utils.bep_helper import * from utils.lmdirect_helper import * from utils.send_udp import send_udp from utils.logger import logger from gooey import Gooey, GooeyParser log = logger(__file__) message_frame_start = 'AA 55 ' # Message Frame S...
null
togs_udp_sender.py
togs_udp_sender.py
py
5,796
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.logger.logger", "line_number": 10, "usage_type": "call" }, { "api_name": "string.Template", "line_number": 15, "usage_type": "call" }, { "api_name": "string.Template", "line_number": 19, "usage_type": "call" }, { "api_name": "string.Template",...
564507440
import numpy as np import cv2 # 画像の読み込み img = cv2.imread("AllJapan1983.bmp") height,width = img.shape[:2] # グレースケールに変換 gry = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # 画像の書き出し cv2.imwrite("gry.bmp",gry) ret,binary = cv2.threshold(gry,30,255,cv2.THRESH_BINARY) cv2.imwrite("binary.bmp",binary) #print(...
null
hozon.py
hozon.py
py
1,587
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 10, "usage_type": "attribute" }, { "api_name": "cv2.imwrite", "lin...
629546560
from flask import Flask, render_template import mariadb app = Flask(__name__) @app.route("/", methods=['GET', 'POST']) def index(): return render_template('index.html') @app.route('/login', methods=['GET', 'POST']) def login(): return "This is the login page" @app.route('/database', methods=['GET', 'POST']...
null
Docker-Webserver/flaskServer/webserver/app.py
app.py
py
722
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 9, "usage_type": "call" }, { "api_name": "mariadb.connect", "line_number": 18, "usage_type": "call" } ]
359036135
#Importing libraries. The same will be used throughout the article. import numpy as np import pandas as pd import random import matplotlib.pyplot as plt #from IPython import get_ipython #ipy = get_ipython() #if ipy is not None: # ipy.run_line_magic('matplotlib', 'inline') #from matplotlib.pylab import rcParams #rcPa...
null
lasso_poli.py
lasso_poli.py
py
4,426
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.column_stack", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot...
331078843
from klein import Klein, Response import json from spider_runner import SpiderRunner from transport_scraper.transport_scraper.spiders.ip_test import IpTestSpider from transport_scraper.transport_scraper.\ spiders.poezdato_blablacars import PoezdatoBlablacarsSpider from transport_scraper.transport_scraper.\ spid...
null
app.py
app.py
py
2,678
python
en
code
null
code-starcoder2
76
[ { "api_name": "klein.Klein", "line_number": 14, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 21, "usage_type": "call" }, { "api_name": "klein.Response", "line_number": 22, "usage_type": "call" }, { "api_name": "spider_runner.SpiderRunner", ...
294579901
from django.conf.urls import patterns, url from cardbox import card_views from .views import PracticeCardUpdate urlpatterns = patterns('', url(r'^(?P<deck_id>\d+)$', card_views.CardList.as_view(template_name="cardbox/card/card_list.html"), na...
null
deckglue/cardurls.py
cardurls.py
py
1,160
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.patterns", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "cardbox.card_views.CardList.as_view", "line_number": 7, "usage_type": "call" }, { "a...
378005517
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2016-03-25 21:01:12 # @Author : chensijia (2350543676@qq.com) # @Version : 0.0.0 # @Style : Python3.5 # # @Description: import os from save_load_result import save_result, load_result import pickle import numpy as np from create_features_from_land_operate_...
null
create_features_log_update.py
create_features_log_update.py
py
4,887
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 42, "usage_type": "call" }, { "api_name": "os.path", "line_number": 42, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 42, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number...
179644367
import importlib import logging import os import sys import time from typing import List, Any import requests import twitter from instagram import InstagramAPI, InstagramClientError, InstagramAPIError from instagram.helper import datetime_to_timestamp from mastodon import Mastodon from mastodon.Mastodon import Mastodo...
null
moa/worker.py
worker.py
py
7,105
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.time", "line_number": 27, "usage_type": "call" }, { "api_name": "moa.models.WorkerStat", "line_number": 28, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 30, "usage_type": "call" }, { "api_name": "os.environ", "line...
260005961
import logging from logging import Logger, StreamHandler, FileHandler FORMATTER = logging.Formatter('%(asctime)s | %(name)s | %(levelname)s | %(message)s') def get_logger(logger_name: str, file: str = None) -> Logger: """Create logger. :param str logger_name: logger name :param file: Path to file that ...
null
utils/logger_creater.py
logger_creater.py
py
773
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.Formatter", "line_number": 5, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 16, "usage_type": "attribute" }, { "api_name": "logging.StreamH...
69569898
import tensorflow as tf import matplotlib.pyplot as plt import numpy as np # print(tf.__version__) # prints the version of tensorflow # prepare the data mnist = tf.keras.datasets.mnist # x_train represents the features which in this case are the pixel values of the 28 x 28 images of the digits 0-9 # y_train is the l...
null
HandWrittenDigitClassifier/Image Classifier.py
Image Classifier.py
py
3,177
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.keras", "line_number": 8, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.utils.normalize", "line_number": 26, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 26, "usage_type": "attribute" }, { "api_n...
18616602
# Copyright 2017 Neural Networks and Deep Learning lab, MIPT # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
null
deeppavlov/dataset_readers/ontonotes_reader.py
ontonotes_reader.py
py
2,214
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "deeppavlov.core.data.dataset_reader.DatasetReader", "line_number": 27, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 37, "usage_type": "call" }, { "...
139406379
#!/usr/bin/env python3 import rospy import sys from statemachine import StateMachine, State from robot.robot import Robot from std_msgs.msg import String from my_sys import log, SysCheck class SoccerMachine(StateMachine): wait = State('Wait', initial=True) forward = State('Forward') back = State('Back') ...
null
strategy/script/core.py
core.py
py
1,376
python
en
code
null
code-starcoder2
76
[ { "api_name": "statemachine.StateMachine", "line_number": 9, "usage_type": "name" }, { "api_name": "statemachine.State", "line_number": 10, "usage_type": "call" }, { "api_name": "statemachine.State", "line_number": 11, "usage_type": "call" }, { "api_name": "statem...
558497034
from matplotlib.pyplot import plasma import torch.nn as nn import torch.nn.functional as F from woollylib.models.model import get_norm_layer, WyConv2d from woollylib.models.transform.spatial_transformer import SpatialTransformer class WyBlock(nn.Module): expansion = 2 def __init__(self, in_planes, planes, n...
null
woollylib/models/custom/custom_resnet.py
custom_resnet.py
py
4,171
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "woollylib.models.model.WyConv2d", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.nn....
442541363
import requests import json from requests.auth import HTTPDigestAuth from utils.errors import check_error def run(addr, op_id, psswd, timeout, print_timeout, cmd_args=None): url = 'http://' + addr + '/cgi/chk' params = {} start_id = getattr(cmd_args, 'id', None) if start_id: params['id'] = sta...
null
commands/chk_sync.py
chk_sync.py
py
762
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.auth.HTTPDigestAuth", "line_number": 13, "usage_type": "call" }, { "api_name": "utils.errors.check_error", "line_number": 14, "usage_type": "call" }, { "api_name": "js...
314814013
from selenium import webdriver from lxml import etree import time import pymongo aaa=[3,10,11,15,25]#消除错误 for j in aaa: # for j in range(1,31): url='https://shopee.tw/daily_discover/'+str(j)+'/' driver=webdriver.PhantomJS() driver.get(url) print("正在抓取第%d页-----------------"%j) time.sleep(2) # wit...
null
xiapipachong1.py
xiapipachong1.py
py
1,187
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.PhantomJS", "line_number": 9, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 9, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 12, "usage_type": "call" }, { "api_name": "lxml.etree.H...
293136088
"""Device tracker for BMW Connected Drive vehicles.""" import logging import math from homeassistant.util import slugify from . import DOMAIN as BMW_DOMAIN _LOGGER = logging.getLogger(__name__) def setup_scanner(hass, config, see, discovery_info=None): """Set up the BMW tracker.""" accounts = hass.data[BMW...
null
bmw_connected_drive/device_tracker.py
device_tracker.py
py
7,407
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 29, "usage_type": "attribute" }, { "api_name": "math.sqrt", "line_number": 41, "usage_type": "call" }, { "api_name": "math.sin", "line_number":...
95888066
#!/usr/bin/env python3 import sys import glob import pandas as pd import matplotlib.pyplot as plt import numpy as np #Check the sequence def wrong_character(seq): bad_char = {} for al in seq: if al not in 'GCAT': if al in bad_char: bad_char[ al ] += 1 else: bad_char[ al ] = 1 ...
null
count_kmers2.py
count_kmers2.py
py
5,468
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.DataFrame", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 43, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 45, "usage_type": "call" }, { "api_name": "matplotlib.pyp...
411953900
from os import path from setuptools import setup def get_readme_content(): """Get content of README.md file Returns: str: README.md content """ readme_dir = path.abspath(path.dirname(__file__)) with open(path.join(readme_dir, "README.md"), encoding="utf-8") as fd: lo...
null
setup.py
setup.py
py
1,411
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.abspath", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_numb...
509599972
#!/usr/bin/env python3 import os import pytest import requests from remote_server import NodeGraphQL from validate import check_query_f def make_request(url, query): print('Sending request to the local federated server') payload = {'query': query} resp = requests.post(url, json=payload) return resp ...
null
server/tests-py/test_apollo_federation.py
test_apollo_federation.py
py
2,597
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.post", "line_number": 13, "usage_type": "call" }, { "api_name": "remote_server.NodeGraphQL", "line_number": 29, "usage_type": "call" }, { "api_name": "remote_server.NodeGraphQL", "line_number": 54, "usage_type": "call" }, { "api_name": "rem...
257265467
# encoding=utf8 import argparse from libs.log import get_logger from models.gsxt.reg_number import RegNumberRange, RegNumber from models.gsxt.enterprise import EnterpriseInfo logger = get_logger(__file__) def main(args): logger.info('args=%s', args) for o in RegNumberRange.select().where( RegNu...
null
apps/gsxt/reg_number_range_show.py
reg_number_range_show.py
py
1,712
python
en
code
null
code-starcoder2
76
[ { "api_name": "libs.log.get_logger", "line_number": 9, "usage_type": "call" }, { "api_name": "models.gsxt.reg_number.RegNumberRange.select", "line_number": 14, "usage_type": "call" }, { "api_name": "models.gsxt.reg_number.RegNumberRange", "line_number": 14, "usage_type": ...
545182379
from django.conf.urls import patterns, include, url from django.contrib import admin from airspacecontrol import views, settings admin.autodiscover() urlpatterns = patterns('', # url(r'^$', 'airspacecontrol.views.home', name='home'), # url(r'^airspacecontrol/', include('airspacecontrol.foo.urls')), url(r'...
null
airspacecontrol/urls.py
urls.py
py
1,030
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 5, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 5, "usage_type": "name" }, { "api_name": "django.conf.urls.patterns", "line_number": 7, "usage_type": "call" }, { "api...
511842824
from GM_PHD_Filter import set_model, GM_PHD_Filter import numpy as np import numpy.matlib import matplotlib.pyplot as plt plt.ion() fig = plt.figure() model = set_model() # Starting target states (positions , velocities) m_start1 = np.array([250, 250, 0, 0]).reshape(4,1) m_start2 = np.array([10,-10, 5, -5]).reshape(4...
null
GM-PHD-Filter/GM-PHD-Filter-Python/GM_PHD_Filter_demo.py
GM_PHD_Filter_demo.py
py
5,001
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.ion", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 5, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 6, "usage_type": "call" }, { "api_name": "matplot...
391986583
from idbase.views import login, logout import pytest @pytest.fixture def req(rf, session): """A login request with an authenticated user""" return _get_request(rf, '/login/?next=/home', session=session) def test_login_redirect(req): response = login(req) assert response.status_code == 302 assert...
null
tests/test_views.py
test_views.py
py
1,876
python
en
code
null
code-starcoder2
76
[ { "api_name": "pytest.fixture", "line_number": 5, "usage_type": "attribute" }, { "api_name": "idbase.views.login", "line_number": 12, "usage_type": "call" }, { "api_name": "idbase.views.login", "line_number": 19, "usage_type": "call" }, { "api_name": "idbase.views...
232488535
''' 学习pytorch 和 学习 alexnet ''' import torch import torch.nn as nn from torchvision import transforms,utils from torch.autograd import Variable import torch.nn.functional as F from collections import OrderedDict import numpy as np import pdb # 建立模型 class AlexNet(nn.Module): # 初始化 def __init__(self,num_cla...
null
alexnet.py
alexnet.py
py
1,818
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 15, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.nn", "lin...
85400509
"""empty message Revision ID: 08e7990daaaa Revises: Create Date: 2018-03-21 21:05:48.553693 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '08e7990daaaa' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto gene...
null
migrations/versions/08e7990daaaa_.py
08e7990daaaa_.py
py
3,453
python
en
code
null
code-starcoder2
76
[ { "api_name": "alembic.op.create_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
397946308
import os import json import glob from collections import OrderedDict import numpy as np import pandas as pd from scipy import optimize from scipy.stats import pearsonr from sklearn.feature_extraction import DictVectorizer from sklearn.linear_model import LassoLars, LinearRegression from nilearn.datasets import neur...
null
topic_models/decoding.py
decoding.py
py
6,102
python
en
code
null
code-starcoder2
76
[ { "api_name": "nilearn.datasets.load_mni152_brain_mask", "line_number": 24, "usage_type": "call" }, { "api_name": "nilearn.input_data.NiftiMasker", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 27, "usage_type": "call" }, { ...
407082650
"""Terraform outputs loader.""" import functools import json import logging import os from typing import Any, Dict, Optional import dynaconf logger = logging.getLogger(__name__) TFVARS_FILEPATH = os.path.join(os.path.dirname(__file__), "terraform.tfvars.json") TFOUTS_FILEPATH = os.path.join(os.path.dirname(__file__)...
null
src/sentiment_flanders/config/terraform_loader.py
terraform_loader.py
py
2,192
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 11, "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": "os.path.dirname", "li...
174035785
"""empty message Revision ID: fc86fa9a2b44 Revises: d6c4d9fba0fe Create Date: 2021-02-24 14:21:58.364066 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'fc86fa9a2b44' down_revision = 'd6c4d9fba0fe' branch_labels = None depends_on = None def upgrade(): # ...
null
migrations/versions/fc86fa9a2b44_.py
fc86fa9a2b44_.py
py
2,452
python
en
code
null
code-starcoder2
76
[ { "api_name": "alembic.op.create_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
73152067
# -*- coding: utf-8 -*- import hashlib import requests from bs4 import BeautifulSoup def parseDate(xh,pwd): data = { '__VIEWSTATE' : '39TXG0FuP+7HTWF0Y6SIqw+OEqcmnCJKoPn3bnu99UBy9IFs4stPqW+Sqow1ZMdr', 'userbh' : '', 'pass' : '', 'cw' : '', 'xzbz' : '1' } ...
null
test.py
test.py
py
2,118
python
en
code
null
code-starcoder2
76
[ { "api_name": "hashlib.md5", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.session", "line_number": 56, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 59, "usage_type": "call" } ]
579439724
"""Provides classes for working with help topics.""" from sqlalchemy import Column, Integer, ForeignKey, or_, func from sqlalchemy.orm import relationship from attrs_sqlalchemy import attrs_sqlalchemy from .base import Base, NameMixin, TextMixin, PermissionsMixin @attrs_sqlalchemy class HelpTopicKeyword(Bas...
null
server/server/db/help.py
help.py
py
3,358
python
en
code
null
code-starcoder2
76
[ { "api_name": "base.Base", "line_number": 10, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 14, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 14, "usage_type": "argument" }, { "api_name": "sqlalchemy.Foreign...
171507800
""" Client Responsibility: 1. Send messages to server Connectivity: 1. RM 2. Servers (replication) """ from socket import * import json import sys import threading import time class ServerThread(threading.Thread): def __init__(self, server_socket, server_message, server_address, server_n...
null
automated_client_passive.py
automated_client_passive.py
py
6,549
python
en
code
null
code-starcoder2
76
[ { "api_name": "threading.Thread", "line_number": 18, "usage_type": "attribute" }, { "api_name": "threading.Thread.__init__", "line_number": 20, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 20, "usage_type": "attribute" }, { "api_name": ...
5806811
import random import numpy as np import pandas as pd import os from time import sleep import gym import gym_gazeboros_ac # Constants ENV_NAME = 'gazeborosAC-v0' N_EPISODES = 100 STEPS_PER_EPISODE = 45 ADDON_PREV_DATA = True if __name__ == '__main__': env = gym.make(ENV_NAME).unwrapped env.set_agent(0) ...
null
far_ws/src/follow_ahead_rl/scripts/hinn_data_collector.py
hinn_data_collector.py
py
1,880
python
en
code
null
code-starcoder2
76
[ { "api_name": "gym.make", "line_number": 19, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 45, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 56, "usage_type": "call" }, { "api_name": "os.path", "line_number": 56, ...
230962863
import json import math from pathlib import Path from typing import List, Tuple class Ladder: DIVISION_NAMES = ['quantum', 'overclocked', 'processor', 'circuit', 'transistor', 'abacus', 'babbage', 'colossus', 'eniac', 'ferranti'] def __init__(self, bots: List[str], division_size: int=4,...
null
autoleagueplay/ladder.py
ladder.py
py
3,185
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.List", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 17, "usage_type": "name" }, { "api_name": "math.ceil", "line_number": 24, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 26...