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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
286560239 | import numpy as np
from tqdm import tqdm
import pysam
import extra_funcs
from Bio.Seq import Seq
paths, cfg = extra_funcs.load_yamls()
def load_data():
neand = pysam.AlignmentFile(paths["bam_neand"], "rb")
modern = pysam.AlignmentFile(paths["bam_modern"], "rb")
neand_seqs = []
for j in range(1, 2)... | null | src/data/comparison.py | comparison.py | py | 4,301 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "extra_funcs.load_yamls",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pysam.AlignmentFile",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pysam.AlignmentFile",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "Bio.Seq... |
601709306 | import pybitcoin
import bitcoin
import os
from .keys import *
def make_multisig_info(m, pks):
"""
Make a multisig address and redeem script
"""
pubs = []
prikeys = []
for pk in pks:
priv = BitcoinPrivateKey(pk)
priv_wif = priv.to_wif()
pub = priv.public_key().to_hex()... | null | virtualchain/bitcoin_blockchain/multisig.py | multisig.py | py | 606 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "bitcoin.mk_multisig_script",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "bitcoin.p2sh_scriptaddr",
"line_number": 24,
"usage_type": "call"
}
] |
497069033 | import cv2
import numpy as np
# mouse callback function
def draw_circle(event,x,y,flags,param):
if event == cv2.EVENT_LBUTTONDBLCLK:
print(x,y)
px = img[x,y]
print(px)
# Create a black image, a window and bind the function to window
#img = cv2.imread('Image.jpg')
img = np.zeros((51... | null | trail.py | trail.py | py | 521 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.EVENT_LBUTTONDBLCLK",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "cv2.namedWin... |
398646292 | #!/usr/bin/env python3
import cv2
import glob
import os
import numpy as np
import matplotlib.pyplot as plt
from IPython import embed
import matplotlib
import logging
np.set_printoptions(suppress=True, precision=5)
plt.ion()
try:
import colorlog
handler = colorlog.StreamHandler()
handler.setFormatter(co... | null | python/lane_detection.py | lane_detection.py | py | 22,367 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.ion",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "colorl... |
598693704 | import requests
from requests.auth import HTTPBasicAuth
class HelpScoutApiService(object):
api_key = ''
def __init__(self, api_key=''):
self.api_key = api_key
pass
def get_mine_folder_in_mailbox(self, mailbox_id):
return self.get_folder_by_name_in_mailbox(mailbox_id, 'Mine')
... | null | services/HelpScoutApiService.py | HelpScoutApiService.py | py | 1,475 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "requests.auth.HTTPBasicAuth",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "requests.auth.H... |
546621985 | import re
import os
from datetime import datetime
import matplotlib.pyplot as plt
import timeit
import pandas as pd
import seaborn as sns
class Simulation:
def __init__(self, filenames):
self.fake_total_stopped_time = []
self.idle_start_time = 0
self.time_diff = 100
... | null | simulation_delay.py | simulation_delay.py | py | 5,004 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.timestamp",
"line_number": 22,
"usage_type": "call"
},
{
"api_name... |
501016731 | import fnmatch
import logging
import os
import re
import shutil
import subprocess
# Share pre-configured workers log
log = logging.getLogger('archive_verify.workers')
class PdcClient():
"""
Base class representing a PDC client.
Staging and production environments should instantiate PdcClient (default).
... | null | archive_verify/pdc_client.py | pdc_client.py | py | 6,176 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "subprocess.Popen",
"li... |
163005117 | import os
import time
import numpy as np
import matplotlib.pyplot as plt
import scipy.ndimage as nd
import math
import torch as tc
import torch.nn as nn
import torch.optim as optim
import torch.utils
import torch.nn.functional as F
import dataloaders as dl
import cost_functions as cf
import regularizers as rg
import... | null | deep_nonrigid.py | deep_nonrigid.py | py | 16,627 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.device",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
... |
257109084 | #!/usr/bin/env python
# -*- coding: UTF-8 -*
###############################################################################
# Copyright (C), 2017 SongDehua
#
# Filename: csvUtil.py
# Version: 1.0.0
# Description: Module for pySuit frame to maniputlate the csv file.
# Author: songdehua
# History:
# 1... | null | lib/csvUtil.py | csvUtil.py | py | 12,946 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 235,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 235,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"... |
530802354 | #! /usr/bin/python
from xbee import XBee
import serial
def main():
ser = serial.Serial('/dev/ttyUSB0', 9600)
xbee = XBee(ser)
xbee.send('tx', dest_addr='\x00\x02', data='\x00')
ser.close()
if __name__ == '__main__':
main()
| null | python/test.py | test.py | py | 247 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "serial.Serial",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "xbee.XBee",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "xbee.send",
"line_number": 10,
"usage_type": "call"
}
] |
27781720 | #!/usr/bin/env python
import re
import sys
import json
import os.path
import datetime
import time
import tempfile
from collections import OrderedDict
import requests
requests.packages.urllib3.disable_warnings()
from skimage import io, draw, morphology, filters, color, img_as_ubyte
import numpy as np
from matplotlib ... | null | main.py | main.py | py | 6,697 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.packages.urllib3.disable_warnings",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.packages",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.path.join",
"line_number": 27,
"usage_type": "call"
},
{
... |
593487008 | import random
import numpy
from deap import algorithms
from deap import base
from deap import creator
from deap import tools
from boston_svr_model import index
from comb import random_combination
from datetime import datetime
import csv
mydt="{:%d%m%Y_%H%M}".format(datetime.now());
res... | null | boston_ecv.py | boston_ecv.py | py | 3,028 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.now",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "csv.writer",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "csv.QUOTE_ALL",
... |
426262196 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render,redirect,HttpResponse
import time
import os
from sympy import *
import xlrd
from evasysapp.forms import UploadExcelForm
from random import Random
from django.core.mail import send_mail
from evasysapp.models i... | null | evasys-1/evasysapp/views.py | views.py | py | 46,434 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.rcParams",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_na... |
619030694 | # USAGE
# python3 ./aruco_tracking/pose_estimate.py --video aruco_tracking/videos/pose_estimation.mp4
# import the necessary packages
from collections import deque
from imutils.video import VideoStream
import numpy as np
import argparse
from cv2 import aruco
import cv2
import imutils
import time
# construct the arg... | null | trajectoryTracking/pendulum/marker_detection.py | marker_detection.py | py | 3,142 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "collectio... |
124138630 | from django.conf.urls import url, include
from social_django.urls import urlpatterns as social_django_urls
from . import views
urlpatterns = [
url(r'^index/', views.index, name='tindex'),
#url(r'^indexreg/', views.indexregistrado, name='tindex'),
#url(r'^oauth/', include('social_django.urls', namespace='so... | null | makeDashboard/creador/urls.py | urls.py | py | 623 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.c... |
182053760 | import numpy as np
import matplotlib.pyplot as plt
N = 50 #Número de filas y columnas de la matriz (cuadrada)
matriz_linea = np.zeros((N,N))#creamos la matriz con ceros en todas las celdas
linea = [] #Lista en donde se insertarán las coordenadas de los pixeles a pintar con la siguiente forma [x,y] para la línea
def B... | null | UNIDAD_I/Ejercicio-linea.py | Ejercicio-linea.py | py | 1,218 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.zeros",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.imshow",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "matplotlib.pypl... |
210342274 | ''' This is an evolution simulator which attempts to emulate
predatory and vegetarian relationships. We may have evolving
plants, but we will definitely have evolving animals.
Sexual reproduction.
'''
import Board as b #, Plant as p, Animal as a
import pygame as pg, numpy as np
from pygame.locals imp... | null | Cretaceous.py | Cretaceous.py | py | 8,947 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pygame.display.set_mode",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pygame.font.SysFont",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygam... |
446092891 | from django.views.generic import DetailView, ListView
from django.contrib import messages
from django.shortcuts import redirect, render
from django.contrib.auth.decorators import login_required
from .models import Profile
from .forms import UserSignupForm, UserUpdateForm, ProfileUpdateForm
def signup(request):
if... | null | app/user/views.py | views.py | py | 1,919 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "forms.UserSignupForm",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages.success",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages",
"line_number": 15,
"usage_type": "name"
},
{
"api_... |
380975657 | import math, itertools
from tqdm import tqdm
# The first goal is to figure out when there are tatami for an m x n room.
# Starting from the observation that you can't tile a corner, this means you can't
# tile a row that's not the top or bottom with horizontal tiles: it produces a corner.
# In fact, you can't ha... | null | 256.py | 256.py | py | 6,492 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tqdm.tqdm",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 117,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_number": 127,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_numbe... |
460637897 | # -*- coding: utf-8 -*-
from flask import Flask
from flask import render_template
from flask import redirect
from flask import url_for
from flask import request
from flask import abort
# from flask import flash
from flask import session
from flask_moment import Moment
from ..models import User
from ..models import Blog... | null | app/controllers/__init__.py | __init__.py | py | 3,986 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Blueprint",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "models.User.query.filter_by",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "models.User... |
553742316 | import os
import requests
def rec_shazam(query) -> list:
API_KEY = os.getenv("SHAZAM")
url = "https://shazam.p.rapidapi.com/search"
querystring = {"term": query, "locale": "en-US", "offset": "0", "limit": "5"}
headers = {
'x-rapidapi-host': "shazam.p.rapidapi.com",
'x-rapidapi-key':... | null | shazam.py | shazam.py | py | 548 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.getenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.request",
"line_number": 17,
"usage_type": "call"
}
] |
63971700 | import unittest
from mock import patch
import plane_controller.data_verification
import plane_controller.plane
__author__ = 'group'
class TestDataVerification(unittest.TestCase):
def setUp(self):
pass
def test_within_distance_true(self):
my_class = plane_controller.data_verification
... | null | test/test_data_verification_OLD.py | test_data_verification_OLD.py | py | 1,880 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "plane_controller.data_verification.data_verification",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "plane_controller.data_verification",
"line_number": 14,
"... |
567131280 | import ft
from statsmodels.tsa.arima_model import ARIMA, ARIMAResults
from matplotlib import pyplot as plt
from sklearn.metrics import mean_squared_error, r2_score, mean_absolute_error
import warnings
import pandas as pd
import ft
# ignore warnings
warnings.filterwarnings("ignore")
# mode = "daily"
#mode = "weekly"... | null | models/ARIMA_weekly.py | ARIMA_weekly.py | py | 3,581 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "ft.readData",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "ft.readData",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "statsmodels.tsa.arima... |
453575887 | import traceback
from rest_framework.serializers import (
ModelSerializer, raise_errors_on_nested_writes
)
from rest_framework.utils import model_meta
class ValidatedModelSerializer(ModelSerializer):
"""
A ModelSerializer that validates the model before saving.
Minor tweak to create and update meth... | null | web/apps/custom/serializers.py | serializers.py | py | 3,365 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.raise_errors_on_nested_writes",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "rest_framework.utils.model_meta.get_field_info... |
544189270 | import logging
from app import db
from app.models.common import Game, Team
"""
Composite Entities
"""
class GameTeam:
@classmethod
def create_one(cls, _game_id: int, _job: str, _count: int) -> list:
"""
이 메소드는 같은 Game.id 를 참조하는 직업군을 만든다.
:param _game_id: Game.id.
:param _... | null | app/models/composite.py | composite.py | py | 3,275 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "app.models.common.Team.flush",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "app.models.common.Team",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "app.models.common.Team.creates_many",
"line_number": 23,
"usage_type": "call"
},
... |
578211373 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 24 11:47:15 2021.
@author: dhiru579 @ Tarento.
"""
import time
import pandas
import core_script as core
import config
from termcolor import colored
def perform_upload(dataset_name, dataset_url, driver):
"""
perform_upload fumction uploads ... | null | test/automation/dataset_script.py | dataset_script.py | py | 20,204 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "core_script.get_url",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "core_script.ULCA_DATASET_SUBMIT_URL",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "core_script.perform_webpage_function",
"line_number": 50,
"usage_type": "cal... |
618491907 | import re
import os
import pandas as pd
import glob as glob
from datetime import datetime, date
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from next.io.pipelines import Pipeline, local_tz
from next.plugins.helpers import generate_dag_config
from next.io.fileutilities import get... | null | Safelite/Airflow Dag/captify_publisher_spend_reporting.py | captify_publisher_spend_reporting.py | py | 3,043 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "next.plugins.helpers.generate_dag_config",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "next.io.pipelines.local_tz",
"line_number": 17,
"usage_type": "name"
},
{
... |
185508557 | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 29 14:17:45 2020
@author: sudhakar
"""
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 31 19:45:43 2020
@author: RAMYA
"""
#from sklearn.preprocessing import LabelEncoder
#import numpy as nm
#import matplotlib.pyplot as plt
import pandas as pd
import pickle
#from sklearn.... | null | python-flask/model.py | model.py | py | 8,259 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "imblearn.over_sampling.SMOTE",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "sklear... |
143567127 | '''
Praveen Tirupattur, Josiah Wong
CAP 6676 Final Project
apply_metrics.py
Applies metrics to PNG images
'''
import sys
import getopt
import scipy.misc
import eval_utils as eu
import single_eval as se
from os import listdir
from os.path import isfile, join
from keras.datasets import cifar10
import random
import copy... | null | sub_programs/noisy_data_workflow/apply_metrics.py | apply_metrics.py | py | 5,844 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "random.seed",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "getopt.getopt",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 98,
... |
25831828 | #Ripped off from https://tfhub.dev/google/universal-sentence-encoder-large/3
import tensorflow as tf
import tensorflow_hub as hub
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import re
import seaborn as sns
module_url = "https://tfhub.dev/google/universal-sentence-encoder/2" #@param... | null | large-3.py | large-3.py | py | 6,368 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tensorflow_hub.Module",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tensorflow.logging.set_verbosity",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "tensorflow.logging",
"line_number": 26,
"usage_type": "attribute"
},
{
"ap... |
113826606 | "This module extracts the data"
'''
Since we need to get the data through the stop and search by force API which is dependent on
force IDs, first we need to get the list of force IDs via
the API: https://data.police.uk/api/forces '''
# **DATA GATHERING VIA API**
'Import Libraries'
def data_extraction():
... | null | data_scraping_via_api_module.py | data_scraping_via_api_module.py | py | 4,228 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "urllib.parse.urlencode",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "urllib.reque... |
486000146 | # -*- coding: utf-8 -*-
import json
import logging
import pygsheets
from google.oauth2 import service_account
logger = logging.getLogger()
class googlesheets:
def __init__(self, configuration, gsheet_auth, updatesheets, tabs, updatetabs):
info = json.loads(gsheet_auth)
scopes = ['https://www.goo... | null | utilities/googlesheets.py | googlesheets.py | py | 1,911 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "google.oauth2.service_account.Credentials.from_service_account_info",
"line_number": 15,
"usage_type": "call"... |
388446295 | """
birthday.py
Author: Andy
Credit: Keezy Keez
Assignment:
Your program will ask the user the following questions, in this order:
1. Their name.
2. The name of the month they were born in (e.g. "September").
3. The year they were born in (e.g. "1962").
4. The day they were born on (e.g. "11").
If the user's birthda... | null | birthday.py | birthday.py | py | 4,618 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.today",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.today",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "dat... |
68580859 | import os
import shutil
from typing import Callable, cast
from aiofiles import open as _open
from aiofiles.os import wrap
from aiofiles.threadpool import AsyncTextIOWrapper # type: ignore
class AsyncTextIO(AsyncTextIOWrapper):
async def __aenter__(self):
...
async def __aexit__(self, exc_type, exc,... | null | nufb/fs.py | fs.py | py | 683 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "aiofiles.threadpool.AsyncTextIOWrapper",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.cast",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "aiofiles.open",
"line_number": 18,
"usage_type": "argument"
},
{
"api_name": "... |
390361556 | """
Developed by -
Rohan Shingre (MSM19B012)
"""
from flask import Flask,render_template,jsonify,request
import random
app = Flask(__name__)
# Data Storing in List
sno = []
temperature = []
pressure = []
light = []
humidity = []
# Generating Random Values
def generate_data():
for i in range(1,6):
sno.appe... | null | main.py | main.py | py | 2,757 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_n... |
404411263 | import logging
import pymongo
from numbers import Number
LOG = logging.getLogger(__name__)
def get_test_submission_object():
"""Returns a test clinvar variant submission object"""
clivar_subm_obj = {
'_id' : '5ttcfca5efcd887aab6c20a69367866n',
'##Local_ID' : '5ttcfca5efcd887aab6c20a69367866n'... | null | tests/adapter/mongo/test_clinvar_handler.py | test_clinvar_handler.py | py | 4,025 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
}
] |
110543309 | import torch
import numpy as np
import os
import matplotlib.pyplot as plt
from tqdm import tqdm
from utils.eval import quantitative_evaluation
from sklearn.metrics import accuracy_score, confusion_matrix, classification_report
def train(net, mode, dataloaders_dict,
device, optimizer, scheduler
):
... | null | utils/trainer_multitask.py | trainer_multitask.py | py | 8,139 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tqdm.tqdm",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 65... |
120489777 | from torch.utils.data import Dataset
import tqdm
import json
import torch
import random
import numpy as np
import pickle
from sklearn.utils import shuffle
from rdkit import Chem
from rdkit.Chem import AllChem
from feature import mol2alt_sentence
from rdkit.Chem import MolStandardize
'''
不合并
'''
# 基于s... | null | dataset/load_traning_v2.py | load_traning_v2.py | py | 6,131 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "pickle.load",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_... |
230104966 | import logging
from pysnptools.util.mapreduce1.runner import *
import os
import cPickle as pickle
import subprocess, sys, os.path
import multiprocessing
import pysnptools.util as pstutil
import pdb
from collections import defaultdict
import tarfile as tarfileLibrary
import ctypes
import datetime
from tempfile import Te... | null | pysnptools/util/mapreduce1/runner/hadoop.py | hadoop.py | py | 36,365 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.StreamHandler",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "logging.INFO"... |
29010516 | import logging
import pickle
import sys
import webbrowser
from pathlib import Path
from typing import Dict, Set
from GPRMon.github import PRChecks
from PySide2 import QtGui, QtWidgets
BASEDIR = Path(__file__).resolve().parent
logger = logging.getLogger('gprmon')
class Resources():
ACTIVE_ICON = str(BASEDIR.pa... | null | GPRMon/__init__.py | __init__.py | py | 4,111 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "PySide2.QtWidgets.QSystemTrayIcon",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": ... |
358491993 | import asyncio
import logging
from flask import Blueprint, jsonify, request
from nia_sauron_spoofing_controller.service.ima_service import ImaService
from nia_sauron_spoofing_controller.service.spoofing_service import \
SpoofingService
loop = asyncio.get_event_loop()
ima = Blueprint('ima', __name__)
@ima.route... | null | nia_sauron_spoofing_controller/controller/ima_controller.py | ima_controller.py | py | 1,037 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "asyncio.get_event_loop",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.Blueprint",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "nia_sauron_spoofing_controller.service.spoofing_service.SpoofingService",
"line_number": 22,
"usag... |
199452897 | import dateutil.parser
import datetime
import re
class ServiceUtils:
@staticmethod
def ws_info_to_object(ws_info):
is_narratorial = True if ws_info[8].get('narratorial') == '1' else False
is_public = True if ws_info[6] == 'r' else False
mod_date_ms = ServiceUtils.iso8601ToMillisSinceEp... | null | lib/biokbase/ServiceUtils.py | ServiceUtils.py | py | 2,889 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "re.split",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.utcfromtimestamp",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "da... |
134114649 | # -*- coding: utf-8 -*-
from flask import render_template, flash, redirect, url_for, g, request, jsonify
from forms import AdminForm, EmployeeForm, ProductForm, StoreForm, ProviderForm, make_store_only_oneForm, deliveryForm
from zhejin import app, db
from flask.ext.login import login_user, logout_user, current_user, ... | null | zhejin/sometable.py | sometable.py | py | 20,495 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "forms.ProductForm",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "models.Prod... |
368209919 | # Copyright 2016 Google Inc. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agre... | null | test/output/callbacks/callbacks_test.py | callbacks_test.py | py | 2,526 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "openhtf.util.test.TestCase",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "openhtf.util.test",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "openhtf.util.NonLocalResult",
"line_number": 39,
"usage_type": "call"
},
{
"api... |
56076654 | import time
import math
import praw
#Connect to Reddit and login
r = praw.Reddit('Iron Mother, for /r/protectoreddit by /u/jellysnake. v 0.1')
r.login("IronMother","Resh1234", disable_warning=True)
#Initalise variables
completedComments = set()
name = ""
age = ""
gender = ""
alignment = ""
status = ""
apperance = ""
... | null | main.py | main.py | py | 4,105 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "praw.Reddit",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 135,
"usage_type": "call"
}
] |
316050235 | # Authors: Florian Hofer
#
# License: BSD (3-clause)
"""Interface for listing and downloading NSRR (sleepdata.org) data."""
from fnmatch import fnmatch
from json.decoder import JSONDecodeError
from pathlib import Path
from typing import List, Tuple, Union
import requests
from tqdm import tqdm
from .utils import dow... | null | sleepecg/io/nsrr.py | nsrr.py | py | 5,727 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 114,
"usage_type": "call"
},
{
"api_name": "json.decoder.JSONDecodeError",
"line_number": 117,
"usage_type": "name"
},
{
"api_name": "fnmatch.fnma... |
260945917 | from __future__ import absolute_import, division, print_function
import pytest
pytest.importorskip('numpy')
import dask.array as da
from dask.utils import ignoring
from dask.array.reductions import arg_aggregate
import numpy as np
def eq(a, b):
if isinstance(a, da.Array):
a = a.compute()
if isinstan... | null | dask/array/tests/test_reductions.py | test_reductions.py | py | 2,108 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pytest.importorskip",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "dask.array.Array",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "dask.array",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "dask.array.Array"... |
258426262 | import boto3
from boto3.dynamodb.conditions import Key, Attr
import json
import os
import time
# configurations from file
config_filename = "configs.json"
if os.path.isfile(config_filename):
with open(config_filename) as f:
all_configs = json.loads(f.read())
environment = all_configs['environment'] if 'env... | null | work/insta-spike/FannerOuter/_src/fannerouter.py | fannerouter.py | py | 2,634 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.isfile",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "boto3.resource",
"line_numbe... |
335440710 | #! python3
# nineLetterWordC.py: Cheat even in this easy game: https://nineletterword.tompaton.com/
# Usage: [1] Launch the script: >>> python nineLetterWordC.py <yourHand>
# Requirements: requests, bs4, selenium, geckodriver
# Note: if it saya 'Already guessed', it's normal. Another word with the same combination has ... | null | nineLetterWordC.py | nineLetterWordC.py | py | 1,917 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"lin... |
82127346 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | null | Tensorflow_LightGBM_Scipy_nightly/source/tensorflow/contrib/labeled_tensor/python/ops/ops.py | ops.py | py | 46,403 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tensorflow.python.framework.ops.name_scope",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "tensorflow.python.framework.ops",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "tensorflow.contrib.labeled_tensor.python.ops.core.Axes",
"line_num... |
318308613 |
from celery import Celery
from MiDuoTester.celery import app
from celery import task
from celery import shared_task
@app.task
def add(x, y):
print("计算2个值的和: %s %s" % (x, y))
return x+y
@task()
# @shared_task
def add(x, y):
print("%d + %d = %d" % (x, y, x + y))
return x + y
# class AddClass(Task):
... | null | Product/task1.py | task1.py | py | 617 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "MiDuoTester.celery.app.task",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "MiDuoTester.celery.app",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "celery.task",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cel... |
648379384 | # Copyright (C) 2012 Statoil ASA, Norway.
#
# The file 'enkf_node.py' is part of ERT - Ensemble based Reservoir Tool.
#
# ERT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of... | null | devel/python/python/ert/enkf/enkf_node.py | enkf_node.py | py | 2,739 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "ert.cwrap.cclass.CClass",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "libenkf.lib",
"line_number": 52,
"usage_type": "attribute"
}
] |
54686630 | import math
from opentrons.types import Point
from opentrons import robot
from opentrons import protocol_api
from opentrons import labware
import time
import os
import numpy as np
from timeit import default_timer as timer
import json
from datetime import datetime
import csv
import subprocess
# metadata
metadata = {
... | null | protocols/P1_KF_rna_extraction/p1_KF_prekingfisher.py | p1_KF_prekingfisher.py | py | 27,918 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "math.ceil",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "opentrons.protocol_api.ProtocolContext",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "o... |
204467203 | __author__ = "Luke Liu"
#encoding="utf-8"
# -*- coding: utf-8 -*-
import numpy as np
import tensorflow as tf
from utils import label_map_util
from utils import visualization_utils as vis_util
import os
# mobilenet的模型位置
path="D:/BaiduYunDownload/python_exe/dataset/object_detections/ssd_mobilenet_v1_coco_2018_01_28"
P... | null | Day2_20190903/Object_detections/Google_API_and_cv2.py | Google_API_and_cv2.py | py | 2,727 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tensorflow.Graph",
"li... |
224288036 | # this file contains code for a permuted graph topologies experiment
# (we permute columns and rows of the adjacency matrix and check the
# resulting neural networks fits)
import numpy as np
import pandas as pd
import tensorflow as tf
from sklearn.model_selection import train_test_split
import os
import graph_utils... | null | permuted_topologies_experiment.py | permuted_topologies_experiment.py | py | 3,054 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.test.gpu_device_name",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tensorflow.test",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "... |
494880184 | from os import name
from django.urls import path, re_path
#from .views import ContactCreateView, HomePageView, ContactDetailView, search, ContactUpdateView, ContactDeleteView # home, detail,
from . import views
app_name = 'app'
urlpatterns = [
# path('', home, name="home"),
path('', views.HomePageView.as_view... | null | app/urls.py | urls.py | py | 939 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.urls.path",... |
5389490 | from praw.models import comment_forest,Comment
import praw
import sys
import time
username = 'no_flex_zone'
password = 'bisherk92'
client_id = 'RjI-0KSmJMWajg'
client_secret = 's9NyG7mnbKCSPcFkZ3osS3sC_vk'
def login():
'''Returns logged in reddit instance'''
print("Logging in...")
r = praw.Reddit(usernam... | null | Projects/crawler.py | crawler.py | py | 3,367 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "praw.Reddit",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "praw.models.comment_forest.CommentForest",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "praw.models.comment_forest",
"line_number": 66,
"usage_type": "name"
},
{
"a... |
621537820 | from collections import namedtuple
Game = namedtuple('Game', [
'env_name', 'time_factor', 'input_size', 'output_size', 'layers',
'activation', 'noise_bias', 'output_noise', 'experimental_mode'
])
games = {}
cartpole_swingup = Game(
env_name='CartPoleSwingUp',
input_size=5,
output_size=1,
time... | null | learntopredict/cartpole/config.py | config.py | py | 1,440 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.namedtuple",
"line_number": 3,
"usage_type": "call"
}
] |
537840663 | # -*- coding: utf-8 -*-
"""
Created on Sun Nov 29 14:01:47 2015
@author: Duncan
plot based on number of satellites
data must contain the following two lines
$GPGGA
txxxx,xxxx (serial,pps times)
"""
import numpy as np
import matplotlib as mplt
import matplotlib.pyplot as plt
from scipy.stats.stats import pearson... | null | GARMIN/Analysis/Correlate Data/ConQual.py | ConQual.py | py | 3,935 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.linspace",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.cm.hot",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.cm",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "mat... |
474457743 | import yaml, sys
import os
role_data_file = sys.argv[1]
with open(role_data_file) as f:
roles = yaml.safe_load(f)
for role in roles:
if role["name"] == "Controller":
controller_service_list = role['ServicesDefault']
if 'OS::TripleO::Services::TrilioDatamoverApi' not in controller_service_list... | null | tripleo-scripts/prepare_roles_data.py | prepare_roles_data.py | py | 1,090 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "yaml.safe_load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
374714230 | from django.shortcuts import render
from django.db import transaction
from django.http import Http404
from django.shortcuts import render, get_object_or_404, redirect
# Create your views here.
from django.urls import reverse
from django.views import View
# Create your views here.
from csesa.settings import SEND_TO_CH... | null | telegramboard/views.py | views.py | py | 1,988 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.views.View",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "d... |
582868898 | from logging import error, exception
from shutil import Error
from typing import Dict
from rich.console import Console
from pathlib import Path
import urllib.request
import requests
import time
from concurrent.futures import ThreadPoolExecutor, thread, wait, ALL_COMPLETED
import threading
import wget
console = Console... | null | ipr/AssetsDownloader.py | AssetsDownloader.py | py | 2,841 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rich.console.Console",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "threading.Lock",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "concurrent.futures.T... |
346884370 | from sympy.matrices import Matrix
from lab1.DualSimplexMethod import DualSimplexMethod
A_matrix = Matrix([[2, 1, -1, 0, 0, 1], [1, 0, 1, 1, 0, 0], [0, 1, 0, 0, 1, 0]])
b_matrix = Matrix([2, 5, 0])
c_matrix = Matrix([3, 2, 0, 3, -2, -4])
d_lower = Matrix([0, -1, 2, 1, -1, 0])
d_upper = Matrix([2, 4, 4, 3, 3, 5])
solver... | null | 8term/OR/lab1.py | lab1.py | py | 430 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sympy.matrices.Matrix",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sympy.matrices.Matrix",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sympy.matrices.Matrix",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sympy.... |
148891536 | import sys
from dagster_graphql.implementation.context import (
DagsterGraphQLInProcessRepositoryContext,
ExternalPipeline,
)
from dagster_graphql.schema.pipelines import DauphinPipeline, DauphinPipelineSnapshot
from graphql.execution.base import ResolveInfo
from dagster import check
from dagster.core.definit... | null | python_modules/dagster-graphql/dagster_graphql/implementation/fetch_pipelines.py | fetch_pipelines.py | py | 7,925 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "dagster.check.str_param",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "dagster.check",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "dagster_graphql.schema.pipelines.DauphinPipelineSnapshot",
"line_number": 22,
"usage_type": "call"
... |
369095875 | from pathlib import Path
from datetime import datetime, timedelta
from src.core.service.ctl_service import CTLService
from src.core.service.extractor import Extractor
from src.settings import envs
from airflow import DAG
from airflow.models import Variable
from airflow.operators.python_operator import PythonOperator
fr... | null | src/airflow_dags/dags/btb/monthly_extract.py | monthly_extract.py | py | 6,959 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "src.settings.envs.PROJECT_ROOT",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "src.settings.envs",
"line_number": 20,
"usage_type": "name"
},
{
"api_name"... |
554442472 | # The MIT License (MIT)
#
# Copyright (c) 2017 Mihir Wagle
#
# 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 | img_steg.py | img_steg.py | py | 5,710 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PIL.Image.open",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number"... |
451015072 | import argparse
import coverage
import sys
from global_config.config import GLOBAL_CONFIG
from os import environ
from telegram_bot.config.config import TELEGRAM_CONFIG
from unittest import TestLoader, TextTestRunner
from utilities.log_util import get_logger
from utilities.util import recursive_makedir
from xmlrunner.r... | null | telegram_bot/deploy.py | deploy.py | py | 5,174 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestLoader",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "telegram_bot.config.config.TELEGRAM_CONFIG",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "utilities.util.recursive_makedir",
"line_number": 21,
"usage_type": "call"... |
494846312 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Simon Dodsley (simon@purestorage.com)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_versi... | null | collections/ansible_collections/purestorage/flasharray/plugins/modules/purefa_vg.py | purefa_vg.py | py | 11,981 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "ansible_collections.purestorage.flasharray.plugins.module_utils.purefa.purefa_argument_spec",
"line_number": 301,
"usage_type": "call"
},
{
"api_name": "ansible.module_utils.basic.AnsibleModule",
"line_number": 310,
"usage_type": "call"
},
{
"api_name": "ansible_co... |
650839169 | # Imports
import os
import subprocess
import sys
# REMOVE!!
from ir_utils import *
# model
from ir_lmart import *
# HPO
# from hpo import *
# from HpoWorker import *
from HpoWorker import *
import ConfigSpace as CS
import ConfigSpace.hyperparameters as CSH
# from hpbandster.core.worker import Worker
# HPO ser... | null | ir_hpo.py | ir_hpo.py | py | 11,198 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "logging.WARNING",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
49282129 | #encoding: utf8
"""
permission.data.json 被删除后,因为站点没有删除,但是权限树中是空的,没能找到它们的信息,打开相关页面会报错
这个方法会修复这个问题,当发现文件不存在,会创建空文件,然后读取数据库,查找到systems,依次创建节点
还会查找user和role,相应创建对应的节点。
但是节点之间的关系就没有了,配置的权限也丢失了。
"""
import sys
from bson import ObjectId, DBRef
from core.platform.user import UserManage
from core.platform.util... | null | core/platform/permission/fix_miss_child_system_data.py | fix_miss_child_system_data.py | py | 2,268 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "core.platform.util.metadata.database",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "core.platform.user.UserManage",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "core.platform.util.metadata.database",
"line_number": 43,
"usage_type"... |
132638655 | #!/usr/bin/python
#_*_coding:utf-8_*_
import json
import requests
import datetime
import time
glo_main_net_url = 'https://rpc.ddam.one'
glo_headers = {"Content-Type":"application/json"}
def get_output_miner(miner_addr):
(miner_key, miner_value), = miner_addr.items()
data_json = {
"method": "Gx_bala... | null | Company/get_output_rpc_api.py | get_output_rpc_api.py | py | 724 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.post",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 24,
"usage_type": "call"
}
] |
507037477 | import pytest
@pytest.fixture
def suspension_base(testapp, heart_ontology, tissue_base):
item = {
'derivation_process': ['mechanical dissociation'],
'suspension_type': 'cell',
'derived_from': [tissue_base['uuid']]
}
return testapp.post_json('/suspension', item, status=201).json['@g... | null | src/encoded/tests/fixtures/schemas/suspension.py | suspension.py | py | 330 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pytest.fixture",
"line_number": 4,
"usage_type": "attribute"
}
] |
393184308 | # -*- coding: utf-8 -*-
"""
poker hand imit
"""
from functools import total_ordering
from collections import Counter
SUITS = ("C", "D", "H", "S")
VALUES = ("2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A")
HANDS = ("High Card", "Pair", "Two Pairs", "Three of a Kind",
"Straight", "Flush", "Ful... | null | poker_hand.py | poker_hand.py | py | 3,258 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "functools.total_ordering",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "collections.Counter",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 83,
"usage_type": "call"
}
] |
630372598 | from setuptools import setup, find_packages
version = '2.1.1.dev0'
setup(name='plone.portlets',
version=version,
description="An extension of zope.viewlet to support dynamic portlets",
long_description=open("README.txt").read() + "\n" +
open("CHANGES.txt").read(),
classi... | null | setup.py | setup.py | py | 1,481 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "setuptools.setup",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 23,
"usage_type": "call"
}
] |
151469830 | """The CommandParser class
"""
import queue
import logging
logger = logging.getLogger(__name__)
class CommandParser:
"""A class to parse recieved data from the attacker.
It is not thread safe, so don't share an instance of this across threads
"""
CR = "\r"
DEL = "\x7f"
TERM_UP = "\x1b[A"
... | null | frontend/frontend/protocols/ssh/_command_parser.py | _command_parser.py | py | 5,481 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "queue.Queue",
"line_number": 30,
"usage_type": "call"
}
] |
22300935 | from aiogram import Bot, Dispatcher, executor, types
from aiogram.dispatcher.filters import Text
from aiogram.utils.markdown import hbold, hlink
from main import collect_data, find_wishes, GetSysytemTime
from time import time, sleep
import json
import os
import data_input as di
import asyncio
import aioschedule
bot = ... | null | bot_standalone.py | bot_standalone.py | py | 2,014 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "aiogram.Bot",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "data_input.TOKEN",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "aiogram.types.ParseMode",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "aiogra... |
426794717 | #!/usr/bin/env python3
from vosk import Model, KaldiRecognizer
import sys
import os
import wave
import json
from google_speech import Speech
if not os.path.exists("vosk_small"):
print ("Please download the model from https://github.com/alphacep/vosk-api/blob/master/doc/models.md and unpack as 'model' in the curre... | null | Lab6/anakin_no/i_have_the_highground.py | i_have_the_highground.py | py | 1,014 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.exists",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "wave.open",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 1... |
553370589 | '''
Reference implementation of node2vec.
Author: Aditya Grover
For more details, refer to the paper:
node2vec: Scalable Feature Learning for Networks
Aditya Grover and Jure Leskovec
Knowledge Discovery and Data Mining (KDD), 2016
'''
import argparse
import gzip
import json
import os
import random
from collections... | null | src/main.py | main.py | py | 7,108 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "networkx.parse_edgelist",
"line_number": 103,
"usage_type": "call"
},
{
"api_name": "node2vec.tqdm_pc",
"line_number": 103,
"usage_type": "call"
},
{
"api_name": "ne... |
536799745 | # 1 задание. Печатные газеты использовали свой формат дат для каждого выпуска.
# Для каждой газеты из списка напишите формат указанной даты для перевода в объект datetime:
from datetime import datetime
from datetime import timedelta
The_Moscow_Times = datetime.strptime('Wednesday, October 2, 2002', '%A, %B %d,... | null | date_work.py | date_work.py | py | 3,698 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "... |
508449986 | import stripe
import os
stripe.api_key=os.environ['stripe_key'] if (os.environ["stripe_key"]) else "sk_test_Cn85sbZFVsYjj2eGHF3RTL7m"
idStore = {}
def error_parser(e, logger):
body = e.json_body
err = body.get('error', {})
error_str = "Status is: %s \n" % e.http_status
error_str += "Type is: %s \n"... | null | util/stripe.py | stripe.py | py | 534 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "stripe.api_key",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 4,
"usage_type": "attribute"
}
] |
73597323 | from selenium import webdriver
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.by import By
import selenium
from time import sleep
import unittest
class Tjobs(unittest.... | null | tjob-test/tjob_eds.py | tjob_eds.py | py | 3,506 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 40,
"usage_type": "name"
},
{
"api_na... |
495796841 | #!/usr/bin/env python
import sys
import xml.sax as sax
from xml.sax.handler import ContentHandler
import re
from Usefuls.Table_maker import Table_row
class MyHandler(ContentHandler):
def __init__(self, iolist):
self._tagstack = []
self._atrstack = []
self.iolist = iolist
self.... | null | csplugins/trunk/ucsd/rsaito/rs_Progs/rs_Python/rs_Python_Pack/tags/rs_Python_Pack080114/General_Packages/XML/read_SAX_BLAST_m7_II.py | read_SAX_BLAST_m7_II.py | py | 3,913 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "xml.sax.handler.ContentHandler",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "Usefuls.Table_maker.Table_row",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 22,
"usage_type": "call"
},
{
"api_name"... |
185510460 | import discord, sqlite3, time, random
from discord.ext import commands
from discord.utils import get
class Listeners(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.SettingsDB = sqlite3.connect(f".{os.path.sep}Databases{os.path.sep}ServerSettings.db")
self.SettingsCursor = self.SettingsDB.cursor()
... | null | Cogs/Listeners.py | Listeners.py | py | 3,918 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "sqlite3.connect",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sqlit... |
104874513 | # -*- coding: utf-8 -*-
"""
Created on Wed May 13 09:04:36 2015
@author: westonanderson
pull and plot the variable trends that were removed from each variable as a
check to make sure that the script didn't do anything funny
"""
import numpy as np
from matplotlib import pyplot as plt
crop = 'w'
variables = ['GDD2','... | null | Exploratory/variableTrends.py | variableTrends.py | py | 1,133 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.load",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
201974364 | import yaml
import pprint
import copy
import sys
"""
How to use
Takes 1 or 2 command line inputs
1st - a .yaml file containing the parties filepaths and parameters to use
2nd - an output location for the new settings file. Defaults to "settings.yaml"
input .yaml should have a dictionary with 3 key/value pa... | null | ANL_python_stuff/new_settings.py | new_settings.py | py | 3,858 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "yaml.safe_load",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "yaml.dump",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 95,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": ... |
588420209 | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 02 18:42:16 2017
@author: ht
"""
from six.moves import cPickle
import numpy as np
import matplotlib.pyplot as plt
f = open('gridsearch_result_option2_w32_reg.save', 'rb')
result = cPickle.load(f)
f.close()
params=np.zeros((len(result),8),dtype=np.float32... | null | loadCVResult.py | loadCVResult.py | py | 842 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "six.moves.cPickle.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "six.moves.cPickle",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "numpy.zeros",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
... |
373662142 | """
General object detection scenario
"""
from typing import Optional
from armory.scenarios.image_classification import ImageClassificationTask
class ObjectDetectionTask(ImageClassificationTask):
def _evaluate(
self,
config: dict,
num_eval_batches: Optional[int],
skip_benign: Opt... | null | armory/scenarios/object_detection.py | object_detection.py | py | 810 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "armory.scenarios.image_classification.ImageClassificationTask",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 15,
"usage_type": "name"
... |
155963191 | from django.contrib import admin
from django.conf.urls import url, include
from executive import views
app_name = "executive"
urlpatterns = [
url(r'^$', views.executive_user, name = "executive_user"),
url(r'^confirm/$', views.get_executivelocation, name = "executive_location"),
url(r'^user_confirmation/... | null | executive/urls.py | urls.py | py | 680 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "executive.views.executive_user",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "executive.views",
"line_number": 10,
"usage_type": "name"
},
{
"api_name... |
393081264 | import numpy as np
import xarray as xr
import itertools
# Personal Imports
import os
from os.path import join, exists
from wofs.util.basic_functions import get_key, personal_datetime, check_file_path, to_ordered_dict
from wofs.data.loadWWAs import load_reports, load_tornado_warning
from wofs.util import config
from m... | null | observations/CreateGriddedLSRs.py | CreateGriddedLSRs.py | py | 2,687 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "wofs.util.basic_functions.personal_datetime",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "wofs.data.loadWWAs.load_reports",
"line_number": 41,
"usage_type": "call"
},
... |
624610461 | import os
import sys
sys.path.append(os.path.join(os.path.dirname(
os.path.realpath(__file__)), '../'))
import concurrent.futures
import cv2
import numpy as np
from sklearn.neighbors import DistanceMetric
from sklearn.preprocessing import MinMaxScaler
from keras.applications.resnet50 import ResNet5... | null | scr/matchers/tf_local_global_matcher.py | tf_local_global_matcher.py | py | 6,638 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
617555927 | import argparse
import azurerm
import json
import re
import sys
# validate command line arguments
argParser = argparse.ArgumentParser()
argParser.add_argument('--vmssname', '-n', required=True,
action='store', help='VMSS Name')
argParser.add_argument('--rgname', '-g', required=True,
... | null | examples/list_vmss_pips.py | list_vmss_pips.py | py | 1,508 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "azurerm.get_access_token",
... |
555683380 | # -*- coding: utf-8 -*-
#
# Copyright 2017-2018 AVSystem <avsystem@avsystem.com>
#
# 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 ... | null | test/integration/suites/default/block_write.py | block_write.py | py | 16,566 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tempfile.NamedTemporaryFile",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 65,
"usage_type": "attribute"
},
{
"api_name": "os.unlink",
... |
75788131 | import matplotlib.pyplot as plt
import numpy as np
def H(p):
if p in [0, 1]:
return 0
else:
return -p * np.log(p)/np.log(2) - (1-p) * np.log(1-p)/np.log(2)
# build (0, 1)
x = np.linspace(0, 1, 1012)
x = np.delete(x, 0)
x = np.delete(x, -1)
y = [H(p) for p in x]
# print(x)
# print(y)
plt.pl... | null | dt/entropy.py | entropy.py | py | 410 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.log",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.delete",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.delete",
"line_number"... |
634629614 | # coding: utf-8
from . import scripts, utils
from .sessions import RedisViewBase
from .authentications import AuthenticationViewBase, User
import flask, pickle, base64
class RedisResourceCacheMixin(RedisViewBase):
# optional
cache_hkey = None
cache_zkey = None
cache_header_serializer = pickle
cac... | null | flask_flab/cache.py | cache.py | py | 6,968 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sessions.RedisViewBase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "authentications.AuthenticationViewBase",
"line_number": 24,
"usage_type": "argument"
},
{
"api_name": "flask.request",
"line_number": 38,
"usage_type": "attribute"
},
{
... |
580807265 | from django.shortcuts import render_to_response, render
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.views import View
from blog.models import Post
def search(request):
search_query = request.GET.get('q')
if search_query:
posts = Post.objects.filter(body__icon... | null | search/views.py | views.py | py | 571 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "blog.models.Post.objects.filter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "blog.models.Post.objects",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "blog.models.Post",
"line_number": 12,
"usage_type": "name"
},
{
"ap... |
338420728 | import json
import logging
from falcon import HTTP_201, HTTP_204
from service.resources import BaseResource, validate
from service.schema import load_schema
from service.requester import request_post_patch
from service.conf_reader import ConfReader
class LoginAPI(BaseResource):
"""
API to process the login ... | null | IdentityService/service/resources/auth.py | auth.py | py | 2,640 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "service.resources.BaseResource",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "service.conf_reader.ConfReader",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 24,
"usage_type": "call"
},
{
"a... |
348566408 |
from django import template
import time, datetime
register = template.Library()
def calc_delay(d1, d2):
if d1 and d2:
return d1-d2
return "delay"
def human_date(d1):
if not d1: return "None"
today = datetime.datetime.today()
s = ""
if today.year != d1.year:
s = d1.strftime("%y-%m-%d %H:%M:%S... | null | django/web_annotations_server/mturk/templatetags/time_extras.py | time_extras.py | py | 1,504 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.template.Library",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.today",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetim... |
15688758 | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name = 'index'),
path('login/', views.login, name = 'login'),
path('sections/', views.sections, name = 'sections'),
path('companies/', views.companies, name = 'companies'),
path('companies/addcompany/', vie... | null | crms/urls.py | urls.py | py | 412 | python | en | code | null | code-starcoder2 | 66 | [
{
"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",
... |
183121267 | from src.data_store import DataStore
from jinja2 import Template
from itertools import chain
def gams_writer(file_name, data_set_number, data):
f = open('gams_template.txt')
src = Template(f.read())
inbound_arrivals = []
outbound_arrivals = []
lower_boundaries = []
upper_boundaries = []
in... | null | src/data_writer.py | data_writer.py | py | 3,718 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "src.data_store",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "jinja2.Template",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
"l... |
192741955 | import numpy as np
import cv2
cap = cv2.VideoCapture('cadbury.mp4')
# Define the codec and create VideoWriter object
fourcc = cv2.VideoWriter_fourcc(*'XVID')
out = cv2.VideoWriter('output.avi',fourcc, 20.0, (640,480))
while(cap.isOpened()):
ret, frame = cap.read()
if ret==True:
#frame = c... | null | show_video.py | show_video.py | py | 551 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.VideoWriter_fourcc",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.VideoWriter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.