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
455414724
# -*- coding: utf-8 -*- """Syslog raw sender provider""" from datetime import datetime from builtins import input from .base_sender import BaseSender class SyslogRawSender(BaseSender): """Generate a lot of events from/for Syslog""" def __init__(self, engine, template, **kwargs): BaseSender.__init__(se...
null
devoutils/faker/senders/syslog_raw_sender.py
syslog_raw_sender.py
py
1,206
python
en
code
null
code-starcoder2
76
[ { "api_name": "base_sender.BaseSender", "line_number": 8, "usage_type": "name" }, { "api_name": "base_sender.BaseSender.__init__", "line_number": 11, "usage_type": "call" }, { "api_name": "base_sender.BaseSender", "line_number": 11, "usage_type": "name" }, { "api_...
109177093
#!/usr/bin/python3 # # sts-sru : Get a list of LP bugs with sts-sru tag # # Copyright (C) 2016 Louis bouchard <louis.bouchard@canonical.com> # import argparse import sys from BugTasks import BugTasks tag = None def main(arguments): sru = BugTasks() sru.login() if arguments.sru: tag = 'sts-sru-nee...
null
sts_tag_queries/sts_query.py
sts_query.py
py
1,642
python
en
code
null
code-starcoder2
76
[ { "api_name": "BugTasks.BugTasks", "line_number": 15, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 34, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 49, "usage_type": "attribute" } ]
309166261
"""This module requires lxml and nltk!""" from lxml.cssselect import CSSSelector import lxml.html import nltk import re import urllib2 import random content = [] irc = None def init(bot): global irc irc = bot irc.cmd.events['PRIVMSG'].subscribe(privmsg) def privmsg(sender, args): g...
null
plugin/textgen.py
textgen.py
py
3,198
python
en
code
null
code-starcoder2
76
[ { "api_name": "nltk.tokenize.punkt.PunktSentenceTokenizer", "line_number": 26, "usage_type": "call" }, { "api_name": "nltk.tokenize", "line_number": 26, "usage_type": "attribute" }, { "api_name": "urllib2.urlopen", "line_number": 32, "usage_type": "call" }, { "api...
181169525
import torch import torch.nn as nn class PruningWeight(object): def __init__(self, ratio=0.0): self.MaskList = [] self.threshold = [] self.ratio = ratio def Init(self, model): for m in model.modules(): if isinstance(m, nn.Linear) or isinstan...
null
HW5/sparse_to_fill.py
sparse_to_fill.py
py
2,895
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Linear", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.no_grad", ...
481738659
import requests from bs4 import BeautifulSoup page_nasdaq = requests.get("https://www.bloomberg.com/quote/CCMP:IND") soup = BeautifulSoup(page_nasdaq.content, 'html.parser') name_box_nasdaq = soup.find('h1', attrs={'class': 'name'}) nome_nasdaq = name_box_nasdaq.text.strip() print(nome_nasdaq) price_box_nasdaq = soup....
null
Parte_1.py
Parte_1.py
py
1,723
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 4, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 5, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "li...
188840988
import numpy as np import random as rd from sensor import sensor import uuid ''' - at least 1 thermostat - at least one co2 sensor - random amount subject to function - need to pass in the building and room id to make composite sensor id ''' ''' - contains dictionary of sensors that report a metri...
null
scripts/room.py
room.py
py
1,456
python
en
code
null
code-starcoder2
76
[ { "api_name": "sensor.sensor", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.int64", "line_number": 31, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 31, "usage_type": "call" }, { "api_name": "random.randint", "line_numbe...
346288761
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.index), url(r'^consultar/$', views.consultar, name='consultar'), url(r'^detalle/$', views.detalle, name='detalle'), #url(r'^consultarlink/(?P<palabra>\d+)/$', views.consultarlink, name='consultarlink'), ]
null
buscador/urls.py
urls.py
py
308
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" } ]
205234257
"""Next-gen variant detection and evaluation with GATK and SnpEff. """ import os import json import subprocess from bcbio.variation.recalibrate import gatk_recalibrate from bcbio.variation.realign import gatk_realigner from bcbio.variation.genotype import gatk_genotyper, gatk_evaluate_variants # ## Recalibration def...
null
nextgen/bcbio/pipeline/variation.py
variation.py
py
2,652
python
en
code
null
code-starcoder2
76
[ { "api_name": "bcbio.variation.recalibrate.gatk_recalibrate", "line_number": 17, "usage_type": "call" }, { "api_name": "subprocess.check_call", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 32, "usage_type": "call" }, { ...
432452482
from datasette.app import Datasette import numpy as np import os from tables import * import tempfile def app_client(max_returned_rows=None): with tempfile.TemporaryDirectory() as tmpdir: filepath = os.path.join(tmpdir, 'test_tables.h5') populate_file(filepath) ds = Datasette( [...
null
tests/fixtures.py
fixtures.py
py
1,588
python
en
code
null
code-starcoder2
76
[ { "api_name": "tempfile.TemporaryDirectory", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "datasette.app.Data...
40186995
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for `swapi_wrapper` package.""" import pytest import responses from swapi_wrapper import Person, make_url @responses.activate def test_person_get(person_data): # Patch requests so it just returns person_data and doesn't actually hit the servers respons...
null
tests/test_person.py
test_person.py
py
1,404
python
en
code
null
code-starcoder2
76
[ { "api_name": "responses.add", "line_number": 15, "usage_type": "call" }, { "api_name": "responses.GET", "line_number": 15, "usage_type": "attribute" }, { "api_name": "swapi_wrapper.Person.resource_url", "line_number": 17, "usage_type": "attribute" }, { "api_name"...
533294183
#!/usr/bin/env python # -*- coding: utf-8 -*- # @File : main.py # @Author: wangyalei # @Date : 18/8/9 # @Desc : 1.支持自动回复白名单 config.AUTO_REPLY_LIST # 2.可配置自己发的消息是否回复 config.IS_REPLY_SELF # 3.回复源支持图灵和微软小冰配置 config.CHAT_TYPE。 # 小冰没有对应的api,模拟的微博的接口。因为微博发消息后,不能直接得到回复内容,需要延时后刷聊天列表,有失败的情况,失败后会走图...
null
main.py
main.py
py
1,396
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "config.TAG_WECHAT", "line_number": 21, "usage_type": "attribute" }, { "api_name": "wechat.smart_chat.SmartChat", "line_number": 23, "usage_type": "call" }, { "api_name": "...
122801579
# -*- coding: utf-8 -*- """ Created on Sun Mar 31 18:14:02 2019 @author: LingfengZhao """ import numpy as np from matplotlib import pyplot as plt gamma = 3 alpha = np.array([0 ,0 , 1, 1]) x = np.array([0, 1, 2, 3]) y = np.array([1, -1, 1, -1]) z = np.sum(alpha * y * np.exp(- gamma* (x -x[:,None])**2), axis =0) y...
null
HW 8/4-1.py
4-1.py
py
485
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 17...
271822399
################################### # CS B551 Spring 2021, Assignment #3 # # Submitted by: Ayush Sanghavi (sanghavi) # Vighnesh Kolhatkar (vkolhatk) # Vishwas Desai (visdesai) # # (Based on skeleton code by D. Crandall) # from collections import Counter import random import math...
null
part1/pos_solver.py
pos_solver.py
py
13,343
python
en
code
null
code-starcoder2
76
[ { "api_name": "math.log", "line_number": 41, "usage_type": "call" }, { "api_name": "math.log", "line_number": 43, "usage_type": "call" }, { "api_name": "math.log", "line_number": 52, "usage_type": "call" }, { "api_name": "math.log", "line_number": 54, "usa...
90144094
import base64 import math import os import time import numpy import sys import tornado.websocket def encoding_base64(dim=4096): array = numpy.random.rand(dim, dim) arr_to_str = array.tostring() start_time = time.time() encoding = base64.b64encode(arr_to_str) time_from_encoding = time.time() - sta...
null
tornado/ws_server.py
ws_server.py
py
2,046
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.rand", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 12, "usage_type": "attribute" }, { "api_name": "time.time", "line_number": 14, "usage_type": "call" }, { "api_name": "base64.b64encode", ...
386522570
# OBJECTIVE # Find the central node of a tree that has the shortest maximum distance to all the leafs of the tree and return that shortest distance # INPUT # N - Number of links # Next N lines are 2 space separated ints specifying a link between 2 nodes. # OUTPUT # Single int representing the minimal amount of steps ...
null
ClassicMedium/Teads/core.py
core.py
py
3,979
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.stderr.write", "line_number": 37, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 37, "usage_type": "attribute" }, { "api_name": "collections.defaultdict", "line_number": 77, "usage_type": "call" }, { "api_name": "collections....
366382723
"""Pipeline for the VLASS SOM The SOM is trained on a separate dataset. """ import os, sys import shutil import subprocess import numpy as np import pandas as pd from astropy.table import Table, vstack from legacy_survey_cutout_fetcher import grab_vlass_unwise_cutouts import pyink as pu import vlass_data_loader as vd...
null
ComplexXID/vlass_som_pipeline.py
vlass_som_pipeline.py
py
7,539
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number": 29, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "line_number": 3...
162089619
# -*- coding: utf-8 -*- """ Created on Tue Apr 27 16:27:41 2021 @author: Alexandre """ import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output import plotly.graph_objs as go import pandas as pd from app import app from plotly.subplots import make_...
null
apps/emplois_app.py
emplois_app.py
py
3,603
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 22, "usage_type": "call" }, { "api_name": "plotly.subplots.make_subplots", "line_number": 28, "usage_type": "call" }, { "api_name": "plotly....
60412330
import torch from torch import nn from torchvision.models.vgg import vgg16 # Copied from CS231N Github def tv_loss(img, tv_weight): """ Compute total variation loss. Inputs: - img: PyTorch Variable of shape (1, 3, H, W) holding an input image. - tv_weight: Scalar giving the weight w_t to use for th...
null
loss.py
loss.py
py
2,819
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.sum", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.pow", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.sum", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.pow", "line_number": 17, ...
606323751
"""Work experience serializer serializer.""" # Django from django.shortcuts import get_object_or_404 # Django REST Framework from rest_framework import serializers # Models from api.programs.models import Student from api.users.models import User from datetime import timedelta class CourseStudentMo...
null
api/programs/serializers/courses/students.py
students.py
py
1,525
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 16, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 16, "usage_type": "name" }, { "api_name": "rest_framework.serializers.SerializerMethodField", "line_number": ...
651673114
from sys import stdin from collections import deque n, s = map(int, stdin.readline().split()) t = list(map(int, stdin.readline().split(' '))) check = [False for _ in range(n)] arr = deque() ans = 0 def find(index): if sum(arr) == s and len(arr) != 0: global ans ans += 1 for i in range(index, n)...
null
baekjoon/7주차/1182-부분수열의-합/우섭/1182.py
1182.py
py
498
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.stdin.readline", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 3, "usage_type": "name" }, { "api_name": "sys.stdin.readline", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.stdin", "line_nu...
639942639
# -*- coding: utf-8 -*- """Automated Tool for Optimized Modelling (ATOM). Author: Mavs Description: Module containing utility constants, functions and classes. """ # Standard packages import math import logging import numpy as np import pandas as pd from typing import Union from functools import wraps from collecti...
null
atom/utils.py
utils.py
py
43,580
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.ndarray", "line_number": 92, "usage_type": "attribute" }, { "api_name": "pandas.Series", "line_number": 92, "usage_type": "attribute" }, { "api_name": "typing.Union", "line_number": 95, "usage_type": "name" }, { "api_name": "typing.Union", ...
19948090
# -*- coding: utf-8 -*- # @Author: loopingleo # @Date: 2018-09-13 # @Last Modified by: # @Last Modified time: import gpxpy.parser as parser import os, glob import pandas as pd import matplotlib.pyplot as plt import numpy as np import csv import urllib.request, json from pprint import pprint import requests import ...
null
createEVtable.py
createEVtable.py
py
14,470
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ.get", "line_number": 26, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 26, "usage_type": "attribute" }, { "api_name": "ssl._create_default_https_context", "line_number": 28, "usage_type": "attribute" }, { "api_name": ...
63219723
import pandas as pd import numpy as np from zipline.api import symbol, order, record, sid, get_datetime, order_target_percent from zipline import run_algorithm import pytz class stg(): def __init__(self, dict_dt_sec_wgt): # self.dict_dt_sec_wgt = dict_dt_sec_wgt self.lst_assets = [str(x) for x in ...
null
CH_Analyzer/ch_analyzer.py
ch_analyzer.py
py
3,374
python
en
code
null
code-starcoder2
76
[ { "api_name": "zipline.api.symbol", "line_number": 18, "usage_type": "call" }, { "api_name": "zipline.api.get_datetime", "line_number": 30, "usage_type": "call" }, { "api_name": "zipline.api.order_target_percent", "line_number": 61, "usage_type": "call" }, { "api_...
445680002
# coding=utf-8 # Copyright 2018 The TensorFlow Datasets Authors. # # 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 appl...
null
tensorflow_datasets/testing/dataset_builder_testing.py
dataset_builder_testing.py
py
5,645
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.test", "line_number": 35, "usage_type": "attribute" }, { "api_name": "tempfile.mkdtemp", "line_number": 72, "usage_type": "call" }, { "api_name": "tensorflow.test.get_temp_dir", "line_number": 72, "usage_type": "call" }, { "api_name": "te...
46091017
import Settings import tornado.ioloop import tornado.web import burnup import frequency import verify_status class Application(tornado.web.Application): def __init__(self): handlers = [ (r"/", MainHandler), ] settings = { "template_path":Settings.TEMPLATE_PATH, ...
null
server.py
server.py
py
1,025
python
en
code
null
code-starcoder2
76
[ { "api_name": "tornado.ioloop.web", "line_number": 8, "usage_type": "attribute" }, { "api_name": "tornado.ioloop", "line_number": 8, "usage_type": "name" }, { "api_name": "Settings.TEMPLATE_PATH", "line_number": 14, "usage_type": "attribute" }, { "api_name": "Sett...
426895291
# -*- coding: utf-8 -*- """ Created on Tue Oct 20 16:13:45 2015 @author: cai """ import urllib import time import os from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.common.exceptions import ElementNotVisibleException,StaleElementReferenceException import socket class Craw...
null
Python/Spiders/BaiduImageSpyder_new.py
BaiduImageSpyder_new.py
py
9,897
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path", "line_number": 31, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "line_number": 3...
130361268
from django.contrib.auth.decorators import login_required from django.http import JsonResponse from django.shortcuts import render, redirect from rest_framework.decorators import api_view from rest_framework import status from accounts.models import Professional from jobs.forms import EducationHistoryForm from jobs.mo...
null
src/jobs/views/education_history.py
education_history.py
py
2,404
python
en
code
null
code-starcoder2
76
[ { "api_name": "jobs.models.EducationHistory.objects.filter", "line_number": 19, "usage_type": "call" }, { "api_name": "jobs.models.EducationHistory.objects", "line_number": 19, "usage_type": "attribute" }, { "api_name": "jobs.models.EducationHistory", "line_number": 19, "...
546407702
import os import pickle import click INDEX_DEFAULT="index.idx" class FileRecord(): """A FileRecord contains the file path and relevant metadata for indexing""" def __init__( self, fullpath=None, basename=None, size=None, type=None ): self.fullpath = fullpath self.basena...
null
index_proj.py
index_proj.py
py
4,063
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.basename", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path", "line_number": 32, "usage_type": "attribute" }, { "api_name": "os.path.getsize", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path", "line_num...
47480279
import numpy as np import h5py from utilities import calculate_scalar, scale class DataGenerator(object): def __init__(self, hdf5_path, batch_size, fold_for_validation, scale, seed=1234): self.random_state = np.random.RandomState(seed) # Load data hf = h5py.File(hdf5_path, ...
null
data_generator.py
data_generator.py
py
3,444
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.RandomState", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 11, "usage_type": "attribute" }, { "api_name": "h5py.File", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.newaxis", ...
140352331
import datetime def crear_mes(nombre, abreviatura, cantidad): """ Dados los parametros se imprime en consola un texto informativo :param nombre: str - nombre del mes :param abreviatura: str - abreviatura del mes :param cantidad: int - cantidad de dias del mes :return: None """ devoluci...
null
Guia de Ejercicios General 01/Guia de Ejercicios General 01/fechas.py
fechas.py
py
1,021
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.strptime", "line_number": 24, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 24, "usage_type": "attribute" } ]
28645527
from setuptools import setup, find_packages import proso.release import os VERSION = proso.release.VERSION setup( name='proso-apps', version=VERSION, description='General library for applications in PROSO projects', author='Adaptive Learning Group', author_email='al@fi.muni.cz', namespace_pack...
null
setup.py
setup.py
py
2,101
python
en
code
null
code-starcoder2
76
[ { "api_name": "proso.release.release", "line_number": 5, "usage_type": "attribute" }, { "api_name": "proso.release", "line_number": 5, "usage_type": "name" }, { "api_name": "setuptools.setup", "line_number": 7, "usage_type": "call" } ]
306685068
from csv import DictReader from datetime import datetime from django.core.management.base import BaseCommand from huts.models import Hut, Region, Agency from huts.utils.null_na import from_csv, DB_NA_POS_NUM, DB_NA_STRING, DB_NA_LIST, CSV_NA, CSV_NULL from huts.utils.countries import lookup_country_code class Command...
null
src/hutmap/huts/management/commands/loadfromcsv.py
loadfromcsv.py
py
5,232
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 9, "usage_type": "name" }, { "api_name": "csv.DictReader", "line_number": 17, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 22, "usage_type": "call" }, { "api_name": "...
564795490
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.utils import spectral_norm as sn from torch.nn.utils import spectral_norm class ConvBnBlock(nn.Module): def __init__(self, in_channel, out_channel, kernel_size, padding, activation=F.relu, bn=True, mp=True, sn_=True...
null
feature_selection/networks/discriminator.py
discriminator.py
py
6,081
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "torch.nn.functional.relu", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.nn.fu...
543924894
""" VHS SCRIPT DEMO THINGY LOL MADE USING XUBUNTU 19.04 OCT-2019 """ import PIL.Image as PImage import PIL.ImageCms as PImageCms from tkinter import filedialog as File #shamelessly stolen from test.py BECAUSE IT JUST WORKS GOGAMMIT from tkinter import * startTk = Tk() startTk.withdraw() error = True while error == Tru...
null
import/send/vhs.py
vhs.py
py
2,251
python
en
code
null
code-starcoder2
76
[ { "api_name": "PIL.Image.open", "line_number": 18, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 18, "usage_type": "name" }, { "api_name": "PIL.ImageCms.createProfile", "line_number": 27, "usage_type": "call" }, { "api_name": "PIL.ImageCms", ...
191714648
import torch def desc_grad_sto(param,y_a,eps): largo, ancho = param.size() w = torch.randn(1,ancho,requires_grad=True,dtype=torch.float64) #Premier est c outputs, deuxieme est d parametres b = torch.randn(1,1,requires_grad=True,dtype=torch.float64) errores = torch.ones((largo,1)) for i in range(la...
null
TME2/TME 2 grad.py
TME 2 grad.py
py
770
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.randn", "line_number": 5, "usage_type": "call" }, { "api_name": "torch.float64", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.randn", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.float64", "line_num...
478196708
from django import template from blog.models import Post, User register = template.Library() @register.inclusion_tag('blog/sidebar.html') def random_posts(): author_id_list = Post.objects.values_list('author', flat=True).distinct() authors = User.objects.filter(pk__in=author_id_list).order_by('?')[:5] re...
null
blog/templatetags/sidebar.py
sidebar.py
py
346
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.template.Library", "line_number": 4, "usage_type": "call" }, { "api_name": "django.template", "line_number": 4, "usage_type": "name" }, { "api_name": "blog.models.Post.objects.values_list", "line_number": 9, "usage_type": "call" }, { "api_nam...
3903123
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ ******************************************** Created on Thu Apr 13 08:39:22 2017 by Chamara Rajapakshe (cpn.here@umbc.edu) ******************************************** To run Mie code and do the averaging. (Intermediate version) PSDs object: To handle size distribu...
null
Toy_clouds/Step_Cloud/cpnMielib.py
cpnMielib.py
py
14,110
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.size", "line_number": 42, "usage_type": "call" }, { "api_name": "netCDF4.Dataset", "line_number": 57, "usage_type": "call" }, { "api_name": "netCDF4.Dataset", "line_number": 76, "usage_type": "call" }, { "api_name": "numpy.hstack", "line_n...
208696523
import requests import config def pin_to_pinata(file_obj, filename): url = "https://api.pinata.cloud/pinning/pinFileToIPFS" payload = {} files = [ ('file', (filename, file_obj, 'image/jpeg')) ] headers = { 'pinata_api_key': config.PINATA_KEY, 'pinata_secret_api_key': confi...
null
pinata.py
pinata.py
py
459
python
en
code
null
code-starcoder2
76
[ { "api_name": "config.PINATA_KEY", "line_number": 13, "usage_type": "attribute" }, { "api_name": "config.PINATA_SECRET", "line_number": 14, "usage_type": "attribute" }, { "api_name": "requests.request", "line_number": 17, "usage_type": "call" } ]
71263039
import os import sys import json from libCore import * class ConfigReader(): def __init__(self): self.e = None self.cfg = None self.jsonObj = None self.cfgPathList = os.environ["CORE_CFG_PATH"].split(":") def IsOk(self): return self.cfg != None def R...
null
lib/core/libConfig.py
libConfig.py
py
3,817
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 26, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 102, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": ...
609970100
# -*- coding: utf-8 -*- # 2022/1/21 # create by: snower from .utils import is_py3, get_logger from .event import EventEmitter, null_emit_callback from .loop import instance from .buffer import Buffer, BaseBuffer, RECV_BUFFER_SIZE from .errors import SocketClosed STATE_INITIALIZED = 0x01 STATE_CONNECTING = ...
null
sevent/pipe.py
pipe.py
py
12,096
python
en
code
null
code-starcoder2
76
[ { "api_name": "event.EventEmitter", "line_number": 18, "usage_type": "name" }, { "api_name": "buffer.RECV_BUFFER_SIZE", "line_number": 20, "usage_type": "name" }, { "api_name": "buffer.RECV_BUFFER_SIZE", "line_number": 23, "usage_type": "name" }, { "api_name": "ev...
62153183
#!/usr/bin/env python2 """Angela RML Interpreter - File Utilities Created by the project angela team http://sourceforge.net/projects/projectangela/ http://www.projectangela.org""" __license__ = "GPL" __version__ = "$Revision: 0.1 $" __author__ = 'David Stocker' # ***** BEGIN GPL LICENSE BLOCK ***** # # M...
null
Grafeno/Fileutils.py
Fileutils.py
py
11,999
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.access", "line_number": 52, "usage_type": "call" }, { "api_name": "os.F_OK", "line_number": 52, "usage_type": "attribute" }, { "api_name": "os.path.split", "line_number": 53, "usage_type": "call" }, { "api_name": "os.path", "line_number": 53,...
405595406
import logging from flask import jsonify, request import flask_login from server import app from server.util.request import arguments_required, json_error_response from server.cache import cache from server.auth import user_mediacloud_key, user_mediacloud_client logger = logging.getLogger(__name__) @app.route('/api/...
null
server/views/topics/topic.py
topic.py
py
2,062
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "server.auth.user_mediacloud_client", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 16, "usage_type": "call" }, { "api_n...
557303441
#Created by Geferson Lucatelli ##lokon_GefNRock #!/usr/bin/env python # -*- coding: utf-8 -*- import matplotlib.pyplot as plt #import package to plot graphics as the abreviation plt DATE=[] #array that save the variable date TIME=[] #save variable time G_A_POWER=[] ...
null
plot.py
plot.py
py
2,032
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 27, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 27, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.hist", "line_number": 29, "usage_type": "call" }, { "api_name": "mat...
524662504
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# """ BLIS - Balancing Load of Intermittent Solar: A characteristic-based transient power plant model Copyright (C) 2020. University of Virginia Licensing & Ventures Group (UVA LVG). All Rights Reserved. Permission is hereby granted, free ...
null
projects/sCO2_feasibility/run_single_case_sCO2.py
run_single_case_sCO2.py
py
3,567
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.time", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 35, "usage_type": "call" }, { "api_name": "blis.Solar", "line_number": 38, "usage_type": "call" }, { "api_name": "blis.Battery", "line_number"...
496667270
# -*- coding: utf-8 -*- # # Copyright @2015 jinlong.yang. # # Author: jinlong.yang <yangjinlong> # import os import time import json import signal import multiprocessing from oslo.config import cfg from osmo.app.application import QApplication from osmo.core import log as logging from push.util.rmq import RabbitmqCo...
null
push/ios/apns_push/app.py
app.py
py
3,784
python
en
code
null
code-starcoder2
76
[ { "api_name": "osmo.core.log.getLogger", "line_number": 26, "usage_type": "call" }, { "api_name": "osmo.core.log", "line_number": 26, "usage_type": "name" }, { "api_name": "oslo.config.cfg.StrOpt", "line_number": 29, "usage_type": "call" }, { "api_name": "oslo.con...
561200616
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import itertools import random import typing as tp import numpy as np from . import core from . import container from . i...
null
nevergrad/parametrization/helpers.py
helpers.py
py
4,757
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.List", "line_number": 48, "usage_type": "attribute" }, { "api_name": "typing.Dict", "line_number": 20, "usage_type": "attribute" }, { "api_name": "random.shuffle", "line_number": 91, "usage_type": "call" }, { "api_name": "numpy.ones", "li...
186305582
# -*- coding: utf-8 -*- import re import scrapy from zhengce.items import failurl, zhengCejd from parse_tools.parseTools import get_urls, get_text, get_next_pages,get_js_webpage, get_page_count from datetime import datetime class A14ShanxZcjdSpider(scrapy.Spider): name = '14_shanx_zcjd' allowed_domains = ['ww...
null
spdiers/govenment/zhengce/spiders/14_shanx_zcjd.py
14_shanx_zcjd.py
py
2,644
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.Spider", "line_number": 9, "usage_type": "attribute" }, { "api_name": "parse_tools.parseTools.get_urls", "line_number": 16, "usage_type": "call" }, { "api_name": "parse_tools.parseTools.get_page_count", "line_number": 20, "usage_type": "call" }, ...
97387853
#!/usr/bin/env python """Implementation of the ParserStrategy for the TailWatch""" import sys if sys.version_info < (3,): from ConfigParser import ConfigParser else: from configparser import ConfigParser from functools import wraps import datetime import logging import logging.handlers import itertools impor...
null
swiftsystem/monitor_events.py
monitor_events.py
py
21,148
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.version_info", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.path.join", ...
466080751
# Django settings for kitsune project. import os import logging DEBUG = True TEMPLATE_DEBUG = DEBUG LOG_LEVEL = logging.DEBUG ROOT = os.path.dirname(os.path.abspath(__file__)) path = lambda *a: os.path.join(ROOT, *a) ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) MANAGERS = ADMINS DATABASES = { 'de...
null
settings.py
settings.py
py
4,097
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.DEBUG", "line_number": 7, "usage_type": "attribute" }, { "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.abspath", "l...
58501615
# -*- coding: utf-8 -*- import counter import time import matplotlib matplotlib.use('Agg') import pylab as p import io import html import numpy as np import datetime class c(counter.counter): def __init__(self, name, attr, rot, title=None, graph=None, formatkey=str, formatgraphkey...
null
counters/game.py
game.py
py
13,055
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.use", "line_number": 5, "usage_type": "call" }, { "api_name": "counter.counter", "line_number": 13, "usage_type": "attribute" }, { "api_name": "time.time", "line_number": 39, "usage_type": "call" }, { "api_name": "time.time", "line_nu...
596116935
# -*- coding: utf-8 -*- """ Created on Mon Jan 15 16:37:44 2018 @author: justin gomes """ import shockTube_constant_volume as shock import matplotlib as mpl from pylab import savefig import pandas as pd #establish paramters ctiFile = 'mecph_v2b.cti' speciesNames = ['ar'] pressure = 15 #atm temperatur...
null
TmpModel_argon.py
TmpModel_argon.py
py
2,836
python
en
code
null
code-starcoder2
76
[ { "api_name": "shockTube_constant_volume.ShockTube", "line_number": 32, "usage_type": "call" }, { "api_name": "matplotlib.rcParamsDefault", "line_number": 40, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams", "line_number": 41, "usage_type": "attribute" ...
560246998
from datetime import datetime from flask import request,send_file from flask_restful import Resource,reqparse from flask_jwt import jwt_required from io import BytesIO from models.product import ProductModel,ProductImageModel import helper import security class Product(Resource): parser=reqparse.RequestParser() ...
null
resources/product.py
product.py
py
5,465
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask_restful.Resource", "line_number": 10, "usage_type": "name" }, { "api_name": "flask_restful.reqparse.RequestParser", "line_number": 11, "usage_type": "call" }, { "api_name": "flask_restful.reqparse", "line_number": 11, "usage_type": "name" }, { ...
108959561
#!/usr/bin/env python3 #-*- coding = utf-8 -*- import asyncio import re import threading import aiohttp import json from pymongo import MongoClient import glob import os import time from concurrent.futures import ThreadPoolExecutor from threading import Thread from PIL import Image from time import sleep from concurre...
null
stock/stock/utils/processthreadgeventHandler.py
processthreadgeventHandler.py
py
26,630
python
en
code
null
code-starcoder2
76
[ { "api_name": "gevent.monkey.patch_all", "line_number": 30, "usage_type": "call" }, { "api_name": "gevent.monkey", "line_number": 30, "usage_type": "name" }, { "api_name": "os.path.splitext", "line_number": 66, "usage_type": "call" }, { "api_name": "os.path", ...
603996816
import argparse import os import time from Utilities.pyUproot import GenericHist def getComLineArgs(): parser = argparse.ArgumentParser() parser.add_argument("-i", "--infile", type=str, required=True, help="Input root file (output of makeHistFile.py)") parser.add_argument("-a", "--a...
null
Utilities/configHelper.py
configHelper.py
py
5,785
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "Utilities.pyUproot.GenericHist", "line_number": 52, "usage_type": "call" }, { "api_name": "Utilities.pyUproot.GenericHist", "line_number": 62, "usage_type": "call" }, { ...
406876108
import random import tensorflow as tf from keras import backend as K from keras.engine.topology import Layer from keras.initializers import RandomUniform, Constant import numpy as np class LineLayer (Layer): """ Layer of sharp line units Like tanh units, but compress horizontally to a constant width ...
null
linear.py
linear.py
py
2,387
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.engine.topology.Layer", "line_number": 10, "usage_type": "name" }, { "api_name": "keras.initializers.RandomUniform", "line_number": 20, "usage_type": "call" }, { "api_name": "keras.initializers.RandomUniform", "line_number": 36, "usage_type": "call" ...
566712546
#!/usr/bin/env python """ This script takes a file containing one or more feature definitions, that is pointed to by the -f flag. It then writes each feature defition out to it's own independent file in an autogenerated directory tree. If a base directory is supplied with the -o flag, the features will be written ou...
null
split_features.py
split_features.py
py
2,275
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 22, "usage_type": "call" }, { "api_name": "argparse.RawTextHelpFormatter", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 36, "usage_type": "call" }, { "api_nam...
8781912
import discord from discord.ext import commands class Super(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command(hidden = True, aliases = ['sp']) async def superpost(self, ctx, title, description = None, image = None): guild = self.bot.get_guild(578548442687864832) member = awa...
null
code/cogs/super.py
super.py
py
1,893
python
en
code
null
code-starcoder2
76
[ { "api_name": "discord.ext.commands.Cog", "line_number": 4, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 4, "usage_type": "name" }, { "api_name": "discord.utils.get", "line_number": 15, "usage_type": "call" }, { "api_name": "di...
89371534
import numpy as np import torch from torch.autograd import Variable from matplotlib import pyplot as plt N, D_in, H, D_out = 64, 1000, 100, 10 x = Variable(torch.randn(N, D_in)) y = Variable(torch.randn(N, D_out), requires_grad=False) model = torch.nn.Sequential( torch.nn.Linear(D_in, H), to...
null
dl-frameworks-intro/nn1_pytorch_v3.py
nn1_pytorch_v3.py
py
859
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.autograd.Variable", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.randn", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.autograd.Variable", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.randn...
351599722
from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions import * #https://selenium-python.readthedocs.io/api.html#selenium.webdriver.remote.webelement.WebElem...
null
python/testingWanAndroid/features/lib/pages/base_page_object.py
base_page_object.py
py
3,498
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.support.ui.WebDriverWait", "line_number": 28, "usage_type": "call" }, { "api_name": "selenium.webdriver.support.expected_conditions.presence_of_element_located", "line_number": 29, "usage_type": "call" }, { "api_name": "selenium.webdriver.support...
158801825
import hashlib import ecdsa import os from binascii import hexlify def random_secret_exponent(curve_order): while True: bytes = os.urandom(32) random_hex = bytes.hex() random_int = int(random_hex, 16) if random_int >= 1 and random_int < curve_order: return r...
null
generate_ecdsa.py
generate_ecdsa.py
py
1,012
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.urandom", "line_number": 9, "usage_type": "call" }, { "api_name": "ecdsa.curves", "line_number": 17, "usage_type": "attribute" }, { "api_name": "ecdsa.keys", "line_number": 19, "usage_type": "attribute" }, { "api_name": "hashlib.sha256", "lin...
558132381
import pandas as pd import numpy as np df = pd.read_csv('all_black_list.csv', encoding='gbk') from sklearn.model_selection import StratifiedShuffleSplit split = StratifiedShuffleSplit(n_splits=1, test_size=0.2, random_state=42) for train_index, test_index in split.split(df, df['label']): strat_train_set = df.loc...
null
create_test_data_for_indicator.py
create_test_data_for_indicator.py
py
618
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 4, "usage_type": "call" }, { "api_name": "sklearn.model_selection.StratifiedShuffleSplit", "line_number": 8, "usage_type": "call" } ]
340625134
"""The command for archiving a smart list.""" from dataclasses import dataclass from jupiter.core.framework.base.entity_id import EntityId from jupiter.core.framework.event import EventSource from jupiter.core.framework.use_case import ( ContextProgressReporter, UseCaseArgsBase, ) from jupiter.core.use_cases.i...
null
src/core/jupiter/core/use_cases/smart_lists/archive.py
archive.py
py
3,185
python
en
code
null
code-starcoder2
76
[ { "api_name": "jupiter.core.framework.use_case.UseCaseArgsBase", "line_number": 17, "usage_type": "name" }, { "api_name": "jupiter.core.framework.base.entity_id.EntityId", "line_number": 20, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 16, ...
379367245
#coding: utf-8 from __future__ import unicode_literals, absolute_import from django.conf.urls import patterns, url from fias.views import (SuggestAddressViewStepByStep, SuggestBySphinx, GetAreasListView) urlpatterns = patterns('', url(r'^suggest_...
null
fias/urls.py
urls.py
py
598
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.patterns", "line_number": 10, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 11, "usage_type": "call" }, { "api_name": "fias.views.SuggestAddressViewStepByStep.as_view", "line_number": 11, "usage_type": "call" ...
335272952
import cv2 import numpy as np from setuptools import glob #Initiate webcam webCam = cv2.VideoCapture(0) # criteria for termination criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001) # prepering obk=ject point like (0, 0, 0), (1,0,0) and etc objp = np.zeros((6*7, 3), np.float32) objp[:, :2] = ...
null
arboard.py
arboard.py
py
2,891
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.VideoCapture", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.TERM_CRITERIA_EPS", "line_number": 9, "usage_type": "attribute" }, { "api_name": "cv2.TERM_CRITERIA_MAX_ITER", "line_number": 9, "usage_type": "attribute" }, { "api_name...
478375188
''' This test client runs against the Autobahn test server. It is based on the test_client.py in wsproto. ''' import argparse import logging from urllib.parse import urlparse import trio from trio_websocket import WebSocketClient, ConnectionClosed AGENT = 'trio-websocket' logging.basicConfig() logger = logging.getLo...
null
autobahn/client.py
client.py
py
2,985
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 16, "usage_type": "attribute" }, { "api_name": "urllib.parse....
490114351
import datetime from rest_framework import viewsets, status from rest_framework.decorators import detail_route from rest_framework.generics import get_object_or_404, ListAPIView from rest_framework.response import Response from apps.core.views import BaseLoginRequired from .permissions import AssignmentPermission fr...
null
pelin_api/apps/assignment/views.py
views.py
py
4,412
python
en
code
null
code-starcoder2
76
[ { "api_name": "apps.core.views.BaseLoginRequired", "line_number": 15, "usage_type": "name" }, { "api_name": "rest_framework.viewsets.ModelViewSet", "line_number": 15, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 15, "usage_type": "n...
472044890
### # Copyright (c) 2014, James Lu # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions, and...
null
PkgInfo/plugin.py
plugin.py
py
14,651
python
en
code
null
code-starcoder2
76
[ { "api_name": "supybot.i18n.PluginInternationalization", "line_number": 56, "usage_type": "call" }, { "api_name": "supybot.callbacks.Plugin", "line_number": 62, "usage_type": "attribute" }, { "api_name": "supybot.callbacks", "line_number": 62, "usage_type": "name" }, ...
469611761
# -*- coding: utf8 -*- # # Created by 'myth' on 10/24/15 from django.conf.urls import patterns, url from apps.gallery.dashboard.views import ( GalleryIndex, GalleryDetail, GalleryUnhandledIndex, GalleryUpload, GalleryDelete, GalleryUnhandledDelete ) urlpatterns = patterns( 'apps.gallery.d...
null
apps/gallery/dashboard/urls.py
urls.py
py
947
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.patterns", "line_number": 16, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 18, "usage_type": "call" }, { "api_name": "apps.gallery.dashboard.views.GalleryIndex.as_view", "line_number": 20, "usage_type": "call...
42608754
import hashlib import string import itertools from md5fun import get_lines, get_word_permutations def get_substitute_dict(): common_substitutions = { 'a': ['@'], 'b': ['8'], 'c': ['('], 'd': ['6'], 'e': ['3'], 'f': ['#'], 'g': ['9'], 'h': ['#'], ...
null
lab 3/md5_part6.py
md5_part6.py
py
6,709
python
en
code
null
code-starcoder2
76
[ { "api_name": "itertools.combinations_with_replacement", "line_number": 57, "usage_type": "call" }, { "api_name": "itertools.permutations", "line_number": 63, "usage_type": "call" }, { "api_name": "hashlib.md5", "line_number": 136, "usage_type": "call" }, { "api_n...
453079734
import random from time import sleep from decimal import Decimal from collections import deque from pdb import set_trace from math import sqrt from packetsD import * from enum import Enum from visualGraph import * from threading import Timer class State(Enum): VULNERABLE = 0 INFECTED = 1 RECOVERED = 2 def dist(...
null
Prove/DISCOVER/carD.py
carD.py
py
5,217
python
en
code
null
code-starcoder2
76
[ { "api_name": "enum.Enum", "line_number": 14, "usage_type": "name" }, { "api_name": "math.sqrt", "line_number": 21, "usage_type": "call" }, { "api_name": "random.random", "line_number": 64, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 85,...
306481384
import logging import logging.config from os import environ from os.path import ( join, dirname, abspath, ) import config env_config_key = environ.get('NIGHTPARTY_TORNADO', 'DEVELOPMENT') config = config.from_yaml( join(dirname(abspath(__file__)), 'config.yaml'), env_config_key, ) globals().updat...
null
settings.py
settings.py
py
413
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ.get", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 11, "usage_type": "name" }, { "api_name": "config.from_yaml", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.join", "line_n...
353806204
from django.shortcuts import render from apps.dashboard.models import * from apps.resources.models import * from datetime import datetime def index(request): #get contact count contact_count = 32 #get faqs count faqs_count = 12 #get live chat count livechat_count = 100 #get...
null
apps/support/views.py
views.py
py
2,157
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 32, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 32, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 66, "usage_type": "call" } ]
353951288
import pygame from pygame.sprite import Sprite class Alien(Sprite): """Klasa przedstawiająca jednego obcego w grze.""" def __init__(self, ai_game): """Inicjalizacja obcego i jego położenie początkowe.""" super().__init__() self.screen = ai_game.screen self.settings = ai_game.s...
null
alien.py
alien.py
py
1,195
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.sprite.Sprite", "line_number": 5, "usage_type": "name" }, { "api_name": "pygame.image.load", "line_number": 15, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 15, "usage_type": "attribute" } ]
566188211
""" MIT License ----------- Copyright (c) 2021 University of Malaga Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modif...
null
tests/spike/test_simulation_01.py
test_simulation_01.py
py
26,085
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.loadtxt", "line_number": 51, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 56, "usage_type": "call" }, { "api_name": "context.camis.AnisotropicMap", "line_number": 58, "usage_type": "call" }, { "api_name": "context.cami...
14775612
#!/usr/bin/env python ''' Created on 30/08/2012 @author: mattg specific ffmpeg proxy ''' __author__ = 'Matt Gidney' __version__ = '1.0' __date__ = '2013/03/10' import os,sys,subprocess,argparse from AL.apps.Binocular.utilities import utils ############################################################### import loggin...
null
python/Binocular/proxy/pix_ffmpeg.py
pix_ffmpeg.py
py
5,946
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 18, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.IN...
35268557
import socket import termcolor def scan(targets, ports): print('\n' + 'Starting Scan For ' + str(targets)) for port in range(1,ports): scan_port(targets, port) def scan_port(ipaddress, port): try: sock = socket.socket() sock.connect((ipaddress, port)) print ("[+] port open:...
null
port_scanner.py
port_scanner.py
py
759
python
en
code
null
code-starcoder2
76
[ { "api_name": "socket.socket", "line_number": 11, "usage_type": "call" }, { "api_name": "termcolor.colored", "line_number": 24, "usage_type": "call" } ]
459467884
import cv2 import numpy as np import matplotlib.pyplot as plt from cv2 import cv2 as cv import os, requests, wget def store_raw_images(): jetbot_images_link = 'https://www.google.com/search?q=road+with+signs&sxsrf=ALeKk01WPahvxB5yzHLceatat1nuVY1u2w:1608091891097&source=lnms&tbm=isch&sa=X&ved=2ahUKEwjG9byP0dHtAhW...
null
datas/Proj_jetbot_img_down0.py
Proj_jetbot_img_down0.py
py
901
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 16, "usage_type": "call" }, { "api_name": "wget.download", "line_number": 17, "usage_type": "call" } ]
260101403
""" Auhor: Winston Appleton Date Created: June 16, 2020 Description: This progran is written to satisfy the requirements for the Udacity Nano degree in Programming for Data Science """ import time import datetime as dt import pandas as pd CITY_DATA = {'chicago': 'chicago.csv', 'new york': 'new_york_city....
null
bikeshare.py
bikeshare.py
py
7,574
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 68, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 69, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 70, "usage_type": "call" }, { "api_name": "pandas.Timestam...
461370522
#!/usr/bin/python # -*- coding: utf-8 -*- import shutil from crypt import * from paths import AppPath from msgbase import MessageBase from compress import * from logger import Log from PyQt4 import QtGui from configs import Configs from PyQt4 import QtCore from mariadb import MariaDB from upload import UploadWindow fr...
null
send.py
send.py
py
11,511
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt4.QtGui.QMessageBox.warning", "line_number": 27, "usage_type": "call" }, { "api_name": "PyQt4.QtGui.QMessageBox", "line_number": 27, "usage_type": "attribute" }, { "api_name": "PyQt4.QtGui", "line_number": 27, "usage_type": "name" }, { "api_name...
514331504
""" Functions to unpack Simrad EK60 .raw files Modification from original source (cited below) included: - python 3.6 compatibility - stripped off mi-instrument dependency to make this standalone To be added: - need a generic .raw filename parser - restore logging function - restore exception handler Original source ...
null
echopype/convert/ek80.py
ek80.py
py
23,700
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.compile", "line_number": 38, "usage_type": "call" }, { "api_name": "re.DOTALL", "line_number": 38, "usage_type": "attribute" }, { "api_name": "matplotlib.dates.date2num", "line_number": 41, "usage_type": "call" }, { "api_name": "datetime.datetime...
246682807
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2014 Kitware Inc. # # 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 cop...
null
tests/mongo_replicaset.py
mongo_replicaset.py
py
12,008
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.time", "line_number": 61, "usage_type": "call" }, { "api_name": "time.time", "line_number": 63, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 65, "usage_type": "call" }, { "api_name": "pymongo.errors", "line_nu...
295235004
### outputs topics-out.txt ### which contains the highest probability words in each topic ### you may have to install nltk, http://nltk.org/install.html import nltk import pickle import math import matplotlib matplotlib.use('Agg') import numpy as np import matplotlib.pyplot as plt global __samples_for_graph__topic_...
null
analyze.py
analyze.py
py
6,759
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.use", "line_number": 12, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 62, "usage_type": "call" }, { "api_name": "nltk.FreqDist", "line_number": 63, "usage_type": "call" }, { "api_name": "nltk.FreqDist", "line_nu...
229523391
# Average Turn Kill Simulator - Muck Rats # Alters Land and Muck Rats counts. Performs no mulligan actions and assumes # the play (no card drawn on first turn). Incorporates psuedo and quasi goldfish # behavior. Psuedo-goldfish interacts based on conditional criteria and # interaction counts. Quasi-goldfish inte...
null
ATK_Sim_MuckRats_PQG.py
ATK_Sim_MuckRats_PQG.py
py
5,347
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.random.shuffle", "line_number": 55, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 55, "usage_type": "name" }, { "api_name": "numpy.random.random", ...
354974123
"""Unit tests for pytiled_parser""" import xml.etree.ElementTree as etree from contextlib import contextmanager import pytest from pytiled_parser import objects, utilities, xml_parser @contextmanager def does_not_raise(): yield def _get_root_element(xml: str) -> etree.Element: """Get root element of strin...
null
tests/test_parser.py
test_parser.py
py
6,233
python
en
code
null
code-starcoder2
76
[ { "api_name": "contextlib.contextmanager", "line_number": 10, "usage_type": "name" }, { "api_name": "xml.etree.ElementTree.fromstring", "line_number": 24, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 24, "usage_type": "argument" }, { ...
254853087
from __future__ import print_function import sys import json import logging logger = logging.getLogger(__name__) class DockerError(Exception): pass def pull_image(client, image): parts = image.split(':', 1) repository = parts[0] tag = (parts[1] if len(parts) > 1 else 'latest') logger.info("Pu...
null
docker_loader/utils.py
utils.py
py
1,362
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.stdout.isatty", "line_number": 32, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 32, "usage_type": "attribute" }, { "api_name": "json.loads", "...
470505327
# -*- coding:utf-8 -*- # # Copyright @ 2018 OPS Inc. # # Author: Jinlong Yang # import os import pyotp import qrcode from oslo_config import cfg from oslo_log import log as logging LOG = logging.getLogger(__name__) louis_opts = [ cfg.StrOpt('issuer', help='qrcode uri issuer name.') ] CONF = cfg.CONF CONF.regis...
null
otp/core.py
core.py
py
1,618
python
en
code
null
code-starcoder2
76
[ { "api_name": "oslo_log.log.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "oslo_log.log", "line_number": 15, "usage_type": "name" }, { "api_name": "oslo_config.cfg.StrOpt", "line_number": 18, "usage_type": "call" }, { "api_name": "oslo_confi...
532008689
from flask import Blueprint, render_template, send_file, jsonify, request import database import qq import json import maya from .models import DBSession api = Blueprint('api', __name__) COLOR_RED = { "red": 196, "green": 2, "blue": 51 } COLOR_YELLOW = { "red": 255, "green": 211, "blue": 0 ...
null
app/api_controller.py
api_controller.py
py
2,751
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Blueprint", "line_number": 8, "usage_type": "call" }, { "api_name": "qq.get_all_users", "line_number": 59, "usage_type": "call" }, { "api_name": "qq.get_user_data", "line_number": 60, "usage_type": "call" }, { "api_name": "maya.parse", "li...
545459095
from StSerial import StSerial from PyQt5 import QtWidgets from socketSetDialog import Ui_Dialog import logging logger = logging.getLogger('main.MainWindow') class SerialDlg_UiHandler(QtWidgets.QDialog): def __init__(self, parent=None): QtWidgets.QDialog.__init__(self) logger.info('Dialog Window ...
null
SerialDlg_UiHandler.py
SerialDlg_UiHandler.py
py
801
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QDialog", "line_number": 9, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 9, "usage_type": "name" }, { "api_name": "PyQt5.QtW...
480515979
''' 使用 requests模块 爬取起点中文的章节内容地址。 选择的小说为:从吞噬开始 网址:https://book.qidian.com/info/1015216119 分析: 1、获取网页内容 2、使用正则先匹配整个章节目录 3、解析每个章节的内容地址 4、将内容保存到 BookInfo.txt 中 ''' import requests,re html = requests.get("https://book.qidian.com/info/1015216119#Catalog") # 匹配整个章节目录 dirTest = re.findall('<ul class="cf">(....
null
简单爬虫的项目整理/Test1.py
Test1.py
py
818
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 18, "usage_type": "call" }, { "api_name": "re.S", "line_number": 18, "usage_type": "attribute" }, { "api_name": "re.findall", "line_number": 22,...
390301076
from django.shortcuts import render,get_object_or_404, redirect #from userModule.models import Kitchen from django.urls import reverse from serviceProviderApp.models import Kitchen2Register,menuItem from cart.forms import CartAddProductForm from django.views.generic.edit import CreateView,DeleteView,UpdateView from dja...
null
userModule/views.py
views.py
py
6,893
python
en
code
null
code-starcoder2
76
[ { "api_name": "serviceProviderApp.models.Kitchen2Register.objects.all", "line_number": 19, "usage_type": "call" }, { "api_name": "serviceProviderApp.models.Kitchen2Register.objects", "line_number": 19, "usage_type": "attribute" }, { "api_name": "serviceProviderApp.models.Kitchen2...
303178453
from django.core.exceptions import ObjectDoesNotExist from hkm.models.campaigns import CampaignStatus, Campaign from hkm.models.models import ProductOrderCollection class OrderCreator(object): def validate_basket(self, basket): # For now validate that discounts are still valid for line in basket...
null
hkm/basket/order_creator.py
order_creator.py
py
1,844
python
en
code
null
code-starcoder2
76
[ { "api_name": "hkm.models.campaigns.Campaign.objects.get", "line_number": 12, "usage_type": "call" }, { "api_name": "hkm.models.campaigns.Campaign.objects", "line_number": 12, "usage_type": "attribute" }, { "api_name": "hkm.models.campaigns.Campaign", "line_number": 12, "...
323053656
from django.shortcuts import render from doodles.models import Doodles from gallery.models import GalleryImages def index(request): """ Function to return a view of the index page """ doodles = Doodles.objects.all() doodles = doodles.order_by("-updated_at")[:4] gallery_images = GalleryImages....
null
home/views.py
views.py
py
546
python
en
code
null
code-starcoder2
76
[ { "api_name": "doodles.models", "line_number": 11, "usage_type": "name" }, { "api_name": "doodles.models.Doodles.objects.all", "line_number": 11, "usage_type": "call" }, { "api_name": "doodles.models.Doodles.objects", "line_number": 11, "usage_type": "attribute" }, { ...
326380907
#! python import argparse if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('-i', help='input score file') parser.add_argument('-o', help='output average-score file') args = parser.parse_args() print('** convert result for bleurt **') print(' input : '+str(arg...
null
evaluation/m_bleurt_calc_average_score.py
m_bleurt_calc_average_score.py
py
730
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" } ]
13390313
#!/usr/bin/python import os.path as path from csv import DictReader import matplotlib.pyplot as plt import numpy as np from matplotlib.ticker import FuncFormatter, FormatStrFormatter, PercentFormatter ROOT_DIR = '/home/mrapp/Dropbox/Promotion/Papers/Boomer/Experimente/results_round5/evaluation/' DATASET = 'syntheti...
null
scripts/plot.py
plot.py
py
4,816
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.rc", "line_number": 35, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 35, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path", "li...
567733274
from django.shortcuts import render, HttpResponse, redirect # from time import gmtime, strftime, localtime from datetime import datetime # Create your views here. def index(request): context = { # "time": strftime("%Y-%m-%d %H:%M %p", datetime.datetime.now()) "date": datetime.now().strftime("%B %d, %Y"), ...
null
Week_5/time_display_assignment/apps/time_display/views.py
views.py
py
435
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime....
390384680
import calendar import datetime import functools import itertools import operator import re def apply_delta(dt, delta): """Apply datetime delta in string format to a datetime object. :param datetime dt: :param str delta: :rtype: :py:class:`datetime.DateTime` instance >>> base = datetime.datetim...
null
charlatan/utils.py
utils.py
py
4,105
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.split", "line_number": 47, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 48, "usage_type": "call" }, { "api_name": "operator.add", "line_number": 50, "usage_type": "attribute" }, { "api_name": "operator.sub", "line_number...
159855953
import shutil import torchfile from pathlib import Path import cv2 import tqdm import numpy as np import os import multiprocessing as mp import utils import scipy.io as sio import glob def task(img_path): img_path = str(img_path) pts_3d_path = img_path.replace('jpg', 't7') token = img_path.split('/') ...
null
crop_300VW.py
crop_300VW.py
py
1,829
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 24, "usage_type": "call" }, { "api_name": "torchfile.load", "line_number": 25, "usage_type": "call" }, { "api_name": "utils.read_pts", "line_number": 26, "usage_type": "call" }, { "api_name": "utils.crop_multi_face_landma...
635418354
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.utils import timezone from django.db import migrations, models import dsmr_stats.services def realign_gas_readings(apps, schema_editor): """ Alters the read_at value by the offset given and purges all existing statistics. """ # We u...
null
dsmr_consumption/migrations/0003_realign_gas_read_at.py
0003_realign_gas_read_at.py
py
1,253
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.F", "line_number": 15, "usage_type": "call" }, { "api_name": "django.db.models", "line_number": 15, "usage_type": "name" }, { "api_name": "django.utils.timezone.timedelta", "line_number": 15, "usage_type": "call" }, { "api_name": "d...
213343591
import datetime import os import sys import numpy as np import pandas as pd from paths import chemical_name, file_type, use_lookup, max_drift, nl48, master_list, col_include_output, cult_crop, \ orchards_crops, pastures, residential, forest, row, acres_col, root_path, folder_path, folder_path_census, \ folder...
null
7b_Generate Final Chemical Tables/Step2a_Tables_overlap_seed.py
Step2a_Tables_overlap_seed.py
py
77,811
python
en
code
null
code-starcoder2
76
[ { "api_name": "paths.errors", "line_number": 25, "usage_type": "argument" }, { "api_name": "paths.errors", "line_number": 27, "usage_type": "argument" }, { "api_name": "sys.exit", "line_number": 28, "usage_type": "call" }, { "api_name": "paths.file_type", "lin...
250184872
import logging import os import pathlib import sys from dateutil.parser import parse as tparse logger = logging.getLogger(__name__) logger.setLevel(logging.ERROR) stdout_handler = logging.StreamHandler(sys.stdout) if os.environ.get("GIRDERFS_DEBUG"): stdout_handler.setLevel(logging.DEBUG) else: stdout_handler...
null
girderfs/utils.py
utils.py
py
794
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.ERROR", "line_number": 9, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.stdout",...