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
35603325
#coding:utf-8 import urllib import urllib.request import http.cookiejar import json import time import os import sys import datetime import time import ass_maker import var_set import _thread import random path = var_set.path #引入设置路径 roomid = var_set.roomid #引入设置房间号 cookie = var_set.cookie #引入设置cookie ...
null
post_dm.py
post_dm.py
py
30,708
python
en
code
null
code-starcoder2
83
[ { "api_name": "var_set.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "var_set.roomid", "line_number": 17, "usage_type": "attribute" }, { "api_name": "var_set.cookie", "line_number": 18, "usage_type": "attribute" }, { "api_name": "var_set.dow...
56850992
# Python Application Logging # Buffering logging messages and outputting them conditionally # There might be situations where you want to log messages in # a temporary area and only output them if a certain condition # occurs. import logging from logging.handlers import MemoryHandler import sys logger = ...
null
Python_Logging_Buffering.py
Python_Logging_Buffering.py
py
2,277
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.NullHandler", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.E...
277094880
import pyperclip print ('testing the CAESAR/ROT Cipher') message=input('Typ het te vercijferen bericht:') key = 3 #ROTx met x=waarde van key mode = 'encrypt' #of 'decrypt' LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' #De toegelaten letters translated = '' #bevat eindresultaat message = message.upper() #zet a..z in hoof...
null
TestCode/Caesar.py
Caesar.py
py
916
python
en
code
null
code-starcoder2
83
[ { "api_name": "pyperclip.copy", "line_number": 34, "usage_type": "call" } ]
187774950
import io import unittest from unittest.mock import patch from prob02.prob02 import main class End2EndTestCase(unittest.TestCase): def test_something(self): self.assertEqual(True, True) @patch('sys.stdout', new_callable=io.StringIO) def test_end2end_1(self, captured_output): raw_input = ...
null
prob02/test_prob02.py
test_prob02.py
py
1,869
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "unittest.mock.patch", "line_number": 29, "usage_type": "call" }, { "api_name": "prob02.prob02.main", "line_number": 30, "usage_type": "call" }, { "api_name": "unittest...
330760778
from django.conf.urls import url from . import views app_name = 'Accounts' urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='login'), url(r'^register/$', views.UserFormView.as_view(), name='register'), url(r'^loginRequest/$', views.LoginAccess.as_view(), name='request'), url(r'^loginValid...
null
Accounts/urls.py
urls.py
py
371
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 11, "usage_type": "call" }, { "api_name": "django.c...
601284204
import cv2 import numpy as np from skimage.feature import hog import argparse import debug from debug import dbg class CarFrame: def __init__(self, img, vis=False): self.img = img self.ppc = 8 self.ws = 64 # windows size self.hls = cv2.cvtColor(img, cv2.COLOR_BGR2HLS) hls= ...
null
pkvd/preproc.py
preproc.py
py
2,556
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.cvtColor", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2HLS", "line_number": 13, "usage_type": "attribute" }, { "api_name": "debug.dbg", "line_number": 17, "usage_type": "call" }, { "api_name": "debug.dbg", "line_n...
504171734
# -*- coding: utf-8 -*- """ Created on Tue Jul 23 11:09:12 2019 @author: achen """ import pandas as pd import telescope as ts import telescope_metrics as tm import strategy_backtest3_loss as sbtest3l import datetime import numpy as np from tqdm import tqdm #dmb.dir_match_backtest(r"Z:\KaiData\Theo\201...
null
Morning RTY Trend/run_loss_strat3.py
run_loss_strat3.py
py
3,104
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 18, "usage_type": "call" }, { "api_name": "telescope.Telescope", "line_number": 20, "usage_type": "call" }, { "api_name": "telescope.sel...
220283212
# coding: UTF-8 import requests from time import sleep from datetime import datetime from bs4 import BeautifulSoup # send_mail(subject, message) from send_mail import send_mail ### 変数定義 ### # 監視対象のフォワードテストページ url = "https://fx-on.com/systemtrade/detail/?id=13778&t=2#c" open_time = None close_time = None value_li...
null
TradeObserver.py
TradeObserver.py
py
4,145
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.now", "line_number": 26, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 26, "usage_type": "name" }, { "api_name": "datetime.datetime.strptime", "line_number": 32, "usage_type": "call" }, { "api_name": "da...
501228430
"""empty message Revision ID: 5cd8941ace02 Revises: 16e705703c60 Create Date: 2021-05-11 14:45:09.845296 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = '5cd8941ace02' down_revision = '16e705703c60' branch_labels = None...
null
backend/migrations/versions/5cd8941ace02_.py
5cd8941ace02_.py
py
1,156
python
en
code
null
code-starcoder2
83
[ { "api_name": "alembic.op.add_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 21, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer...
18577208
# flake8: noqa: E402 from typing import Optional, List from datetime import datetime, timedelta import os import pytest import numpy as np from sqlalchemy.orm import Query from rq.job import Job from flexmeasures.data.models.data_sources import DataSource from flexmeasures.data.models.assets import Asset, Power from ...
null
flexmeasures/data/tests/test_forecasting_jobs.py
test_forecasting_jobs.py
py
13,638
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.timedelta", "line_number": 24, "usage_type": "call" }, { "api_name": "flexmeasures.data.models.data_sources.DataSource.query.filter_by", "line_number": 34, "usage_type": "call" }, { "api_name": "flexmeasures.data.models.data_sources.DataSource.query", ...
283131530
import sqlite3 import json from ploomber.products import Product from ploomber.products.serializers import Base64Serializer from ploomber.templates.Placeholder import SQLRelationPlaceholder class SQLiteRelation(Product): """A SQLite relation Parameters ---------- identifier: tuple of length 3 ...
null
src/ploomber/products/sql.py
sql.py
py
8,181
python
en
code
null
code-starcoder2
83
[ { "api_name": "ploomber.products.Product", "line_number": 9, "usage_type": "name" }, { "api_name": "ploomber.templates.Placeholder.SQLRelationPlaceholder", "line_number": 36, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 76, "usage_type": "call" }, ...
575967207
"""A10 support.""" import asyncio from netmiko.cisco_base_connection import CiscoSSHConnection class A10SSH(CiscoSSHConnection): """A10 support.""" async def session_preparation(self): """A10 requires to be enable mode to disable paging.""" await asyncio.create_task(self._test_channel_read())...
null
netmiko/a10/a10_ssh.py
a10_ssh.py
py
785
python
en
code
null
code-starcoder2
83
[ { "api_name": "netmiko.cisco_base_connection.CiscoSSHConnection", "line_number": 6, "usage_type": "name" }, { "api_name": "asyncio.create_task", "line_number": 11, "usage_type": "call" }, { "api_name": "asyncio.sleep", "line_number": 20, "usage_type": "call" }, { ...
612038040
from rest_framework import serializers from trade_system.items.models import Currency, InventorySlot, Item, Price, WatchList, Inventory from trade_system.users.serializers import UserSerializers class CurrencySerializer(serializers.ModelSerializer): class Meta: model = Currency fields = [ ...
null
trade_system/items/serializers.py
serializers.py
py
1,543
python
en
code
null
code-starcoder2
83
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 6, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 6, "usage_type": "name" }, { "api_name": "trade_system.items.models.Currency", "line_number": 9, "usage_ty...
169243923
""" Retrieve latest email from r2d2_data_wrangler@dkhydrotech.com mail account. Parse the email attachment, format a report, send report on set schedule. Trigger 'notification alarm' report on any flagged condition met. """ import numpy as np import pandas as pd import math import re import os import sys import base6...
null
r2d2_kp01/main.py
main.py
py
14,248
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.settings.configure", "line_number": 21, "usage_type": "call" }, { "api_name": "django.conf.settings", "line_number": 21, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 42, "usage_type": "call" }, { "api_name": "o...
142192086
import pytest import salt.ext.tornado.iostream import salt.transport.ipc import salt.utils.asynchronous def test_ipc_connect_in_async_methods(): "The connect method is in IPCMessageSubscriber's async_methods property" assert "connect" in salt.transport.ipc.IPCMessageSubscriber.async_methods def test_ipc_con...
null
tests/pytests/unit/transport/test_ipc.py
test_ipc.py
py
731
python
en
code
null
code-starcoder2
83
[ { "api_name": "salt.ext.tornado.iostream.transport", "line_number": 9, "usage_type": "attribute" }, { "api_name": "salt.ext.tornado.iostream", "line_number": 9, "usage_type": "name" }, { "api_name": "salt.ext.tornado.iostream.utils.asynchronous.SyncWrapper", "line_number": 18...
227336622
from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By from urlparse import urljoin from urllib import urlretrieve import csv ROTOWIRE_DAILY_LINEUPS_URL = "http://www.rotowire.c...
null
mine/draft_kings.py
draft_kings.py
py
3,134
python
en
code
null
code-starcoder2
83
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 22, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 22, "usage_type": "name" }, { "api_name": "selenium.webdriver.support.ui.WebDriverWait", "line_number": 27, "usage_type": "call" }, ...
83431737
import sys, os from PIL import Image from skimage import color, transform, exposure from MiniSnake import game game_engine = game() from config import num_of_cols, num_of_rows for i in range(9999999): _, test, _ = game_engine.play(0) if i>200: gray = color.rgb2gray(test) resized_gray = transf...
null
screenshotter.py
screenshotter.py
py
917
python
en
code
null
code-starcoder2
83
[ { "api_name": "MiniSnake.game", "line_number": 6, "usage_type": "call" }, { "api_name": "skimage.color.rgb2gray", "line_number": 13, "usage_type": "call" }, { "api_name": "skimage.color", "line_number": 13, "usage_type": "name" }, { "api_name": "skimage.transform....
400208389
#!/usr/bin/env python # coding: utf-8 # In[1]: import pandas as pd import matplotlib.pyplot as plt import tensorflow as tf import numpy as np from tensorflow import keras # In[2]: data= keras.datasets.fashion_mnist # In[3]: (train_images, train_labels),(test_images, test_labels) = data.load_data() class_name...
null
medium/Tensor.py
Tensor.py
py
1,294
python
en
code
null
code-starcoder2
83
[ { "api_name": "tensorflow.keras.datasets", "line_number": 17, "usage_type": "attribute" }, { "api_name": "tensorflow.keras", "line_number": 17, "usage_type": "name" }, { "api_name": "tensorflow.keras.Sequential", "line_number": 38, "usage_type": "call" }, { "api_n...
291393029
from django.http import HttpResponseRedirect, HttpResponseBadRequest from django.shortcuts import render, redirect, get_object_or_404 from django.template import RequestContext from django_tables2 import RequestConfig from Books import tables from Books.forms import * from json_load import load_all_models_from_json # C...
null
Books/views.py
views.py
py
5,187
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.shortcuts.render", "line_number": 12, "usage_type": "call" }, { "api_name": "json_load.load_all_models_from_json", "line_number": 16, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 17, "usage_type": "call" }, { ...
347660767
from __future__ import print_function import pathlib import io import random import sys USAGE = """ Usage: trigrams sourcefile length where sourcefile points to a text file and length is the length of the desired output """ ENDING_PUNC = ['.', '?', '!', ':', ';', ','] # ellipsis exluded SENTENCE_END = ['.'...
null
src/trigrams.py
trigrams.py
py
16,347
python
en
code
null
code-starcoder2
83
[ { "api_name": "pathlib.Path", "line_number": 273, "usage_type": "call" }, { "api_name": "io.open", "line_number": 282, "usage_type": "call" }, { "api_name": "io.open", "line_number": 287, "usage_type": "call" }, { "api_name": "random.randrange", "line_number":...
194350567
import pandas as pd import numpy as np import cv2 from PIL import Image, ImageDraw, ImageFilter, ImageOps import random import os import argparse import auto_maskmix_util def make_augmented_image(train_csv, bg_mask_csv, mix_img_csv, save_dir, cls): bg_mask = pd.read_csv(bg_mask_csv) mix_img = pd.read_csv(mix_i...
null
src/util/make_augmented_image.py
make_augmented_image.py
py
5,231
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 21, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "l...
544599877
import backends, computations, datasets, models, probes, random_numbers, run, samplers, visualizers import numpy as np def experiment(a): a.seed = 1234 a.depth = 100 a.model = 'PCD_500' a.num_samples = 25 a.num_samples_to_record = 30 a.bias = True # if large, most time is spent near the s...
null
experiments/unwind_mixture_samples.py
unwind_mixture_samples.py
py
1,612
python
en
code
null
code-starcoder2
83
[ { "api_name": "random_numbers.RNG", "line_number": 16, "usage_type": "call" }, { "api_name": "datasets.MNISTbinarized", "line_number": 18, "usage_type": "call" }, { "api_name": "models.ExactRbm", "line_number": 22, "usage_type": "call" }, { "api_name": "models.RBM...
651968830
import pandas as pd import io import pytest from csv2df.reader import Row from csv2df.parser import Table from csv2df.specification import ParsingCommand, Def from csv2df.reader import to_rows from csv2df.parser import extract_tables import csv2df.emitter as emitter # stateless functions class Test_Function_to_floa...
null
src/csv2df/tests/test_emitter.py
test_emitter.py
py
5,585
python
en
code
null
code-starcoder2
83
[ { "api_name": "csv2df.emitter.to_float", "line_number": 19, "usage_type": "call" }, { "api_name": "csv2df.emitter", "line_number": 19, "usage_type": "name" }, { "api_name": "csv2df.emitter.to_float", "line_number": 22, "usage_type": "call" }, { "api_name": "csv2df...
561585590
import os from flask import Flask, flash, request, redirect, url_for, send_from_directory, render_template from werkzeug.utils import secure_filename import datetime import time UPLOAD_FOLDER = 'uploads' ALLOWED_EXTENSIONS = {'txt', 'md'} # Server code to make sure it doesn't happen. app = Flask(__name__) ...
null
main.py
main.py
py
2,113
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 29, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 29, "usage_type": "name" }, { "api_name": "flask.request.fil...
494665653
import os from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_login import LoginManager from flask.ext.mandrill import Mandrill from flask.ext.cors import CORS from flask.ext.babel import Babel from flask.ext.geoip import GeoIP from flask.ext.social.datastore import SQLAlchemyConnectionDatasto...
null
ioveda/__init__.py
__init__.py
py
3,261
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.abspath", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_number": 26, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 26, "usage_type": "call" }, { "api_name": "flask.Flask", "line_...
589751529
from django.urls import path from . import views urlpatterns = [ path('', views.ListTodo.as_view()), path('<int:pk>/', views.DetailTodo.as_view()), path('add/', views.AddTodo,name="add_todo"), path('delete/', views.DeleteTodo,name="del_todo"), path('clear/', views.ClearTodo,name="clear_todo"), ]
null
todos/urls.py
urls.py
py
318
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
317950936
"""This module contains the Atom_Position class. The Atom_Position is the "base unit" in Atomap, since it contains the information about the individual atomic columns. """ import copy import numpy as np import matplotlib.pyplot as plt from scipy import ndimage import math from atomap.atom_finding_refining import _make...
null
data/atomap_vers_eoc/atom_position_old.py
atom_position_old.py
py
21,147
python
en
code
null
code-starcoder2
83
[ { "api_name": "math.pi", "line_number": 162, "usage_type": "attribute" }, { "api_name": "math.pi", "line_number": 173, "usage_type": "attribute" }, { "api_name": "math.pi", "line_number": 175, "usage_type": "attribute" }, { "api_name": "atomap.atom_finding_refinin...
256606795
from django.db import models from DjAdminExt import forms class ForeignKeyExt(models.ForeignKey): '''Clase para extender el field ForeignKey con funcionalidades extras''' def __init__(self, to, to_field=None, rel_class=models.ManyToOneRel, **kwargs): ''' Los parametros dependen de la c...
null
DjAdminExt/models/fields/ForeignKeyExt.py
ForeignKeyExt.py
py
2,490
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.models.ForeignKey", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 4, "usage_type": "name" }, { "api_name": "django.db.models.ManyToOneRel", "line_number": 7, "usage_type": "attribute" }, { ...
99353509
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ import math import matplotlib.pyplot as plt N_cot0 = [] A_azan = 0 h_azan = 0 A_gheble = 34.2 h_gheble = 0 plt.figure(figsize=[15,5]) pi = 3.1415 deg2rad = pi/180.0 rad2deg = 180.0/pi ifPolar = True width = 9 R = 20 phi = 33.89 all_N_prev...
null
sundial_backup.py
sundial_backup.py
py
12,563
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 16, "usage_type": "name" }, { "api_name": "math.tan", "line_number": 30, "usage_type": "call" }, { "api_name": "math.cos", "l...
272773560
#!/usr/bin/env python # coding: utf-8 # In[1]: import sys sys.path.append('../') import datasets import log_reg from dataproc import extract_wvs from dataproc import get_discharge_summaries from dataproc import concat_and_split from dataproc import build_vocab from dataproc import vocab_index_descriptions from datap...
null
notebooks/dataproc_mimic_III_part.py
dataproc_mimic_III_part.py
py
2,730
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "constants.MIMIC_3_DIR", "line_number": 36, "usage_type": "name" }, { "api_name": "collections.Counter...
541982503
""" Application : ReplSim File name : ANN.py Authors : Jacob Summerville, Martin Lopez, Henry Lee Creation : 04/19/21 Description : This file contains the development of a neural net the Neural Net is a recurrent neural net with supervised learning called long short-term memory lear...
null
src/ann.py
ann.py
py
11,944
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 61, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 61, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 62, "usage_type": "call" }, { "api_name": "matpl...
51468733
from mrjob.job import MRJob from mrjob.step import MRStep from mrjob.protocol import JSONValueProtocol import json import re import itertools dataset_path = '../dataset/' def get_json_element(line): ''' Had to create this function because my shrinked JSON were dumped as a list, not as various JSON Objects as ...
null
Entrega/03_top_reviewers_by_category_and_votes.py
03_top_reviewers_by_category_and_votes.py
py
2,187
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.loads", "line_number": 14, "usage_type": "call" }, { "api_name": "mrjob.job.MRJob", "line_number": 23, "usage_type": "name" }, { "api_name": "mrjob.step.MRStep", "line_number": 52, "usage_type": "call" }, { "api_name": "mrjob.step.MRStep", ...
161749636
# flake8: noqa TODO from kfp.components import InputPath, OutputPath def BigQueryExampleGen( example_artifacts_path: OutputPath('Examples'), query: str = None, input_config: 'JsonObject: example_gen_pb2.Input' = None, output_config: 'JsonObject: example_gen_pb2.Output' = None, ): """ Officia...
null
components/tfx/ExampleGen/BigQueryExampleGen/component.py
component.py
py
4,199
python
en
code
null
code-starcoder2
83
[ { "api_name": "kfp.components.OutputPath", "line_number": 7, "usage_type": "call" }, { "api_name": "tfx.components.example_gen.csv_example_gen.component.BigQueryExampleGen", "line_number": 37, "usage_type": "name" }, { "api_name": "google.protobuf.message.Message", "line_numb...
420955583
"""Test cycle simulation functions.""" from pytest import raises import numpy as np from neurodsp.tests.tutils import check_sim_output from neurodsp.tests.settings import N_SECONDS, FS from neurodsp.sim.cycles import * ################################################################################################...
null
neurodsp/tests/sim/test_cycles.py
test_cycles.py
py
2,133
python
en
code
null
code-starcoder2
83
[ { "api_name": "neurodsp.tests.settings.N_SECONDS", "line_number": 17, "usage_type": "argument" }, { "api_name": "neurodsp.tests.settings.FS", "line_number": 17, "usage_type": "argument" }, { "api_name": "neurodsp.tests.tutils.check_sim_output", "line_number": 18, "usage_t...
272962595
# -*- coding: utf-8 -*- """ Created on Wed Jan 6 18:11:27 2021 @author: LJB """ from PIL import Image im_num=40 for k in range(im_num): im = Image.open('{}.png'.format(k+1)) pix = im.load() for i in range(im.size[0]): for j in range(im.size[1]): L=0.2126*pix[i,j][0]+0.7152*pix[i,j][...
null
dogface/흑백변환_dog.py
흑백변환_dog.py
py
432
python
en
code
null
code-starcoder2
83
[ { "api_name": "PIL.Image.open", "line_number": 13, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 13, "usage_type": "name" } ]
416157476
import requests, urllib3, urllib,time from bs4 import BeautifulSoup from selenium import webdriver urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) # 截图网页保存 def capture(url, name): browser = webdriver.PhantomJS() # 被标记过时了 browser.set_window_size(1200, 900) browser.get(url) print(...
null
getwiki.py
getwiki.py
py
1,591
python
en
code
null
code-starcoder2
83
[ { "api_name": "urllib3.disable_warnings", "line_number": 5, "usage_type": "call" }, { "api_name": "urllib3.exceptions", "line_number": 5, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.PhantomJS", "line_number": 11, "usage_type": "call" }, { "api_n...
590252536
#!/usr/bin/python """ This python script is to validate an output of a Ansible playbook. It validates whether output of a playbook is a valid JSON object or not. It also checks if all the required fields mentioned under in `fields_to_check` variable are present in the JSON object or not. Example Usage: python pn_vali...
null
ansible/playbooks/pn_validate_json.py
pn_validate_json.py
py
2,715
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.argv", "line_number": 25, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 30, "usage_type": "attribute" }, { "api_name": "subprocess.check_output", "line_number": 42, "usage_type": "call" }, { "api_name": "shlex.split", ...
323315456
#!/usr/bin/env python # coding: utf-8 # In[7]: import keras from keras.models import Sequential from keras.preprocessing.image import ImageDataGenerator from keras.layers import BatchNormalization from keras.layers import Conv2D, MaxPooling2D, Dense, Flatten,Activation,Dropout from keras.utils import normalize, to_c...
null
SERB_Apple_leafs_disease_detection model.py
SERB_Apple_leafs_disease_detection model.py
py
2,986
python
en
code
null
code-starcoder2
83
[ { "api_name": "keras.backend.image_data_format", "line_number": 27, "usage_type": "call" }, { "api_name": "keras.backend", "line_number": 27, "usage_type": "name" }, { "api_name": "keras.preprocessing.image.ImageDataGenerator", "line_number": 33, "usage_type": "call" },...
445182703
from datetime import datetime import icalendar from dateutil.tz.tz import tzoffset from todoman.model import Database from todoman.model import FileTodo from todoman.model import List def test_querying(create, tmpdir): for list in 'abc': for i, location in enumerate('abc'): create( ...
null
tests/test_model.py
test_model.py
py
3,585
python
en
code
null
code-starcoder2
83
[ { "api_name": "todoman.model.Database", "line_number": 22, "usage_type": "call" }, { "api_name": "todoman.model.Database", "line_number": 44, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 48, "usage_type": "call" }, { "api_name": "dateu...
344469469
#!/usr/bin/env python # Ndiff # # This programs reads two Nmap XML files and displays a list of their # differences. # # Copyright 2008 Insecure.Com LLC # Ndiff is distributed under the same license as Nmap. See the file COPYING or # https://nmap.org/data/COPYING. See https://nmap.org/book/man-legal.html for # more de...
null
core/ndiff.py
ndiff.py
py
41,313
python
en
code
null
code-starcoder2
83
[ { "api_name": "xml.__path__", "line_number": 24, "usage_type": "attribute" }, { "api_name": "xml.sax", "line_number": 36, "usage_type": "attribute" }, { "api_name": "io.StringIO", "line_number": 39, "usage_type": "call" }, { "api_name": "xml.sax.make_parser", ...
457388938
""" Importa a biblioteca csv Abre o arquivo .csv Lê o arquivo .csv e transfere o conteúdo para a variável tabela, como uma lista Imprime o conteúdo da lista Colocar os arquivos csv em uma pasta dados, na mesma localização do arquivo manage.py """ """ class Convenio(models.Model): convenio = models.CharField(max_l...
null
Popula_tabelas.py
Popula_tabelas.py
py
12,831
python
en
code
null
code-starcoder2
83
[ { "api_name": "Alisystem.models.Convenio.objects.all", "line_number": 18, "usage_type": "call" }, { "api_name": "Alisystem.models.Convenio.objects", "line_number": 18, "usage_type": "attribute" }, { "api_name": "Alisystem.models.Convenio", "line_number": 18, "usage_type":...
159823775
# -*- coding: utf-8 -*- """ Created on Thu Aug 18 00:41:29 2022 @author: lankuohsing """ import math import torch import torch.nn as nn import numpy as np import matplotlib.pyplot as plt # In[] class Embeddings(nn.Module): def __init__(self, d_model, vocab): super(Embeddings, self).__init__() self....
null
transformer/annotated_transformer/input_encoding.py
input_encoding.py
py
4,005
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.nn.Module", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.nn.Embedding", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.nn", "line...
652283651
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Sponsor.slug' db.add_column('base_sponsor', 'slug', self.gf('django.db...
null
trephub/base/migrations/0002_auto__add_field_sponsor_slug__add_unique_sponsor_name.py
0002_auto__add_field_sponsor_slug__add_unique_sponsor_name.py
py
1,399
python
en
code
null
code-starcoder2
83
[ { "api_name": "south.v2.SchemaMigration", "line_number": 8, "usage_type": "name" }, { "api_name": "south.db.db.add_column", "line_number": 12, "usage_type": "call" }, { "api_name": "south.db.db", "line_number": 12, "usage_type": "name" }, { "api_name": "south.db.d...
493417153
from polling_regions import polling_regions from polling_essentials import parties, RegionalTotals, Seat import csv, json, math, sys from datetime import datetime seats = {} regional = {} percentages = {} with open("2015election.json") as f: data = json.load(f) for seat in data: seats[seat] = Seat(da...
null
analysis.py
analysis.py
py
2,536
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.load", "line_number": 12, "usage_type": "call" }, { "api_name": "polling_essentials.Seat", "line_number": 14, "usage_type": "call" }, { "api_name": "polling_regions.polling_regions.iteritems", "line_number": 19, "usage_type": "call" }, { "api_n...
372297018
import os os.environ["CUDA_VISIBLE_DEVICES"]="2" import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.utils import shuffle from keras.models import Model from keras.layers import Input, Embedding, Flatten, Dense, Concatenate from keras.layers import Dropout, BatchNormalization, Activatio...
null
Recommender_System/New_app/Recomender_Model.py
Recomender_Model.py
py
11,274
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ", "line_number": 2, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "sklearn.utils.shuffle", "line_number": 26, "usage_type": "call" }, { "api_name": "keras.layers.Inp...
175872160
#!/usr/bin/env python import argparse import os import sys import subprocess as sp from zeep import Client NUMBER_OF_COMMITS = 1000 SOAP_URL = 'http://mantis.cipafilter.com/api/soap/mantisconnect.php?wsdl' MANTIS_URL = 'mantis.cipafilter.com/view.php?id=' def initialize_args(): """ Three arguments are requ...
null
scan_commits.py
scan_commits.py
py
8,868
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 24, "usage_type": "call" }, { "api_name": "subprocess.check_output", "line_number": 112, "usage_type": "call" }, { "api_name": "subprocess.CalledProcessError", "line_number": 120, "usage_type": "attribute" }, { ...
237673422
import numpy as np from PIL import Image import torch import os import torch.utils.data as data from glob import glob from .common import BaseDataset class davis2017(BaseDataset): def __init__(self, base_dir, split, transforms=None, to_tensor=None): super(davis2017, self).__init__(base_dir) self.s...
null
dataloaders/davis2017.py
davis2017.py
py
6,586
python
en
code
null
code-starcoder2
83
[ { "api_name": "common.BaseDataset", "line_number": 10, "usage_type": "name" }, { "api_name": "os.listdir", "line_number": 30, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 41, "usage_type": "call" }, { "api_name": "os.walk", "line_number":...
460763129
from PyQt5 import QtCore, QtWidgets from ui_Widgets import uni_Widget class ui_MorsePanel(QtWidgets.QWidget): def __init__(self): super(ui_MorsePanel, self).__init__() self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self) self.horizontalLayout_4.setObjectName("horizontalLayout_4") ...
null
CryptoPanel/OldFiles/MorseModule/ui_MorseModule.py
ui_MorseModule.py
py
3,767
python
en
code
null
code-starcoder2
83
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 5, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 5, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QHBoxLayout", "line_number": 9, "usage_type": "call" }, { "api_name": ...
224016470
from __future__ import absolute_import from __future__ import division from __future__ import print_function import cv2 import numpy as np from progress.bar import Bar import time import torch from external.nms import soft_nms from models.decode import ctdet_decode, ctdet_twostage_decode, ctdet_multiscale_decode from...
null
src/lib/detectors/ctdet.py
ctdet.py
py
5,703
python
en
code
null
code-starcoder2
83
[ { "api_name": "base_detector.BaseDetector", "line_number": 20, "usage_type": "name" }, { "api_name": "torch.no_grad", "line_number": 25, "usage_type": "call" }, { "api_name": "models.utils.flip_tensor", "line_number": 32, "usage_type": "call" }, { "api_name": "mod...
587422058
import argparse import math import os import pickle import re import sys import psutil from hypernets.utils import const, logging metric_choices = ['accuracy', 'auc', 'f1', 'logloss', 'mse', 'mae', 'msle', 'precision', 'rmse', 'r2', 'recall'] strategy_choices = ['threshold', 'quantile', 'number'] def to_bool(v): ...
null
hypergbm/utils/tool.py
tool.py
py
25,196
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentTypeError", "line_number": 24, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 35, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 35, "usage_type": "attribute" }, { "api_name": "dask.distri...
618974176
#Tests proper handling of multiple MeritRemovals. #Tests proper creation and handling of multiple MeritRemovals when Meros receives multiple causes for a MeritRemoval. #Types. from typing import Dict, IO, Any #Data class. from PythonTests.Classes.Transactions.Data import Data #SignedMeritRemoval class. from PythonTe...
null
PythonTests/Tests/Consensus/MeritRemoval/MultipleTest.py
MultipleTest.py
py
3,786
python
en
code
null
code-starcoder2
83
[ { "api_name": "PythonTests.Meros.RPC.RPC", "line_number": 31, "usage_type": "name" }, { "api_name": "typing.IO", "line_number": 33, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 33, "usage_type": "name" }, { "api_name": "typing.Dict", "lin...
109843557
from __future__ import print_function from builtins import object, str from typing import Dict from empire.server.core.module_models import EmpireModule from empire.server.utils.module_util import handle_error_message class Module(object): @staticmethod def generate( main_menu, module: Empir...
null
empire/server/modules/powershell/code_execution/invoke_ntsd.py
invoke_ntsd.py
py
4,174
python
en
code
null
code-starcoder2
83
[ { "api_name": "builtins.object", "line_number": 10, "usage_type": "name" }, { "api_name": "empire.server.core.module_models.EmpireModule", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 15, "usage_type": "name" }, { "api_nam...
593644030
import logging import sqlite3 from typing import Any, cast, Iterator, List, Optional, Set import json from tqdm import tqdm import requests from .data import BlockBounds, EventType, NFTEvent, event_types from .datastore import ( get_checkpoint_offset, get_events_for_enrich, insert_address_metadata, in...
null
datasets/nfts/nfts/enrich.py
enrich.py
py
4,942
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.basicConfig", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 19, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "typing.List",...
307051427
from flask import Flask, render_template, redirect, url_for, flash, g, request from flask_login import LoginManager, login_required, login_user from flask_sqlalchemy import SQLAlchemy from sqlalchemy import exc import os app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///app.db' app.config["SECRE...
null
app.py
app.py
py
2,549
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 12, "usage_type": "call" }, { "api_name": "flask_login.LoginManager", "line_number": 13, "usage_type": "call" }, { "api_name": "flask...
575294210
import csv import datetime import os import requests import twitter path = os.path.dirname(os.path.realpath(__file__)) path = os.path.join(path, '01 Data') filename = os.path.join(path, 'data.csv') if not os.path.exists(filename): with open(filename, 'w') as f: f.write('date,name,party,facebook,twitter,l...
null
test1.py
test1.py
py
4,756
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.join", "line_n...
215604641
import pandas import random import numpy from lib import util import xgboost as xgb from sklearn.model_selection import GridSearchCV, train_test_split from sklearn.metrics import confusion_matrix, classification_report def train(): train_data = _read() train_X, test_X, train_Y, test_Y = _split(train_data) ...
null
prj/else/xgboost.py
xgboost.py
py
2,009
python
en
code
null
code-starcoder2
83
[ { "api_name": "xgboost.XGBClassifier", "line_number": 15, "usage_type": "call" }, { "api_name": "sklearn.model_selection.GridSearchCV", "line_number": 16, "usage_type": "call" }, { "api_name": "xgboost.XGBClassifier", "line_number": 20, "usage_type": "call" }, { "...
242942026
from django.urls import path from . import views app_name = 'posts' urlpatterns = [ path('', views.PostList.as_view(), name='all'), path('new/', views.CreatePost.as_view(), name='create'), path('by/<username>/', views.UserPosts.as_view(), name='for_user'), # by/username/ - all posts for that user path...
null
forum_project/posts/urls.py
urls.py
py
554
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", ...
211999474
import logging from io import StringIO import yaml from .dict_util import deep_dict_merge logger = logging.getLogger(__name__) def load_global_config(global_cfg_paths): """Given a list of file paths to global config files, load each of them and return the joined dictionary. This does a deep dict merge...
null
tavern/util/general.py
general.py
py
980
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "yaml.load", "line_number": 29, "usage_type": "call" }, { "api_name": "dict_util.deep_dict_merge", "line_number": 31, "usage_type": "call" }, { "api_name": "io.StringIO", ...
530599430
import os import h5py import hydra import torch import torch.nn as nn from torch.utils.tensorboard import SummaryWriter import torch.multiprocessing as mp import torch.distributed as dist import itertools import numpy as np import skimage.io as skio import imagesize from tqdm import tqdm from nltk.tokenize import word_...
null
exp/gpv/compute_vqa_test_predictions.py
compute_vqa_test_predictions.py
py
3,756
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path", "line_number": 30, "usage_type": "attribute" }, { "api_name": "nltk.tokenize.treebank.TreebankWordDetokenizer", "line_number": 33, "usage_type": "call" }, { "api_name...
445910446
from colab_ssh._command import run_command as _run_command import os import sys import importlib import requests from .get_tunnel_config import get_tunnel_config def parse_folder_name(array): import re sys.path.insert(0, "./"+re.search("'(.*?)'", array[0]).groups(1)[0]) def init_git(repositoryUrl, ...
null
colab_ssh/init_git.py
init_git.py
py
2,511
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.insert", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "re.search", "line_number": 11, "usage_type": "call" }, { "api_name": "colab_ssh._command.run_comman...
463328439
#!/usr/bin/env python3 import sys import datetime from collections import defaultdict, namedtuple from whatshap.args import HelpfulArgumentParser as ArgumentParser import vcf from array import array #from whatshap.vcf import VcfReader # =================================================================================...
null
consensus-genotypes-freebayes-gatk.py
consensus-genotypes-freebayes-gatk.py
py
17,425
python
en
code
null
code-starcoder2
83
[ { "api_name": "array.array", "line_number": 100, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 179, "usage_type": "call" }, { "api_name": "vcf.Reader", "line_number": 199, "usage_type": "call" }, { "api_name": "array.array", "l...
317994151
from django import forms from .models import Answer, PendingQuestion, Question class NewPendingQuestionForm(forms.ModelForm): pending_question_description = forms.CharField(widget=forms.Textarea( attrs={'rows': 5, 'placeholder': 'Write something'} ), max_length=2000, help_text='The max length is 2000'...
null
Questions/forms.py
forms.py
py
919
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.forms.ModelForm", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 5, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 6, "usage_type": "call" }, { "api_name": "django.f...
414946014
# -*- coding: utf-8 -*- import cv2 import sys import numpy as np from sklearn.neural_network import MLPClassifier from sklearn.externals import joblib import pylab as plt # 学習に用いる縮小画像のサイズ sw = 160 sh = 120 # 学習結果を保存するファイルの決定 if len(sys.argv)!=2: print('使用法: python ml-08-03-learn.py 保存ファイル名.pkl') sys.exit() sa...
null
hand-learn4.py
hand-learn4.py
py
3,626
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.argv", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 17, "usage_type": "attribute" }, { "api_name": "cv2.findNonZero", "line_numb...
533517772
# coding:utf-8 """ 县以上(省,市,县或区)行政区划: 2018年8月中华人民共和国县以上行政区划代码 http://www.mca.gov.cn/article/sj/xzqh/2018/201804-12/20180810101641.html """ import time import requests from lxml import etree from level3.db import utils as db_utils from level3.db.models import * def load_html(url): """加载html数据""" headers={ ...
null
02_PC端/行政区划/level3/spider.py
spider.py
py
4,901
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 20, "usage_type": "call" }, { "api_name": "lxml.etree.HTML", "line_number": 27, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 27, "usage_type": "name" }, { "api_name": "level3.db.utils.save_province...
206659249
from model import GNN_graphpred import torch import torch.nn as nn import torch.optim as optim import copy class MAML(torch.nn.Module): def __init__(self, meta_lr, maml_lr, n_way, update_step, args): super(MAML, self).__init__() self.meta_lr = meta_lr self.maml_lr = maml_lr self.n_wa...
null
bio/MAML.py
MAML.py
py
3,504
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.nn", "line_number": 6, "usage_type": "attribute" }, { "api_name": "model.GNN_graphpred", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.nn.BCEWithLogitsLoss", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.nn"...
201174722
import matplotlib.pyplot as plt import numpy as np from scipy.integrate import cumtrapz initial_height = 30.0 # rider starts at an initial height of 30 meters. path = 'droptower_vdata.txt' velocity_data = np.loadtxt(path) num_interval = velocity_data.shape[0] t = velocity_data[:, 0] t_shorter = t[:-1] velocity = ...
null
tower.py
tower.py
py
1,312
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.loadtxt", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.diff", "line_number": 17, "usage_type": "call" }, { "api_name": "scipy.integrate.cumtrapz", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.mean", "li...
565135328
# **************************************************************************** # # # # ::: :::::::: # # generator.py :+: :+: :+: ...
null
bootcamp_python_ml/python/day01/ex03/generator.py
generator.py
py
1,884
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.now", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 21, "usage_type": "attribute" } ]
508545109
# selecturl # usage: # arg: none # ret: unimplemented # out: queue to geturls #---------- # read new urllist # and join it to parent dataframe #---------- def read_urllist_from_csv_to_df(parentkey, parentdepth): import pandas as pd try: df = pd.read_csv("urllist.csv") except: print("./urllist.csv is empty or no...
null
updateurldb.py
updateurldb.py
py
3,734
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 38, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 53, "usage_type": "call" }, { "api_name": "random.randint", "line_n...
222933530
from sqlalchemy.sql import text as sql from psycopg2.extras import Json from datetime import datetime from ..ut.bunch import bunchr from .error import error_guard def add_query(conn, kind, text, result={}): ret = conn.execute(sql(''' insert into query (kind, text, result) values (:kind, :text, :re...
null
torabot/db/query.py
query.py
py
3,854
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlalchemy.sql.text", "line_number": 9, "usage_type": "call" }, { "api_name": "psycopg2.extras.Json", "line_number": 13, "usage_type": "call" }, { "api_name": "sqlalchemy.sql.text", "line_number": 19, "usage_type": "call" }, { "api_name": "ut.bunch....
255842988
#!/usr/bin/env python2.7 from __future__ import print_function import argparse import multiprocessing import os import re import subprocess import sys import tarfile import textwrap from contextlib import closing from subprocess import PIPE from urlparse import urlparse import yaml from bd2k.util.files import mkdir_p...
null
src/toil_rnaseq/rnaseq_cgl_pipeline.py
rnaseq_cgl_pipeline.py
py
33,891
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.Namespace", "line_number": 48, "usage_type": "call" }, { "api_name": "multiprocessing.cpu_count", "line_number": 51, "usage_type": "call" }, { "api_name": "toil_lib.urls.download_url_job", "line_number": 59, "usage_type": "argument" }, { "a...
91086457
# -*- coding: utf-8 -*- # MIT License # # Copyright (c) 2017 IRISA, Jean Coquet, Pierre Vignet, Mateo Boudet # # 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 w...
null
test/test_cases.py
test_cases.py
py
5,155
python
en
code
null
code-starcoder2
83
[ { "api_name": "biopax2cadbiom.commons.DIR_TEST_CASES", "line_number": 59, "usage_type": "name" }, { "api_name": "biopax2cadbiom.commons.DIR_LOGS", "line_number": 78, "usage_type": "name" }, { "api_name": "biopax2cadbiom.commons.DIR_LOGS", "line_number": 82, "usage_type": ...
275047085
# Задание # 5 # # Продолжить работу над первым заданием. Разработать методы, отвечающие за приём # оргтехники на склад и передачу в определенное подразделение компании. Для хранения # данных о наименовании и количестве единиц оргтехники, а также других данных, можно # использовать любую подходящую структуру, например с...
null
I четверть/Основы языка Python (Вебинар)/lesson-8/hw_8_5.py
hw_8_5.py
py
8,146
python
en
code
null
code-starcoder2
83
[ { "api_name": "abc.ABCMeta", "line_number": 13, "usage_type": "name" }, { "api_name": "hw_8_4.OfEqPrinter", "line_number": 103, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 107, "usage_type": "call" }, { "api_name": "hw_8_4.OfEqPrinter", ...
249279140
import requests import datetime import time from pymongo import MongoClient import os import re import traceback from dingtalkchatbot.chatbot import DingtalkChatbot client = MongoClient() videoCollection = client.douyin.video idolCollection = client.douyin.idol phoneCollection = client.douyin.phone groupCollection =...
null
src/front/douyin.py
douyin.py
py
9,219
python
en
code
null
code-starcoder2
83
[ { "api_name": "pymongo.MongoClient", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 206, "usage_type": "call" }, { "api_name": "os.path", "line_number": 206, "usage_type": "attribute" }, { "api_name": "config.settings._base...
159491201
import pygame from pygame.locals import * import math import sys import random from pygame.locals import QUIT , Rect, \ KEYDOWN, K_LEFT, K_RIGHT, K_UP, K_DOWN, K_RETURN # 画面 SCREEN = Rect(0, 0, 600, 500) screenWidht = 600 screenHeight = 500 SURFACE = pygame.display.set_mode((screenWidht,screenHeight)) FPSC...
null
2019_1122_Python_Training/team4/tanaka_nozomu/a.py
a.py
py
6,882
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.locals.Rect", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 14, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pygame...
575558184
# encoding: utf-8 from itertools import chain from lxml import etree from ..base import BaseULObject, resolve_reference, write_reference from ...base import E, read_annotations, annotate_xml, NINEML from ...context import BaseReference, Context from nineml.exceptions import NineMLUnitMismatchError from nineml.abstracti...
null
lib9ml/python/nineml/user_layer/components/base.py
base.py
py
11,068
python
en
code
null
code-starcoder2
83
[ { "api_name": "base.BaseULObject", "line_number": 12, "usage_type": "name" }, { "api_name": "itertools.chain", "line_number": 118, "usage_type": "call" }, { "api_name": "nineml.exceptions.NineMLUnitMismatchError", "line_number": 172, "usage_type": "call" }, { "api...
243109727
""" Definition of views. """ from django.shortcuts import render, redirect from django.http import HttpRequest from django.template import RequestContext from datetime import datetime,timedelta import smtplib from django.core.serializers import json from YABE import BasicData from YABE import ProjectData from YABE imp...
null
YABE/app/views.py
views.py
py
37,068
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.http.HttpRequest", "line_number": 37, "usage_type": "argument" }, { "api_name": "django.shortcuts.render", "line_number": 41, "usage_type": "call" }, { "api_name": "YABE.BasicData.HOST", "line_number": 45, "usage_type": "attribute" }, { "api_...
217769307
import time import os import glob import concurrent.futures from PIL import Image, ImageFilter img_names = glob.glob("src_img/photo*") t1 = time.perf_counter() size = (1200, 1200) def process_image(img_name): img = Image.open(img_name) img = img.filter(ImageFilter.GaussianBlur(15)) img.thumbnail(size...
null
T4. Asynchronous programming/Multiprocessing/process-images.py
process-images.py
py
604
python
en
code
null
code-starcoder2
83
[ { "api_name": "glob.glob", "line_number": 7, "usage_type": "call" }, { "api_name": "time.perf_counter", "line_number": 9, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 15, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number...
395497861
# -*- coding: utf-8 -*- """ Created on Mon Oct 26 15:32:10 2020 @author: Administrator """ import tensorflow as tf from tflearn.layers.conv import global_avg_pool from tensorflow.contrib.layers import batch_norm, flatten from tensorflow.contrib.framework import arg_scope import numpy as np import Densenet_get_data as ...
null
Densenet_mydata.py
Densenet_mydata.py
py
20,532
python
en
code
null
code-starcoder2
83
[ { "api_name": "tensorflow.name_scope", "line_number": 35, "usage_type": "call" }, { "api_name": "tensorflow.layers.conv2d", "line_number": 36, "usage_type": "call" }, { "api_name": "tensorflow.layers", "line_number": 36, "usage_type": "attribute" }, { "api_name": ...
503227256
import json import os import glob import shortuuid # type: ignore from typing import List, NamedTuple, Optional from .settings import LNBITS_DISABLED_EXTENSIONS, LNBITS_PATH class Extension(NamedTuple): code: str is_valid: bool name: Optional[str] = None short_description: Optional[str] = None ...
null
lnbits/helpers.py
helpers.py
py
3,673
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.NamedTuple", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Optional", ...
146018684
import urllib import logging from . import config from . import stats from .urls import URL from . import url_allowed LOGGER = logging.getLogger(__name__) POLICY = None valid_policies = set(('None', 'www-then-non-www')) def expand_seeds_config(crawler): urls = [] seeds = config.read('Seeds') if seeds ...
null
cocrawler/seeds.py
seeds.py
py
3,846
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "urls.append", "line_number": 32, "usage_type": "call" }, { "api_name": "urls.append", "line_number": 48, "usage_type": "call" }, { "api_name": "urllib.parse.urlsplit", ...
462767496
from glob import glob, escape from datetime import datetime from collections import defaultdict import os, os.path, sys, time import re import subprocess import errno import itertools import shutil from PIL import Image from PIL.ExifTags import TAGS import hashlib from wand.image import Image from wand.display import d...
null
pyorg.py
pyorg.py
py
9,069
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.makedirs", "line_number": 48, "usage_type": "call" }, { "api_name": "errno.EEXIST", "line_number": 50, "usage_type": "attribute" }, { "api_name": "hashlib.md5", "line_number": 55, "usage_type": "call" }, { "api_name": "wand.image.Image.open", ...
278690919
# -*- coding: utf-8 -*- import logging import re import hxl from hdx.location.country import Country from hdx.utilities.loader import load_json logger = logging.getLogger(__name__) def clean_string(s): # Normalise one or more whitespaces to a single space and remove any punctuation at the start/end except #...
null
iati/lookups.py
lookups.py
py
9,837
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 15, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 16, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 17, "u...
629726187
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Feb 21 12:08:20 2019 @author: harshwardhan """ from PIL import Image, ImageFilter img_blur = Image.open("img.jpeg") img_blur.filter(ImageFilter.GaussianBlur(15)).save('img4.jpg') img_blur = Image.open("img4.jpg") img_blur.show()
null
file_handling/plex3.py
plex3.py
py
297
python
en
code
null
code-starcoder2
83
[ { "api_name": "PIL.Image.open", "line_number": 10, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 10, "usage_type": "name" }, { "api_name": "PIL.ImageFilter.GaussianBlur", "line_number": 12, "usage_type": "call" }, { "api_name": "PIL.ImageFilter...
388529199
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages with open('README.md', 'r') as file: readme = file.read() requirements = [ 'beautifulsoup4==4.4.0', 'netaddr==0.7.18', ] setup_requirements = [ 'pytest-runner', ] test_requirements = [ 'pytest', ] setup( ...
null
setup.py
setup.py
py
1,433
python
en
code
null
code-starcoder2
83
[ { "api_name": "setuptools.setup", "line_number": 21, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 30, "usage_type": "call" } ]
463313052
#!/usr/bin/python3 from models import storage from models.state import State from flask import Flask, render_template app = Flask(__name__) app.url_map.strict_slashes = False @app.route('/states') @app.route('/states/<id>') def hello_HBNB(id=None): all_states = storage.all(State) states = list(a...
null
web_flask/9-states.py
9-states.py
py
796
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "models.storage.all", "line_number": 13, "usage_type": "call" }, { "api_name": "models.state.State", "line_number": 13, "usage_type": "argument" }, { "api_name": "models.storage",...
425530082
import unittest import numpy as np import dadi.DFE from dadi.DFE import PDFs, DemogSelModels class DFETestCase(unittest.TestCase): def test_Cache1D_generation(self): """ Trivial test that Cache1D generation doesn't crash. """ dadi.DFE.Cache1D([], [10], DemogSelModels.equil, [20, 30...
null
tests/test_DFE.py
test_DFE.py
py
11,537
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.TestCase", "line_number": 7, "usage_type": "attribute" }, { "api_name": "dadi.DFE.DFE.Cache1D", "line_number": 12, "usage_type": "call" }, { "api_name": "dadi.DFE.DFE", "line_number": 12, "usage_type": "attribute" }, { "api_name": "dadi.DFE...
341056440
from flask import render_template, redirect, send_from_directory from flask_mail import Message from app import mail from app import app from app.forms import ContactForm @app.route('/') @app.route('/index') def index(): return redirect('/index.html') @app.route('/contact', methods=['GET', 'POST']) def cont...
null
app/routes.py
routes.py
py
1,549
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.redirect", "line_number": 15, "usage_type": "call" }, { "api_name": "app.app.route", "line_number": 12, "usage_type": "call" }, { "api_name": "app.app", "line_number": 12, "usage_type": "name" }, { "api_name": "app.app.route", "line_number...
235160106
import os import json import torch from shutil import copy2 def save_best_model(net, acc): save_best_accuracy(acc) torch.save(net.state_dict(), "Results/" + os.uname()[1] + "/current/model.pt") def save_logs(epoch, loss, acc, mode): filename = "Results/" + os.uname()[1] + "/current/{}_logs.csv".format(...
null
results_handler.py
results_handler.py
py
1,684
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.save", "line_number": 10, "usage_type": "call" }, { "api_name": "os.uname", "line_number": 10, "usage_type": "call" }, { "api_name": "os.uname", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 15, ...
609775546
import datetime def time_to_day(inn): out = int(inn[0])/24#hours if inn[1][0] == "0":#minutes out = out + int(inn[1][1])/24/60 else: out = out + int(inn[1])/24/60 if inn[2][0] == "0":#minutes out = out + int(inn[1][1])/24/60/60 else: out = out + int(inn[1])/24...
null
Raw repo/code/conv_track/stats/test.py
test.py
py
710
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime", "line_number": 38, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 39, "usage_type": "call" } ]
552946587
def cur_rate(rate1, rate2, rate3): import urllib2 import json s = ('https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%3D%22{}%2C{}%2C{}%22&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys'.format(rate1, rate2,rate3)) d = ('https://...
null
Homework2.2/homework2-2.py
homework2-2.py
py
1,278
python
en
code
null
code-starcoder2
83
[ { "api_name": "urllib2.urlopen", "line_number": 7, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 10, "usage_type": "call" }, { "api_name": "urllib2.urlopen", "line_number": 13, "usage_type": "call" }, { "api_name": "json.loads", "line_numb...
325366787
from django.http import HttpResponse, HttpResponseRedirect from django.template import RequestContext, loader from .forms import ContactView from django.contrib import messages __author__ = "Aniruddha Ravi" __license__ = "MIT" __version__ = "1.0.3" __email__ = "aniruddha.ravi@gmail.com" __status__ = "Development" de...
null
mvp/contact/views.py
views.py
py
773
python
en
code
null
code-starcoder2
83
[ { "api_name": "forms.ContactView", "line_number": 14, "usage_type": "call" }, { "api_name": "django.contrib.messages.add_message", "line_number": 18, "usage_type": "call" }, { "api_name": "django.contrib.messages", "line_number": 18, "usage_type": "name" }, { "api...
72804928
import numpy as np from io import BytesIO import time import PIL from bs4 import BeautifulSoup import requests from PIL import Image import PIL import random import glob import os import imageio def get_soup(link=None): rls = requests.get(link) soup = BeautifulSoup(rls.content, 'html.parser') ...
null
download_toronto_dataset.py
download_toronto_dataset.py
py
2,029
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 24, "usage_type": "call" }, { "api_name": "PIL.Image.open", "lin...
492478242
import csv from math import sin, asin, cos, radians, fabs, sqrt import numpy as np import matplotlib.pyplot as plt from sklearn.impute import SimpleImputer #calculate distance with GPS EARTH_RADIUS=6378137 def hav(theta): s = sin(theta / 2) return s * s def get_distance_hav(lat0, lng0, lat1, lng1): lat...
null
code/Analysis.py
Analysis.py
py
4,525
python
en
code
null
code-starcoder2
83
[ { "api_name": "math.sin", "line_number": 11, "usage_type": "call" }, { "api_name": "math.radians", "line_number": 15, "usage_type": "call" }, { "api_name": "math.radians", "line_number": 16, "usage_type": "call" }, { "api_name": "math.radians", "line_number": ...
637130449
# -*- coding: utf-8 -*- import scrapy from scrapy.linkextractors import LinkExtractor from scrapy.spiders import CrawlSpider, Rule from ..items import ProxyPollItem class ProxiesSpider(CrawlSpider): name = 'proxies' allowed_domains = ['kuaidaili.com'] start_urls = ['http://www.kuaidaili.com/free'] ru...
null
proxy_poll/proxy_poll/spiders/proxies.py
proxies.py
py
1,041
python
en
code
null
code-starcoder2
83
[ { "api_name": "scrapy.spiders.CrawlSpider", "line_number": 8, "usage_type": "name" }, { "api_name": "scrapy.spiders.Rule", "line_number": 14, "usage_type": "call" }, { "api_name": "scrapy.linkextractors.LinkExtractor", "line_number": 14, "usage_type": "call" }, { ...
290024934
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('chores', '0011_auto_20151003_2218'), ...
null
chores/migrations/0012_auto_20151010_2028.py
0012_auto_20151010_2028.py
py
1,047
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.migrations.Migration", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.migrations.swappable_dependency", "line_number": 11, "usage_type": "call...
241731945
try: import httplib as _httplib import urlparse as _urlparse except ImportError: # 3.x! import urllib.parse as _urlparse import http.client as _httplib def _get_connection(link, *args): pieces = _urlparse.urlsplit(link) scheme, netloc, path_pieces = pieces[0], pieces[1], pieces[2:] path = _...
null
DjangoWebProject1/env/Lib/site-packages/check.py
check.py
py
878
python
en
code
null
code-starcoder2
83
[ { "api_name": "urllib.parse.urlsplit", "line_number": 9, "usage_type": "call" }, { "api_name": "urllib.parse", "line_number": 9, "usage_type": "name" }, { "api_name": "urllib.parse.urlunsplit", "line_number": 11, "usage_type": "call" }, { "api_name": "urllib.parse...
120914492
import os from PIL import Image, ImageDraw, ImageFont import settings as stg from . import player from . import obstacle from . import utility class Stage: def __init__(self): self.first_player = None self.second_player = None self.players = [] self.images = [] self.frame =...
null
res/lib/stage.py
stage.py
py
6,009
python
en
code
null
code-starcoder2
83
[ { "api_name": "settings.SCALE", "line_number": 18, "usage_type": "attribute" }, { "api_name": "PIL.Image.new", "line_number": 27, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 27, "usage_type": "name" }, { "api_name": "settings.WIDTH", "lin...
296804316
""" Work in progress :) Anais """ #reload all parameters and modules import qt # reload all parameters and modules, import classes from measurement.scripts.espin import espin_funcs as funcs reload(funcs) from measurement.scripts.espin.calibrations import standard_espin_calibrations_v2 as calib reload(calib) SAMPLE = ...
null
scripts/espin/calibrations/test_pi4_calibration.py
test_pi4_calibration.py
py
5,380
python
en
code
null
code-starcoder2
83
[ { "api_name": "measurement.scripts.espin.espin_funcs", "line_number": 10, "usage_type": "argument" }, { "api_name": "measurement.scripts.espin.calibrations.standard_espin_calibrations_v2", "line_number": 12, "usage_type": "argument" }, { "api_name": "qt.exp_params", "line_num...
92375516
#!/usr/bin/pyhton # DEBUG: 10 # INFO: 20 # WARNING: 30 # ERROR: 40 # CRITICAL: 50 import logging import employee2 #logging.basicConfig(filename='logs/sample2.log', level=logging.DEBUG, \ # format='%(asctime)s | %(name)s | %(levelname)s | %(message)s' ) # logger = logging.getLogger(__name__) logg...
null
python_scripts/bin/pyclass/sample2.py
sample2.py
py
2,634
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 17, "usage_type": "attribute" }, { "api_name": "logging.Formatter", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.FileHa...
35613376
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Dec 19 11:09:32 2018 @author: austinhsu """ import numpy as np import jieba from gensim.models import word2vec #from keras.utils import to_categorical #from keras.preprocessing.sequence import pad_sequences #from keras.models import Sequential #from ke...
null
hw4/problem_files/test_only_words.py
test_only_words.py
py
2,240
python
en
code
null
code-starcoder2
83
[ { "api_name": "jieba.load_userdict", "line_number": 17, "usage_type": "call" }, { "api_name": "gensim.models.word2vec.Word2Vec.load", "line_number": 18, "usage_type": "call" }, { "api_name": "gensim.models.word2vec.Word2Vec", "line_number": 18, "usage_type": "attribute" ...