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
290683619
# -*- coding: utf-8 -*- # # Copyright (C) 2019 CERN. # # invenio-app-ils is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """ILS mail tasks.""" import json from celery import shared_task from celery.utils.log import get_task_logger fr...
null
invenio_app_ils/mail/tasks.py
tasks.py
py
3,162
python
en
code
null
code-starcoder2
66
[ { "api_name": "celery.utils.log.get_task_logger", "line_number": 21, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 37, "usage_type": "call" }, { "api_name": "invenio_mail.tasks.send_email.apply_async", "line_number": 41, "usage_type": "call" }, { ...
414980964
"""blogๅˆ ้™คhotๅญ—ๆฎต Revision ID: deffd0a14af1 Revises: a6157c4664fe Create Date: 2019-12-05 17:01:29.453285 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revision = 'deffd0a14af1' down_revision = 'a6157c4664fe' branch_labels = None depend...
null
migrations/versions/deffd0a14af1_blogๅˆ ้™คhotๅญ—ๆฎต.py
deffd0a14af1_blogๅˆ ้™คhotๅญ—ๆฎต.py
py
724
python
en
code
null
code-starcoder2
66
[ { "api_name": "alembic.op.drop_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "alembic.op.add_column", "line_number": 27, "usage_type": "call" }, { "api_name": "alembic.op", ...
57346078
from utils.make_index import make_index def q_parse(sentence): s_split = sentence.split() ret_dic = {'and' : [s_split[0]], 'or': [], 'not' : []} i = 1 while (i < len(s_split)): if (s_split[i] in ['and','or','not'] and i != len(s_split)): ret_dic[s_split[i]].append(s_split[i+1]) ...
null
utils/queries.py
queries.py
py
3,434
python
en
code
null
code-starcoder2
66
[ { "api_name": "utils.make_index.make_index", "line_number": 29, "usage_type": "call" } ]
479660437
from PIL import Image, ImageOps import filterx import utility import os class Picture: def __init__(self, image): self.image = image self.current_size = image.size self.options() def options(self): print() print("-------------------") print(" Select Choice ") print("-------------------") print(...
null
processor.py
processor.py
py
3,743
python
en
code
null
code-starcoder2
66
[ { "api_name": "filterx.Filter", "line_number": 53, "usage_type": "call" }, { "api_name": "utility.savechanges", "line_number": 69, "usage_type": "call" }, { "api_name": "utility.savechanges", "line_number": 78, "usage_type": "call" }, { "api_name": "utility.savech...
639969731
import wx app = wx.App() frame= wx.Frame(None) panel1 = wx.Panel(frame) panel2 = wx.Panel(frame) panel3 = wx.Panel(frame) panel4 = wx.Panel(frame) sizer1 = wx.BoxSizer(wx.HORIZONTAL) panel1.SetSizer(sizer1) label1= wx.StaticText(frame, label='์„ฑ์  ์ž…๋ ฅ ์‹œ์Šคํ…œ') sizer1.Add(label1) sizer2= wx.StaticBoxSizer(w...
null
ํŒŒ์ด์ฌ/wxpythonpracticelast03.py
wxpythonpracticelast03.py
py
1,277
python
en
code
null
code-starcoder2
66
[ { "api_name": "wx.App", "line_number": 3, "usage_type": "call" }, { "api_name": "wx.Frame", "line_number": 4, "usage_type": "call" }, { "api_name": "wx.Panel", "line_number": 6, "usage_type": "call" }, { "api_name": "wx.Panel", "line_number": 7, "usage_typ...
47313023
import ast import configparser import gzip import inspect import io import json import os import os.path as osp import pickle import socket import sys import tarfile import urllib.request import numpy as np import pandas as pd import strax export, __all__ = strax.exporter() __all__ += ['straxen_dir', 'first_sr1_run',...
null
straxen/common.py
common.py
py
8,643
python
en
code
null
code-starcoder2
66
[ { "api_name": "strax.exporter", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "li...
531134927
# Copyright 2018, National Technology & Engineering Solutions of Sandia, LLC # (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. # Government retains certain rights in this software. import logging import pprint import arrow import bson import flask import pymongo import samlab.web.app.handlers...
null
samlab/web/app/handlers/experiment.py
experiment.py
py
2,891
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "samlab.web.app.require_permissions", "line_number": 29, "usage_type": "call" }, { "api_name": "samlab.web.app.database.database.experiments.find", "line_number": 31, "usage_type":...
571999672
from flask import Flask from os import environ app=Flask(__name__) @app.route("/") @app.route("/hello") def say_hi(): return "Hello World!" @app.route("/hello/<name>") def hello_person(name): html=""" <h1> Hello {} </h1> <p> Here's a picture of a kitten. Awwww.....
null
hello_world.py
hello_world.py
py
760
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 36, "usage_type": "name" }, { "api_name": "os.environ", "line_number": 37, "usage_type": "name" } ]
572069134
import sys, getopt, os.path from typing import List import utils def usage(): print('Simple Lathe') print('------------------------------------') print('Usage: lathe <options> <.obj file>*') print('<options>:') print('\t-s, --steps=') print('\t-a, --angle=') print('\t-r, --rotation=[x, y,...
null
lathe/src/lathe.py
lathe.py
py
2,870
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.List", "line_number": 18, "usage_type": "name" }, { "api_name": "getopt.getopt", "line_number": 23, "usage_type": "call" }, { "api_name": "getopt.GetoptError", "line_number": 24, "usage_type": "attribute" }, { "api_name": "sys.exit", "lin...
252720678
# coding: utf-8 # ะ ะฐะฑะพั‚ะฐ ั ะ‘ะ”. # (c) alexbft 2011 from pymongo import Connection from pymongo.objectid import ObjectId conn = None last_id = None def getconn(): ' ะ’ะพะทะฒั€ะฐั‰ะฐะตั‚ ั‚ะตะบัƒั‰ะตะต ัะพะตะดะธะฝะตะฝะธะต ั ะฑะด. ' global conn if not conn: conn = Connection() return conn def db(): ...
null
tornado/db.py
db.py
py
542
python
en
code
null
code-starcoder2
66
[ { "api_name": "pymongo.Connection", "line_number": 16, "usage_type": "call" } ]
519518700
import pdb from pygments.token import ( Comment, Error, Generic, Keyword, Name, Number, Operator, String, Token, Whitespace ) TERMINAL_COLORS = { Token: ('', ''), Whitespace: ('lightgray', 'darkgray'), Comment: ('lightgray', 'darkgray'), Comment.Preproc: ('teal', 'turquoise'), Keyword: ('d...
null
.pdbrc.py
.pdbrc.py
py
1,347
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygments.token.Token", "line_number": 9, "usage_type": "name" }, { "api_name": "pygments.token.Whitespace", "line_number": 10, "usage_type": "name" }, { "api_name": "pygments.token.Comment", "line_number": 11, "usage_type": "name" }, { "api_name": "...
475234767
import json from django.http import HttpResponse from django.shortcuts import render_to_response from django.contrib.auth.decorators import login_required from django.template import RequestContext from django.views.decorators.csrf import csrf_exempt from django.conf import settings import requests # Create your vie...
null
job/views.py
views.py
py
3,412
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "django.conf.settings.HELIOS_HOST_MASTER", "line_number": 16, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 16, "usage_type": "name" }, { "ap...
435776344
import xml.etree.ElementTree as ET import xml.dom.minidom as minidom def xml_view(element): s = ET.tostring(element) print(minidom.parseString(s).toprettyxml()) root = ET.Element('inventory') cheese = ET.Element('cheese') cheese.attrib['id'] = 'c01' name = ET.SubElement(cheese, 'name') name.text = 'Caerphilly...
null
Python_projects/Networking/ch1/tree.py
tree.py
py
357
python
en
code
null
code-starcoder2
66
[ { "api_name": "xml.etree.ElementTree.tostring", "line_number": 5, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 5, "usage_type": "name" }, { "api_name": "xml.dom.minidom.parseString", "line_number": 6, "usage_type": "call" }, { "api...
316970065
# -*- coding: utf-8 -*- """ Zurich Instruments LabOne Python API Example Demonstrate how to connect to a Zurich Instruments UHF Lock-in Amplifier and upload and run an AWG program. """ # Copyright 2016 Zurich Instruments AG from __future__ import print_function import os import time import textwrap import numpy as n...
null
Drivers/python_libs/linux/zhinst/examples/uhf/example_awg.py
example_awg.py
py
16,577
python
en
code
null
code-starcoder2
66
[ { "api_name": "zhinst.utils.utils.create_api_session", "line_number": 64, "usage_type": "call" }, { "api_name": "zhinst.utils.utils", "line_number": 64, "usage_type": "attribute" }, { "api_name": "zhinst.utils", "line_number": 64, "usage_type": "name" }, { "api_na...
540759629
""" Test to verify concurrent creation and deletion of multiple PVCs """ import logging import pytest from ocs_ci.ocs import constants, ocp, exceptions from ocs_ci.utility.utils import run_async from ocs_ci.framework.testlib import tier1, ManageTest from ocs_ci.ocs.resources.pod import get_ceph_tools_pod from ocs_ci.o...
null
tests/manage/test_pvc_concurrent_deletion_creation.py
test_pvc_concurrent_deletion_creation.py
py
5,040
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 20, "usage_type": "call" }, { "api_name": "tests.helpers.create_unique_resource_name", "line_number": 39, "usage_type": "call" }, { "api_na...
236401933
import torch import os import time from torch import autograd from blox.basic_types import map_dict from gcp.rec_planner_utils.checkpointer import CheckpointHandler from blox.utils import dummy_context, RecursiveAverageMeter from blox import AttrDict from gcp.rec_planner_utils.gcp_trainer import GCPTrainer from blox....
null
gcp/train_planner_model.py
train_planner_model.py
py
6,867
python
en
code
null
code-starcoder2
66
[ { "api_name": "warnings.simplefilter", "line_number": 15, "usage_type": "call" }, { "api_name": "gcp.rec_planner_utils.gcp_trainer.GCPTrainer", "line_number": 18, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 39, "usage_type": "call" }, { "a...
377557238
import sys import subprocess import csv import os from PyQt5.QtWidgets import QApplication, QLabel, QPushButton, QMainWindow, QPlainTextEdit, QComboBox from PyQt5.QtGui import QFont from PyQt5.QtCore import QThread class thread_video(QThread): def __init__(self): QThread.__init__(self) def __del__(sel...
null
app.py
app.py
py
15,379
python
en
code
null
code-starcoder2
66
[ { "api_name": "PyQt5.QtCore.QThread", "line_number": 10, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.QThread.__init__", "line_number": 12, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.QThread", "line_number": 12, "usage_type": "name" }, { "api_name"...
357017170
from django.shortcuts import render from django.http import HttpResponse from listings.models import ListingModel from realtors.models import RealtorModel from listings.choices import price_choices, bedroom_choices, state_choices # Create your views here. def index(request): listings = ListingModel.objects.order...
null
pages_app/views.py
views.py
py
978
python
en
code
null
code-starcoder2
66
[ { "api_name": "listings.models", "line_number": 11, "usage_type": "name" }, { "api_name": "listings.models.ListingModel.objects.order_by", "line_number": 11, "usage_type": "call" }, { "api_name": "listings.models.ListingModel.objects", "line_number": 11, "usage_type": "at...
147148461
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf import NiftiDataset import os import VNet import math import datetime # tensorflow app flags FLAGS = tf.app.flags.FLAGS tf.app.flags.DEFINE_string('data_dir', './dat...
null
train.py
train.py
py
18,236
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow.app", "line_number": 14, "usage_type": "attribute" }, { "api_name": "tensorflow.app.flags.DEFINE_string", "line_number": 16, "usage_type": "call" }, { "api_name": "tensorflow.app", "line_number": 16, "usage_type": "attribute" }, { "api_na...
417895867
import sentencepiece as spm import fastText as ft import numpy as np sp = spm.SentencePieceProcessor() dirname = "/home/pragma/development/deeplearning/" #mytext = input("Text 1: ") mytext = "Cengiz Hanโ€™ฤฑn bรผyรผk amacasฤฑ Kutua, bu hakarete ร‡in รผzerine ve Tatarlara bir dizi saldฤฑrฤฑ dรผzenleyerek cevap verdi ve bu akฤฑnlar ...
null
finddiff/finddiff.py
finddiff.py
py
1,763
python
en
code
null
code-starcoder2
66
[ { "api_name": "sentencepiece.SentencePieceProcessor", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy...
513759874
# -*- coding: utf-8 -*- # # Copyright 2015 Simone Campagna # # 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...
null
packages/sheru/hosts_config.py
hosts_config.py
py
984
python
en
code
null
code-starcoder2
66
[ { "api_name": "config.Config", "line_number": 26, "usage_type": "name" }, { "api_name": "host.Host", "line_number": 27, "usage_type": "name" } ]
646569958
""" Continuous wavelet transform module for Python. Includes a collection of routines for wavelet transform and statistical analysis via FFT algorithm. This module references to the numpy, scipy and pylab Python packages. """ from __future__ import division import numpy as np import numpy.fft as fft from numpy.lib.pol...
null
land_wavelet/oned.py
oned.py
py
7,825
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.sqrt", "line_number": 30, "usage_type": "call" }, { "api_name": "scipy.special.gamma", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 31, "usage_type": "call" }, { "api_name": "scipy.special.orthogonal.her...
99870619
# coding=utf-8 from lxml.etree import LIBXML_VERSION import unittest.mock as mock import pytest import requests from csbot.util import simple_http_get #: Test encoding handling; tests are (url, content-type, body, expected_title) encoding_test_cases = [ # (These test case are synthetic, to test various encoding...
null
csbot/test/test_plugin_linkinfo.py
test_plugin_linkinfo.py
py
7,145
python
en
code
null
code-starcoder2
66
[ { "api_name": "lxml.etree.LIBXML_VERSION", "line_number": 97, "usage_type": "name" }, { "api_name": "pytest.mark.bot", "line_number": 129, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 129, "usage_type": "attribute" }, { "api_name": "pytest.f...
50975474
#!/usr/bin/env python3 from http.server import BaseHTTPRequestHandler, HTTPServer import time import urllib import git import json from subprocess import call import os import logging import subprocess #defaults logging.basicConfig(filename='pull.log',level=logging.DEBUG,format='%(asctime)s %(message)s') hostName = "...
null
pull.py
pull.py
py
2,437
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 14, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.info", "...
609777462
from tkinter import * from tkinter import ttk import cv2 from datetime import datetime, date, time import imutils import numpy as np from centroidtracker import CentroidTracker import pymysql from PIL import ImageTk import time import os elapsedTime = 0 protopath = "MobileNetSSD_deploy.prototxt" modelpath = "Mobile...
null
uitest.py
uitest.py
py
10,345
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.dnn.readNetFromCaffe", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.dnn", "line_number": 19, "usage_type": "attribute" }, { "api_name": "cv2.dnn", "line_number": 21, "usage_type": "attribute" }, { "api_name": "centroidtracker.Ce...
262454463
#coding:utf-8 from django.core.urlresolvers import resolve from django.shortcuts import render, redirect, HttpResponse from crm.permission_dict import perm_dic def perm_check(*args, **kwargs): request = args[0] resolve_url_obj = resolve(request.path) curr_url_name = resolve_url_obj.url_name # ๅฝ“ๅ‰url็š„url_...
null
crm/permissions.py
permissions.py
py
1,916
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.core.urlresolvers.resolve", "line_number": 10, "usage_type": "call" }, { "api_name": "crm.permission_dict.perm_dic.items", "line_number": 14, "usage_type": "call" }, { "api_name": "crm.permission_dict.perm_dic", "line_number": 14, "usage_type": "name...
532553741
from nifty_stock_list import * import talib import pandas_datareader.data as pdr from talib import abstract import pymongo import datetime from pandas import DataFrame import pandas as pd nfty_50 = nifty() client = pymongo.MongoClient() mydb = client['NIFTY50'] for stk in nfty_50: print(stk) ...
null
strategy/macd_rsi.py
macd_rsi.py
py
3,378
python
en
code
null
code-starcoder2
66
[ { "api_name": "pymongo.MongoClient", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 19, "usage_type": "call" }, { "api_name": "talib.abstract.MACD", "line_number": 24, "usage_type": "call" }, { "api_name": "talib.abstra...
217998161
from unittest import TestCase from player import Player from devtools import DevTools from referee import Referee from manager import Manager from player_interface import TournamentUpdateType class TestManager(TestCase): # An overridden Manager for testing purposes. Lets use control the size of the board so we can t...
null
robs/Fish/Admin/test_manager.py
test_manager.py
py
8,662
python
en
code
null
code-starcoder2
66
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "name" }, { "api_name": "manager.Manager", "line_number": 12, "usage_type": "name" }, { "api_name": "referee.Referee", "line_number": 21, "usage_type": "call" }, { "api_name": "player.Player", ...
193134755
import numpy as np import torch from torch.nn import functional as F from scipy.stats import norm alpha = 1e-1 length_scale = 10 sigma_0 = 0.1 def conf_build(model, x, center_): ''' build GP for c :param model: the DNN model, needs classifier() as the last layer :param x: the data in re...
null
Operational-Calibration/CIFAR-10/GP_build.py
GP_build.py
py
5,433
python
en
code
null
code-starcoder2
66
[ { "api_name": "sklearn.metrics.pairwise.pairwise_distances", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.argmin", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.nn.functional.softmax", "line_number": 27, "usage_type": "call" }, { ...
461695911
import discord from discord.ext import commands import datetime from urllib import parse, request import re bot = commands.Bot(command_prefix='<', description="Bot General") @bot.command() async def ping(ctx): await ctx.send('pong') @bot.command() async def infoserver(ctx): embed...
null
app.py
app.py
py
4,460
python
en
code
null
code-starcoder2
66
[ { "api_name": "discord.ext.commands.Bot", "line_number": 12, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 12, "usage_type": "name" }, { "api_name": "discord.Embed", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime....
145485706
import os import csv import argparse import cv2 import numpy as np import sklearn from sklearn.model_selection import train_test_split DEFAULT_BASE_PATH = os.path.join('.', 'data') def generator(samples, imgdir, batch_size=32): num_samples = len(samples) while 1: # Loop forever so the generator never termin...
null
train.py
train.py
py
6,283
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sklearn.utils.shuffle", "line_number": 15, "usage_type": "call" }, { "api_name": "sklearn.utils", "li...
254049004
import matplotlib.pyplot as plt FILE_PATH = "python_crash_course/project2/squares_plot.png" x_values = range(1, 1001) y_values = [x**2 for x in x_values] plt.style.use("classic") fig, ax = plt.subplots() ax.scatter(x_values, y_values, c="green", s=10) # Zdefiniowanie tytuล‚u wykresu i etykiet osi ax.set_title("Kwadr...
null
python_crash_course/project2/scatter_squares.py
scatter_squares.py
py
726
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 8, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 8, "usage_type": "name" }, { "api_name"...
405489116
import json # 0 -> Multiple degil 1 -> Ja nein 2 -> checkbox class ChatHandler: profile = '' def setupParameters(self, user): self.profile = user.profile def getResult(self): # Wie werden Funktionen benutzen. switcher = { "sonstiges": self.sonstiges, "zu...
null
ChatBot/ChatHandler.py
ChatHandler.py
py
6,728
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.dumps", "line_number": 32, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 40, "usage_type": "call" } ]
231083428
import pytest from textwrap import dedent from awsudo.config import Config, NoRoleForProfileError, CredentialResolver class TestConfig: def test_getCredentials(self, tmpdir): tmpdir.join('credentials').write(dedent('''\ [default] aws_access_key_id = ACCESSKEY aws_secr...
null
awsudo/test/test_config.py
test_config.py
py
4,648
python
en
code
null
code-starcoder2
66
[ { "api_name": "textwrap.dedent", "line_number": 10, "usage_type": "call" }, { "api_name": "awsudo.config.Config", "line_number": 20, "usage_type": "call" }, { "api_name": "textwrap.dedent", "line_number": 41, "usage_type": "call" }, { "api_name": "awsudo.config.Co...
111288913
import os import time import torch import torch.nn.parallel import torchvision import torchvision.transforms as Transforms #from matplotlib import pyplot as plt from Modified_CNN import TSN_model from transforms import * import argparse #--------------------Communication import-------------------------- from commu...
null
polymerization.py
polymerization.py
py
6,572
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.no_grad", "line_number": 78, "usage_type": "call" }, { "api_name": "Modified_CNN.TSN_model", "line_number": 99, "usage_type": "call" }, { "api_name": "torch.lo...
172998657
from PyQt4.QtCore import QVariant from PyQt4.QtGui import QStandardItemModel, QStandardItem #, QTextCursor from connector import Connector __author__ = "Johannes Steudle" __date__ = "$Feb 13, 2011 2:34:51 PM$" __version__ = '2011-02-15' class Model: """ class model """ def __init__(self, view, config...
null
src/model.py
model.py
py
4,611
python
en
code
null
code-starcoder2
66
[ { "api_name": "PyQt4.QtGui.QStandardItemModel", "line_number": 23, "usage_type": "call" }, { "api_name": "connector.Connector", "line_number": 28, "usage_type": "call" }, { "api_name": "PyQt4.QtGui.QStandardItem", "line_number": 37, "usage_type": "call" }, { "api_...
610590655
import urllib2 import urllib from lxml import etree import re from base64 import b64decode import string printable = set(string.printable) def filterFun(s): return str(filter(lambda x: x in printable, s)) def get(url, params={}): request = urllib2.Request(url + '?' + urllib.urlencode(params)) request.add_...
null
resources/lib/putlocker.py
putlocker.py
py
5,264
python
en
code
null
code-starcoder2
66
[ { "api_name": "string.printable", "line_number": 8, "usage_type": "attribute" }, { "api_name": "urllib2.Request", "line_number": 13, "usage_type": "call" }, { "api_name": "urllib.urlencode", "line_number": 13, "usage_type": "call" }, { "api_name": "urllib2.urlopen...
130687199
# -*- coding: utf-8 -*- from django.shortcuts import render_to_response,render from django.http import HttpResponseRedirect from django.core.mail import send_mail from contact.forms import ContactForm def contact(request): if request.method == 'POST': form = ContactForm(request.POST) if form.is_va...
null
zoro/contact/views.py
views.py
py
942
python
en
code
null
code-starcoder2
66
[ { "api_name": "contact.forms.ContactForm", "line_number": 10, "usage_type": "call" }, { "api_name": "django.core.mail.send_mail", "line_number": 13, "usage_type": "call" }, { "api_name": "django.http.HttpResponseRedirect", "line_number": 20, "usage_type": "call" }, { ...
249645468
#Import requred libraries: from selectorlib import Extractor import requests import json import csv import mysql.connector #Open a file with "w' (write) mode f = open("data_output.csv", "w") #Init our writer obj writer = csv.writer(f) #Writer our first row (for headers) writer.writerow(["asin", "title...
null
SCRIPTS/selector_example.py
selector_example.py
py
1,904
python
en
code
null
code-starcoder2
66
[ { "api_name": "csv.writer", "line_number": 12, "usage_type": "call" }, { "api_name": "selectorlib.Extractor.from_yaml_file", "line_number": 18, "usage_type": "call" }, { "api_name": "selectorlib.Extractor", "line_number": 18, "usage_type": "name" }, { "api_name": ...
39143145
import numpy as np from .cosmology import Cosmology from.halo_bias_base import HaloBiasBase from ..auxiliary.window_functions import WindowFunctions from ..auxiliary.integration_helper import IntegrationHelper from scipy.interpolate import interp2d, RectBivariateSpline import warnings import mcfit from scipy.integrate...
null
theory/halo_bias_new.py
halo_bias_new.py
py
8,198
python
en
code
null
code-starcoder2
66
[ { "api_name": "halo_bias_base.HaloBiasBase", "line_number": 14, "usage_type": "name" }, { "api_name": "numpy.nan", "line_number": 33, "usage_type": "attribute" }, { "api_name": "numpy.nan", "line_number": 34, "usage_type": "attribute" }, { "api_name": "numpy.meshg...
625026697
#!/usr/bin/env python import hashlib import argparse BLOCKSIZE = 65536 hasher_md5 = hashlib.md5() hasher_sha1 = hashlib.sha1() parser = argparse.ArgumentParser(description='hey') parser.add_argument('-file', dest='afile', help='Please choose a file') args = parser.parse_args() if not args.afile: parser.print_he...
null
langs/python/tests/hashing/hasher.py
hasher.py
py
622
python
en
code
null
code-starcoder2
66
[ { "api_name": "hashlib.md5", "line_number": 7, "usage_type": "call" }, { "api_name": "hashlib.sha1", "line_number": 8, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" } ]
476005579
import cv2 import numpy as np import imutils from PIL import Image from matplotlib import pyplot as plt import timeit # code taken from https://www.pyimagesearch.com/2015/01/26/multi-scale-template-matching-using-python-opencv/ # parameters are: form (the form to be read), columnToFind (individual column h...
null
template_matching/Sample_Sheets/Version 1.75/template_matching.py
template_matching.py
py
14,904
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.imread", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 16, "usage_type": "attribute" }, { "api_name": "cv2.Canny", "line...
453078143
import pandas as pd import matplotlib.pyplot as plt import numpy as np from datetime import datetime, timedelta from tqdm import tqdm # In[1]: tqdm.pandas() def parse_date(x): try: return datetime.strptime(x, "%Y-%m-%d %H:%M:%S.%f+00") except: return datetime.strptime(x, "%Y-%m-%d %H:%M:%S+0...
null
prepare_data.py
prepare_data.py
py
6,393
python
en
code
null
code-starcoder2
66
[ { "api_name": "tqdm.tqdm.pandas", "line_number": 9, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 9, "usage_type": "name" }, { "api_name": "datetime.datetime.strptime", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime...
560200719
#!/usr/bin/env python3 import gym import ptan import argparse import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from tensorboardX import SummaryWriter from lib import common from lib.common import * from lib.rainbow_model import RainbowDQN def calc_l...
null
rainbow_dqn_plain_buffer.py
rainbow_dqn_plain_buffer.py
py
5,389
python
en
code
null
code-starcoder2
66
[ { "api_name": "lib.common.unpack_batch", "line_number": 21, "usage_type": "call" }, { "api_name": "lib.common", "line_number": 21, "usage_type": "name" }, { "api_name": "torch.tensor", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.tensor", "l...
271317688
from PySide2.QtWidgets import QApplication, QMainWindow, QPushButton, QPlainTextEdit, QMessageBox class Status: def __init__(self): # ๅˆ›ๅปบไธป็ช—ๅฃ self.window = QMainWindow() self.window.resize(500, 400) # ็ช—ๅฃ็š„ๅฏๅŠจๆ—ถ็š„ๅคงๅฐ self.window.move(200, 100) # ็ช—ๅฃ็š„ๅฏๅŠจๆ—ถ็š„ๅฎšไฝ,ๅทฆไธŠ่ง’ๅฎšไฝๆณ•,x=200,y=100 self....
null
dealExcel/UI/tongji.py
tongji.py
py
1,671
python
en
code
null
code-starcoder2
66
[ { "api_name": "PySide2.QtWidgets.QMainWindow", "line_number": 7, "usage_type": "call" }, { "api_name": "PySide2.QtWidgets.QPlainTextEdit", "line_number": 13, "usage_type": "call" }, { "api_name": "PySide2.QtWidgets.QPushButton", "line_number": 19, "usage_type": "call" }...
288898857
from django.shortcuts import get_object_or_404, render from django.http import HttpResponse from breeze.models import App def store(request): application_list = App.objects.order_by('-created') context = {'application_list': application_list} return render(request, 'breeze/store.html', context) def...
null
scriptbook/breeze/views.py
views.py
py
475
python
en
code
null
code-starcoder2
66
[ { "api_name": "breeze.models.App.objects.order_by", "line_number": 8, "usage_type": "call" }, { "api_name": "breeze.models.App.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "breeze.models.App", "line_number": 8, "usage_type": "name" }, { "...
123005325
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jan 3 13:15:52 2018 @author: nguyentran """ from IoTSE_framework.serv_type_storage.services import AbsStorageService as AbsStorageService from pymongo import MongoClient class StorageService(AbsStorageService): def __init__(self, mongo_host = "loc...
null
component_services_refactored/reading_searcher_service_refactor/reading_storage_service.py
reading_storage_service.py
py
1,704
python
en
code
null
code-starcoder2
66
[ { "api_name": "IoTSE_framework.serv_type_storage.services.AbsStorageService", "line_number": 11, "usage_type": "name" }, { "api_name": "pymongo.MongoClient", "line_number": 14, "usage_type": "call" } ]
318156250
#!/usr/bin/env python import requests import re import csv def get_all(): headers = {"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) \ AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36"} results = [] for x in tickers: newrow = [] try: newrow...
null
yf_regex.py
yf_regex.py
py
1,466
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 19, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 20, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 23, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 26...
59669751
# Copyright: see copyright.txt import settings from collections import deque import pdb import helpers.vcommon as CM from .z3_wrap import Z3Wrapper from .symbolic_types import symbolic_type, SymbolicType from .constraint import Constraint, PathToConstraint mlog = CM.getLogger(__name__, settings.LOGGER_LEVEL) DBG = pd...
null
symbolic/explore.py
explore.py
py
4,741
python
en
code
null
code-starcoder2
66
[ { "api_name": "helpers.vcommon.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "helpers.vcommon", "line_number": 11, "usage_type": "name" }, { "api_name": "settings.LOGGER_LEVEL", "line_number": 11, "usage_type": "attribute" }, { "api_name": "...
163279407
import json f = open('jd_task.txt','r') data = f.readlines() data =json.loads(data[0]) tmp_data= {'order':[],'key_search':[],'key_word':[],'page':[],'platform':[],'sort':[],'kind':[]} tmp_result = {'platform':[],'sort':[],'kind':[],'page':[],'html':[]} for item in data['result']: if item['platform'] not in tmp_resu...
null
test/ๅฐ†ไบŒ็บง้กต้ข็š„ๆ•ฐๆฎๆๅ–ๅ‡บๆฅ.py
ๅฐ†ไบŒ็บง้กต้ข็š„ๆ•ฐๆฎๆๅ–ๅ‡บๆฅ.py
py
1,806
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.loads", "line_number": 4, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 43, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 49, "usage_type": "call" } ]
354763256
# -*- coding: utf-8 -*- # Copyright (c) 2019, Silvio Peroni <essepuntato@gmail.com> # # Permission to use, copy, modify, and/or distribute this software for any purpose # with or without fee is hereby granted, provided that the above copyright notice # and this permission notice appear in all copies. # # THE SOFTWARE I...
null
exercises/development/intermediate/exercise_2.py
exercise_2.py
py
1,419
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.deque", "line_number": 30, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 44, "usage_type": "call" } ]
312031869
import mock from taskw.warrior import TaskWarriorBase from .base import TaskManagerTest from inthe_am.taskmanager.taskwarrior_client import TaskwarriorClient class TestTaskwarriorClient(TaskManagerTest): def setUp(self): TaskWarriorBase.load_config = mock.MagicMock(name='load_config') self.tw = T...
null
inthe_am/taskmanager/tests/test_taskwarrior_client.py
test_taskwarrior_client.py
py
1,121
python
en
code
null
code-starcoder2
66
[ { "api_name": "base.TaskManagerTest", "line_number": 8, "usage_type": "name" }, { "api_name": "taskw.warrior.TaskWarriorBase.load_config", "line_number": 10, "usage_type": "attribute" }, { "api_name": "taskw.warrior.TaskWarriorBase", "line_number": 10, "usage_type": "name...
166987230
#!python3 # Simpy model for a basic app. # The app periodically obtains device data # from the middleware and prints all collected data. # It also sends commands to the device. # # Author: Neha Karanjkar from __future__ import print_function import os, sys import threading from queue import Queue import simpy impo...
null
streetlight_demo/app.py
app.py
py
8,248
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.path.insert", "line_number": 23, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "communication_interfa...
89919427
#!/usr/bin/python3.6 import os import matplotlib matplotlib.use('Agg') import datasets import models import utils import tensorflow as tf import numpy as np import matplotlib.pyplot as plt from datetime import datetime from sklearn.manifold import TSNE os.environ["CUDA_VISIBLE_DEVICES"]="3" config = tf.ConfigProto() ...
null
AEl2/test_ael2.py
test_ael2.py
py
4,755
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.use", "line_number": 5, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 15, "usage_type": "attribute" }, { "api_name": "tensorflow.ConfigProto", "line_number": 16, "usage_type": "call" }, { "api_name": "tensorflow.place...
77120885
#!/usr/local/bin/python3.6 from ipico.reader import FileReader from ipico.race import Registration from ipico.race import Race from datetime import date date = date(2016, 2, 20) reg = Registration("2016_Tritonman_DL", date, 10) tin = FileReader("transition_in") tout = FileReader("transition_out") fin = FileReader("fini...
null
tests/race_test.py
race_test.py
py
1,338
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.date", "line_number": 6, "usage_type": "name" }, { "api_name": "ipico.race.Registration", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 7, "usage_type": "argument" }, { "api_name": "ipico.reader.Fil...
586587994
import codecs import itertools import random import numpy as np affdata = codecs.open(r'G:\Paper\Copy\Data\Author_DisambSet_corrected.dat','r','UTF-8') fw = codecs.open(r"G:\Paper\Copy\Data\result.txt", "w",encoding="utf-8") # ่พ“ๅ‡บ็ป“ๆžœไปฅๆฃ€้ชŒ็จ‹ๅบ dataFile = codecs.open(r'G:\Paper\Copy\Data\file_remove_shannon.txt','r',"UTF-8")...
null
affiliation.py
affiliation.py
py
8,262
python
en
code
null
code-starcoder2
66
[ { "api_name": "codecs.open", "line_number": 6, "usage_type": "call" }, { "api_name": "codecs.open", "line_number": 7, "usage_type": "call" }, { "api_name": "codecs.open", "line_number": 8, "usage_type": "call" }, { "api_name": "itertools.combinations", "line_n...
391911886
#!/bin/env python3 # coding:utf-8 """ ljk 20161116(update 20170510) This script should be put in crontab in every web server.Execute every n minutes. Collect nginx access log, process it and insert the result into mysql. """ import os import re import subprocess import time import pymongo from sys import argv, exit fro...
null
log_analyse_parall.py
log_analyse_parall.py
py
16,381
python
en
code
null
code-starcoder2
66
[ { "api_name": "time.time", "line_number": 54, "usage_type": "call" }, { "api_name": "time.time", "line_number": 56, "usage_type": "call" }, { "api_name": "functools.wraps", "line_number": 52, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_n...
471973962
'''' Real Time Face Recogition ==> Each face stored on dataset/ dir, should have a unique numeric integer ID as 1, 2, 3, etc ==> LBPH computed model (trained faces) should be on trainer/ dir Based on original code by Anirban Kar: https://github.com/thecodacus/Face-Recognition Developed by ...
null
FacialRecognition/03_face_recognition.py
03_face_recognition.py
py
3,043
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.face.LBPHFaceRecognizer_create", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.face", "line_number": 19, "usage_type": "attribute" }, { "api_name": "cv2.CascadeClassifier", "line_number": 22, "usage_type": "call" }, { "api_name":...
404634681
# -- coding: utf-8 -- import os import json # Settings fixture_directory = "fixtures" def load_fixture(fixture_name): fixture_location = os.path.dirname(__file__) path_to_file = os.path.join( fixture_location, fixture_directory, fixture_name ) with open(path_to_file, "r")...
null
os2mo_data_import/tests/helpers.py
helpers.py
py
392
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.dirname", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
122036196
import cv2 import numpy as np from time import time from utils import load_cutout_to_contours_and_fill, preprocess_frame, draw_contours, extract_diff_from_bg logo = cv2.imread("logo.png") sig = cv2.imread("sig.png") logo = cv2.resize(logo, None, fx=0.2, fy=0.2, interpolation=cv2.INTER_AREA) sig = cv2.resize(sig, None...
null
webcam_playground.py
webcam_playground.py
py
4,040
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.INTER_AREA", "line_number": 9, ...
555848780
from __future__ import print_function import numpy as np import matplotlib.pyplot as plt from scipy.ndimage import convolve from sklearn import datasets, cross_validation, metrics from sklearn.neural_network import BernoulliRBM from sklearn.pipeline import Pipeline from sknn.mlp import Classifier, Convolution, Layer ...
null
Autoencoder and Restricted Bolzman Machine/rbm_conv_part2.py
rbm_conv_part2.py
py
1,602
python
en
code
null
code-starcoder2
66
[ { "api_name": "sklearn.datasets.fetch_mldata", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 13, "usage_type": "name" }, { "api_name": "numpy.asarray", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.mi...
447841406
from django.conf.urls import url, include from . import views from rest_framework import routers from .api import * from knox import views as knox_views from django.urls import path app_name = 'uspl' #router = routers.DefaultRouter() #router.register('api/users', UserViewSet, 'api_users') urlpatterns = [ # Auth ...
null
uspl/urls.py
urls.py
py
10,506
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 15, "usage_type": "call" }, { "api_name": "django.conf.urls.include", "line_number": 15, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 16, "usage_type": "call" }, { "api_name": "django.url...
277937605
# -*- coding: UTF-8 -*- ''' create on 02/19/2014 advPublishers @author: Wu @email:1162025955@qq.com ''' from django import forms from common.models import AdvPublishers from django.shortcuts import get_object_or_404 from django.shortcuts import render from django.shortcuts import redirect from django.contrib.auth...
null
old-code/manage/advPublishers.py
advPublishers.py
py
3,176
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.forms.ModelForm", "line_number": 29, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 29, "usage_type": "name" }, { "api_name": "common.models.AdvPublishers", "line_number": 31, "usage_type": "name" }, { "api_name": "...
89276738
# Copyright (C) 2020 Cancer Care Associates # 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 ...
null
lib/pymedphys/_experimental/streamlit/utilities/iview/_sync.py
_sync.py
py
11,436
python
en
code
null
code-starcoder2
66
[ { "api_name": "pymedphys._imports.streamlit.write", "line_number": 34, "usage_type": "call" }, { "api_name": "pymedphys._imports.streamlit", "line_number": 34, "usage_type": "name" }, { "api_name": "pymedphys._imports.streamlit.write", "line_number": 36, "usage_type": "ca...
630690270
# -*- coding: utf-8 -*- # coding: utf-8 # @Author : WeiXin # ๅฟฝ็•ฅ็‰ˆๆœฌ่ญฆๅ‘Š import warnings warnings.filterwarnings('ignore') import joblib from rdkitfingerprint import * #from smilesmethod import * from cdkfingerprint import * import pickle def SelectAlgorithm(algorithmtype): if algorithmtype == 1: al = joblib....
null
model/modelmethod.py
modelmethod.py
py
2,003
python
en
code
null
code-starcoder2
66
[ { "api_name": "warnings.filterwarnings", "line_number": 7, "usage_type": "call" }, { "api_name": "joblib.load", "line_number": 16, "usage_type": "call" }, { "api_name": "joblib.load", "line_number": 18, "usage_type": "call" }, { "api_name": "joblib.load", "lin...
318544116
import io import os import sys from zipfile import ZipFile from django.core.management.base import BaseCommand import datetime import urllib.request import shutil DATA_URL = 'http://files.grouplens.org/datasets/movielens/ml-100k.zip' DATA_FILE_NAME = os.path.join(os.path.dirname(__file__), "resources/ml-100k.zip").r...
null
bdd/management/commands/data_extraction.py
data_extraction.py
py
5,966
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.join", "line_nu...
178304922
import requests from bs4 import BeautifulSoup import re import xlwt import xlrd import json import os cve_search_url = "https://nvd.nist.gov/vuln/search/results?form_type=Basic&results_type=overview&query=%s&search_type=last3years" cve_get_url = "https://nvd.nist.gov/vuln/search/results?form_type=Basic&results_typ...
null
scripts/get_cves.py
get_cves.py
py
5,879
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 54, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 70, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 75, "usage_type": "call" }, { "api_name": "re.compile", "line_numb...
614469966
import argparse import datetime as dt import os import pandas as pd import pandas_datareader.data as web import time from tqdm import tqdm # progress import sys from get_all_tickers import get_tickers as gt default_start_year = 2000 data_path = '../data/all_stock' # reserved name in Windows reserved = ['PRN'] parser...
null
stock/command/download.py
download.py
py
3,035
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 31, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 40, "usage_type": "call" }, { "api_name": "datetime.datetime"...
103918865
import socket import ssl import trio # noqa import pytest # noqa from yarl import URL # noqa from aiohttp_socks.core_socks import ( ProxyType, ProxyError, ProxyTimeoutError, ProxyConnectionError ) from aiohttp_socks.core_socks._proxy_async import AsyncProxy # noqa from aiohttp_socks.core_socks.as...
null
tests/test_core_socks_async_trio.py
test_core_socks_async_trio.py
py
4,959
python
en
code
null
code-starcoder2
66
[ { "api_name": "aiohttp_socks.core_socks._proxy_async.AsyncProxy", "line_number": 31, "usage_type": "name" }, { "api_name": "yarl.URL", "line_number": 33, "usage_type": "call" }, { "api_name": "aiohttp_socks.core_socks._resolver_async_trio.Resolver", "line_number": 37, "us...
352265973
# coding=UTF-8 ''' @Author: Fantasy @Date: 2020-01-13 14:00:32 @LastEditors: Fantasy @LastEditTime: 2020-04-18 15:29:07 @Descripttion: @Email: 776474961@qq.com ''' import os import re import json from DBAnalyze import DBAnalyze class TemplateTranslate(object): def __init__(self, templateDir, outputDir, dbInfo):...
null
TemplateTranslate.py
TemplateTranslate.py
py
8,039
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.abspath", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
25342022
import os import time import h5py import torch import numpy as np import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from torch.utils.data import DataLoader import matplotlib.pyplot as plt from dataset import LoadData from utils import Evaluation from utils import visualize_result from ...
null
train_test.py
train_test.py
py
4,518
python
en
code
null
code-starcoder2
66
[ { "api_name": "warnings.filterwarnings", "line_number": 19, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 22, "usage_type": "attribute" }, { "api_name": "dataset.LoadData", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.utils....
440501249
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jul 18 21:49:03 2017 @author: davlars """ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jun 21 10:37:51 2017 @author: kenneth """ import odl import numpy as np import random import math import matplotlib.pyplot as plt import headnh...
null
Test Files/main2.py
main2.py
py
10,216
python
en
code
null
code-starcoder2
66
[ { "api_name": "odl.uniform_discr", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.histogram", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.r_", "line_number": 37, "usage_type": "attribute" }, { "api_name": "numpy.where", "li...
278678754
#!/usr/bin/env python3 import os import lib import math import sites import widgets # Params OUTPUT_DIR = 'throughput-scalability' VARNISH_NTHREADS = 1000 TARGET_POOL_SIZE = 100 NCUSTOMERSS = [1, 100, 250, 500, 750, 1000, 1250, 1500, 1750, 2000] NCONNS_PER_CUSTOMER = 10 sys_config = { 'clients': [lib.CLIENT0_HO...
null
data-collection/throughput-scalability.py
throughput-scalability.py
py
2,249
python
en
code
null
code-starcoder2
66
[ { "api_name": "lib.CLIENT0_HOSTNAME", "line_number": 18, "usage_type": "attribute" }, { "api_name": "lib.CLIENT1_HOSTNAME", "line_number": 18, "usage_type": "attribute" }, { "api_name": "lib.CLIENT2_HOSTNAME", "line_number": 18, "usage_type": "attribute" }, { "api...
235853259
from flask import Blueprint mod = Blueprint('api_viewallvagas',__name__) #from flask import Flask, request, url_for from flask_api import FlaskAPI from elasticsearch import Elasticsearch app=FlaskAPI(__name__) @mod.route('/', defaults={'path' : ''}) @mod.route('/<schema>/viewallvagas', methods = ['GET']) def ...
null
api/api_viewallvagas/api_viewallvagas.py
api_viewallvagas.py
py
771
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Blueprint", "line_number": 4, "usage_type": "call" }, { "api_name": "flask_api.FlaskAPI", "line_number": 13, "usage_type": "call" }, { "api_name": "elasticsearch.Elasticsearch", "line_number": 20, "usage_type": "call" } ]
501347673
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
null
vsts/vsts/test/v4_0/models/test_run_statistic.py
test_run_statistic.py
py
1,208
python
en
code
null
code-starcoder2
66
[ { "api_name": "msrest.serialization.Model", "line_number": 12, "usage_type": "name" } ]
337005650
# Python 3 Source Code from base64 import b64encode, b64decode import sys import os import random chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/' def shift(char, key, rev = False): if not char in chars: return char if rev: print(chars.index(char)) print(key) ...
null
2016/TWCTF2016/vigenere_cipher/cipher.py
cipher.py
py
1,589
python
en
code
null
code-starcoder2
66
[ { "api_name": "base64.b64encode", "line_number": 21, "usage_type": "call" }, { "api_name": "base64.b64decode", "line_number": 26, "usage_type": "call" }, { "api_name": "os.urandom", "line_number": 29, "usage_type": "call" }, { "api_name": "sys.argv", "line_num...
626756159
import csv from nltk.stem.wordnet import WordNetLemmatizer import re, string, random from nltk.tag import pos_tag import argparse import nltk nltk.download('vader_lexicon') nltk.download('averaged_perceptron_tagger') nltk.download('wordnet') from nltk.sentiment.vader import SentimentIntensityAnalyzer from nltk import w...
null
sentiment/src/sentiment_represent.py
sentiment_represent.py
py
2,673
python
en
code
null
code-starcoder2
66
[ { "api_name": "nltk.download", "line_number": 7, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 8, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 9, "usage_type": "call" }, { "api_name": "tkinter.Tk", "line_number"...
443465114
import pandas as pd import nltk from string import digits, punctuation import numpy as np import re import warnings warnings.filterwarnings('ignore') from sklearn.linear_model import LogisticRegression from nltk.stem import PorterStemmer from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.model_se...
null
EmailAnalysisModel.py
EmailAnalysisModel.py
py
5,946
python
en
code
null
code-starcoder2
66
[ { "api_name": "warnings.filterwarnings", "line_number": 7, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LogisticRegression", "line_number": 35, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number": 39, "usage_type": "call" }, { "api_na...
59389563
import requests from bs4 import BeautifulSoup import csv # get html from site url = "https://www.starwars.com/news/15-star-wars-quotes-to-use-in-everyday-life" response = requests.get(url) headers = response.headers body = response.text[:2000] # drill down into html to grab desired info -- quotes and their "authors" ...
null
star_wars_web_scraper.py
star_wars_web_scraper.py
py
691
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 12, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 16, "usage_type": "call" } ]
41477227
import hashlib import base64 import datetime from werkzeug.utils import secure_filename import os from main import app SECRET = 'FNWUI34HRF734BU9FGB498CBRIFU6uhghfg6' def hash_password(password): #hash the admins password text_ = str(password) + SECRET return hashlib.md5(text_.encode('utf-8')).hexdigest() # g...
null
ex_operations.py
ex_operations.py
py
2,988
python
en
code
null
code-starcoder2
66
[ { "api_name": "hashlib.md5", "line_number": 14, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_number": 47, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 71, "usage_type": "call" }, { "api_name": "datetime.datetime"...
320267241
import rawpy import numpy as np import imageio print("...reading") raw = rawpy.imread('IMGP0243.PEF') h,w = raw.sizes.raw_height, raw.sizes.raw_width raw_image = raw.raw_image.copy() raw_array = np.array(raw_image).reshape((h,w)).astype('float') print("...black_level") bayer_pattern = raw.raw_pattern blc = raw.black...
null
try4.py
try4.py
py
1,805
python
en
code
null
code-starcoder2
66
[ { "api_name": "rawpy.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": ...
203152631
import os import json from sifra.logger import rootLogger import scripts.convert_setup_files_to_json as converter class Configuration: """ Reads all the simulation configuration constants to be read by other classes """ def __init__(self, configuration_file_path, run_mode='impact'...
null
sifra/configuration.py
configuration.py
py
6,561
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.splitext", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.path.basename", "line_number": 21, "usage_type": "call" }, { "api_name": "scripts.convert_setup_...
471731678
# -*- coding: utf-8 -*- from main.Database.base import Base from sqlalchemy import Column, String, Integer class Permission(Base): __tablename__ = 'permission' id = Column(Integer, primary_key=True) name = Column(String) def __init__(self, name): self.name = name def __str__(self): ...
null
software/django project/main/Database/Permission.py
Permission.py
py
374
python
en
code
null
code-starcoder2
66
[ { "api_name": "main.Database.base.Base", "line_number": 5, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 7, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 7, "usage_type": "argument" }, { "api_name": "sqlalch...
437423962
import torch import torchvision.datasets as dataset import torchvision.transforms as transforms from torch import nn batch_size = 256 trans = transforms.ToTensor() train_set = dataset.MNIST(root="./data", train=True, transform=trans, download=False) test_set = dataset.MNIST(root="./data", train=False, transform=trans...
null
LeNetBettered.py
LeNetBettered.py
py
2,077
python
en
code
null
code-starcoder2
66
[ { "api_name": "torchvision.transforms.ToTensor", "line_number": 7, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 7, "usage_type": "name" }, { "api_name": "torchvision.datasets.MNIST", "line_number": 9, "usage_type": "call" }, { "ap...
285299969
import pandas as pd import numpy as np import xarray as xr import sys, os, time, datetime, math from io import StringIO import natsort from BillComparison.models import Tariffs, State, UserSubmissions from django.db.models.query import QuerySet from BillComparison.scripts import bill_processing, fileformat_detector ...
null
BillWise_Site/SERREE.py
SERREE.py
py
2,718
python
en
code
null
code-starcoder2
66
[ { "api_name": "BillComparison.models.UserSubmissions", "line_number": 15, "usage_type": "call" }, { "api_name": "BillComparison.models.State.objects.filter", "line_number": 17, "usage_type": "call" }, { "api_name": "BillComparison.models.State.objects", "line_number": 17, ...
611913567
from collections import defaultdict import sys emit=defaultdict(lambda:0) transition=defaultdict(lambda:0) context=defaultdict(lambda:0) for line in open(sys.argv[1]): previous="<s>" context[previous]+=1 for wordtag in line.strip("\n").split(" "): word=wordtag.split("_") transition[previous...
null
osaki/tutorial04/train-hmm.py
train-hmm.py
py
781
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.defaultdict", "line_number": 3, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 4, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 5, "usage_type": "call" }, { "api_name": "...
37317494
#!/usr/bin/python # # This script's purpose is to convert database of NYT from MS SQL dump file # to xml data format # # First you need to restore database to your running SQL server then change # connection configuration below and run the script import pyodbc import codecs from xml.sax.saxutils import escape print("...
null
Implementation/irsa-etc/nyt-convert/convert.py
convert.py
py
1,259
python
en
code
null
code-starcoder2
66
[ { "api_name": "pyodbc.connect", "line_number": 14, "usage_type": "call" }, { "api_name": "codecs.open", "line_number": 23, "usage_type": "call" }, { "api_name": "xml.sax.saxutils.escape", "line_number": 34, "usage_type": "call" }, { "api_name": "xml.sax.saxutils.e...
281807724
import os, math import random import neo4j_bolt_driver as nbd from neo4j.v1 import GraphDatabase import walletexplorer as we import time from settings import * import numpy as np # test_set = 0.1 # training_set = 0.9 # test_addresses = 100 # full dataset size # addresses_per_block = 20 # last_block = 426541 # first_b...
null
test_feature_extractor.py
test_feature_extractor.py
py
7,779
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.getcwd", "line_number": 16, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 17, "usage_type": "call" }, { "api_name": "os.system", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number":...
279978834
from . import crawler from bs4 import BeautifulSoup #need pip install Beautifulsoup, bs4 import json import requests import re import urllib.parse from parsing.program.BookDataType import * from parsing.models import * from multiprocessing import Pool import django class ChungbukNational (crawler.Crawler): CONST_...
null
parsing/program/ChungbukNational.py
ChungbukNational.py
py
6,276
python
en
code
null
code-starcoder2
66
[ { "api_name": "urllib.parse.parse.quote", "line_number": 26, "usage_type": "call" }, { "api_name": "urllib.parse.parse", "line_number": 26, "usage_type": "attribute" }, { "api_name": "urllib.parse", "line_number": 26, "usage_type": "name" }, { "api_name": "request...
346469311
import pygame import os, sys backgroundImage = pygame.image.load("background.png") floorImage = pygame.image.load("floor.png") heroImage = os.path.join("D:\skola\Programovani\Python\superFabio", "player.png") pipeImage = os.path.join("D:\skola\Programovani\Python\superFabio", "pipe.png") wallImage = os.path.join("D:\...
null
Prototypes/levelMovement.py
levelMovement.py
py
4,874
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.image.load", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pygame.image.load", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.image", ...
103409586
#!/usr/bin/python3 """ function that prints the titles of the first 10 hot posts listed for a given subreddit """ import requests def top_ten(subreddit): """ function to return number of subscribers """ url = "https://www.reddit.com/r/" + subreddit + "/hot.json?limit=10" subred = requests.get(url, headers...
null
0x18-api_advanced/1-top_ten.py
1-top_ten.py
py
806
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" } ]
604563804
import logging import os from pathlib import Path from typing import Union import pandas as pd logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(message)s', datefmt='%Y-%m-%d %H:%M:%S') # Assign the below based on the results of df.dtypes. EXPECTED_CSV_DATATYPE =...
null
python_fun/app_csvParser/csvParser/utils/parser.py
parser.py
py
2,899
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 8, "usage_type": "attribute" }, { "api_name": "typing.Union", "line_number": 28, "usage_type": "name" }, { "api_name": "pathlib.Path", "...
481929071
#!/usr/bin/env python3 import json import odoorpc import dns.resolver from validate_email import validate_email o = odoorpc.ODOO.load('vf_prod') ai = o.env['account.invoice'] rp = o.env['res.partner'] partner_email = dict([(x['id'], x['email']) for x in rp.read(rp.search([]),['email'])]) alle_sub = json.loads(open('a...
null
customer_specific_utils/ventilasjonsfilter/fakturastat/check_emails.py
check_emails.py
py
1,716
python
en
code
null
code-starcoder2
66
[ { "api_name": "odoorpc.ODOO.load", "line_number": 6, "usage_type": "call" }, { "api_name": "odoorpc.ODOO", "line_number": 6, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 12, "usage_type": "call" }, { "api_name": "dns.resolver.resolver.qu...
278217047
from flask import Blueprint, send_file from ...core.files import abspath, fileExists, dirNm from .serve import serveNer MY_DIR = dirNm(abspath(__file__)) def factory(web): app = Blueprint( "ner", __name__, url_prefix="/ner", template_folder="templates", ) @app.route("/st...
null
tf/browser/ner/web.py
web.py
py
604
python
en
code
null
code-starcoder2
66
[ { "api_name": "core.files.dirNm", "line_number": 6, "usage_type": "call" }, { "api_name": "core.files.abspath", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.Blueprint", "line_number": 10, "usage_type": "call" }, { "api_name": "core.files.fileExis...
540380712
from django import template from django.template.defaultfilters import stringfilter import numbers register = template.Library() @register.filter() def formatPrediction(value, prediction): if prediction < value: icon = '<i title="Token" style="color:#FF584F" class="fa fa-arrow-down alt"></i>' else: ...
null
minfmi/dashboard/templatetags/template_extras.py
template_extras.py
py
1,155
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.template.Library", "line_number": 4, "usage_type": "call" }, { "api_name": "django.template", "line_number": 4, "usage_type": "name" } ]
106714257
import os import os.path import torch import librosa import soundfile as sf from modules.const import * from flask import Flask, request, render_template from werkzeug.utils import secure_filename from kospeech.utils import label_to_string, id2char, EOS_token from modules.parser import parse_audio from modules.converte...
null
app.py
app.py
py
2,948
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torch.load", "line_number":...
510089954
import os import cv2 import numpy as np import ast import sys path=('/home/ubuntu/cc/scripts/CenterTrack1/20200713/ann/01') colours=np.random.randint(0,255,(255,3)) list_=os.listdir(path) list_=sorted(list_,key=lambda x:int(x.split(".")[0])) path_img='/home/ubuntu/data/holo/holo/images' img=os.listdir(path_img) img1=so...
null
CenterTrack2/show.py
show.py
py
1,432
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.randint", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 8, "usage_type": "call" }, { "api_name": "os.listdir", "line...
116392580
from flask import render_template, url_for, request, redirect, flash from flask.templating import render_template_string from sqlalchemy.sql.elements import Null from TAPR import app, db from TAPR.models import * from TAPR.forms import * from flask_login import login_user, logout_user, login_required, current_user from...
null
TAPR/routes.py
routes.py
py
16,201
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.render_template", "line_number": 16, "usage_type": "call" }, { "api_name": "TAPR.app.route", "line_number": 13, "usage_type": "call" }, { "api_name": "TAPR.app", "line_number": 13, "usage_type": "name" }, { "api_name": "TAPR.app.route", "l...
318526441
from matplotlib import pyplot as plt from matplotlib import patches import matplotlib.patheffects as path_effects import numpy as np import seaborn as sbn def imshow(image, figsize=None, **kw): if figsize is not None: plt.figure(None, figsize) if image.ndim == 3 and 1 in image.shape: if image....
null
celldetection/visualization/images.py
images.py
py
4,710
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 10, "usage_type": "name" }, { "api_name": "numpy.squeeze", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.squeez...
61636411
# -*- coding: iso-8859-15 -*- __author__ = "Harold Fernandez | SIGAG S.A.S" __date__ = "$13-ago-2016 9:49:42$" import cv2 class ProcesamientoImg(object): image = "" def __init__(self, image): self.image = image def calcular_histograma(self, canal): img = self.image ...
null
src/sigaind/ProimgBundle/Resources/py/ProcessImg/GestionImagen/ProcesamientoImg.py
ProcesamientoImg.py
py
439
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.calcHist", "line_number": 17, "usage_type": "call" } ]