id stringlengths 1 7 | text stringlengths 6 1.03M | dataset_id stringclasses 1
value |
|---|---|---|
77854 | <filename>bazel/macros/http_toolchain.bzl
load("//bazel/macros:toolchains.bzl", "parse_toolchain_file")
def _archive_rule(provider):
additional = ""
if provider.archive_opts != None:
additional = "\n strip_prefix = \"%s\"," % (provider.archive_opts)
return """
http_archive(
name... | StarcoderdataPython |
41621 | # <NAME>
# 2017A7PS0112P
from gui import Gui
Gui().loop() | StarcoderdataPython |
4826013 | <reponame>pasmuss/cmssw
import FWCore.ParameterSet.Config as cms
rpcFEDIntegrity = cms.EDAnalyzer("RPCFEDIntegrity",
RPCPrefixDir = cms.untracked.string('RPC/FEDIntegrity'),
RPCRawCountsInputTag = cms.untracked.InputTag('muonRPCDigis'),
... | StarcoderdataPython |
6116 | <reponame>CzechInvest/ciis
from django.contrib import admin
from django.contrib.gis import geos
from leaflet.admin import LeafletGeoAdmin, LeafletGeoAdminMixin
from .models import Lau1
from .models import Nuts3
from .models import Airport
from .models import Road
from .models import PublicTransportStop
from .models imp... | StarcoderdataPython |
3333398 | <reponame>ilg-ul/flickr-get-stats
"""
Usage:
python ilg.flickr.collections.get.wp [options]
Options:
-i "FILE", --input="FILE"
input pickle file
--input=
default '$HOME/Documents/Flickr/Collections.pickle'
--wp_url="URL"
URL of WordPress XMLRPC endpoint
--wp_user=... | StarcoderdataPython |
3236457 | # -*- coding: utf-8 -*-
"""
This module implements interfacing tools for the FISTA algorithm.
For further informations about the FISTA algorithm, have a look at [1]_.
.. [1] BECK, <NAME>, Marc. A fast iterative shrinkage-thresholding
algorithm for linear inverse problems. SIAM journal on imaging sciences,
2009,... | StarcoderdataPython |
4816574 | # ------------------------------------------------------
#
# Simple Python to parse an XML Stream from the
# TDI Sensors Output Data Standard Format V2.0 Feb 2020
# TD-1600 Report Data Packet Label Structure
#
# -----------------------------------------------------
import xml.etree.ElementTree as ET
# send and emai... | StarcoderdataPython |
4825433 | # -*- coding: utf-8 -*-
import os
import pytest
import numpy as np
import sys
sys.path.append("/home/scotfang/gits/CTranslate2/python/build/lib.linux-x86_64-3.7")
import ctranslate2
from ctranslate2.specs.model_spec import OPTIONAL, index_spec
from ctranslate2.specs import transformer_spec
from ctranslate2.converter... | StarcoderdataPython |
1680651 | <gh_stars>1-10
import os.path as osp
import numpy as np
import pickle
import random
from pathlib import Path
from functools import reduce
from typing import Tuple, List
from tqdm import tqdm
from pyquaternion import Quaternion
from nuscenes import NuScenes
from nuscenes.utils import splits
from nuscenes.utils.data_cl... | StarcoderdataPython |
196245 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mywidget.ui'
#
# Created by: PyQt5 UI code generator 5.8.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MyWidget:
def setupUi(self, MyWidget):
MyWidget.setObjectNa... | StarcoderdataPython |
3240716 | <reponame>farewell12345/UnsplashDownloader
access_token = [] # 你的accessKey
url = f'https://api.unsplash.com'
keyword = '/search/photos/'
tags = ['girl', 'boy','Potrait','lady','man','woman'] # 爬取的tag,可以自行按照实例格式编辑增加
download_pages = 20 # 下载最大页数,不要太大,不然可能时间过长
| StarcoderdataPython |
4810966 | #!/usr/bin/env python3
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. 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/L... | StarcoderdataPython |
1643236 | <reponame>UMKC-BigDataLab/DiSC
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# <NAME>
# May 23, 2017
#
# Usage: ./cal-lost-packets.py -h
import argparse
import sys
import time
def eprint(obj):
sys.stderr.write(obj)
sys.stderr.write('\n')
def main(args):
filename = args.logfile
sentCount = 0.0
rcvdCo... | StarcoderdataPython |
1633427 | #!/usr/bin/env python
# coding: utf-8
"""This script pulls business entity data from the workflow database and generates markdown
files for use as training data in the CRF NLP process. """
import configparser
import math
import psycopg2
import psycopg2.extras
from datetime import date
import datetime
def dbconnect()... | StarcoderdataPython |
3265074 | <reponame>mvonbun/python-script-templates<filename>python_pgfplots.py
import numpy as np
def writeVector(fid, npVector, prefix='', fmt='%.8e'):
"""Write (append) numpy vector to a text file for use as PGF tables."""
np.savetxt(fid, npVector, fmt=fmt, newline=' ',
header=prefix, comments='')
... | StarcoderdataPython |
4804263 | """
Suppose that we analyze an algorithm and decide that it has the following relationship between the input size, n, and the number of operations needed to carry out the algorithm:
N = n^2 + 5
Where n is the input size and N is the number of operations required.
For example, if we gave this algorithm an input of 22,... | StarcoderdataPython |
3379789 | import os
try:
from setuptools import setup
extra = dict(entry_points={
'console_scripts': ['cluster-explore=cluster_config.explore:main',
'cluster-generate=cluster_config.generate:main',
'cluster-push=cluster_config.push:main',
... | StarcoderdataPython |
1647177 | <gh_stars>0
import yaml
import subprocess
import time
import random
import string
import base64
import sys
try:
postfix= sys.argv[1]
except:
print('Please provide postfix that was generated when cluster was created')
sys.exit(1)
if postfix == None:
print('Please provide postfix that was generated when ... | StarcoderdataPython |
4833428 | from impactutils.extern.openquake import geodetic
class Point(object):
"""Simple point class to contain lat/lon/depth values."""
def __init__(self,longitude,latitude,depth=0):
"""Create a Point object.
Args:
longitude (float): Longitude of a point.
latitude (float): La... | StarcoderdataPython |
80349 | <reponame>QiliangFan/Baidu-Curve
# -*- coding: utf-8 -*-
"""
Curve
~~~~
db package
:copyright: (c) 2017-2018 by Baidu, Inc.
:license: Apache, see LICENSE for more details.
"""
import flask_sqlalchemy
db = flask_sqlalchemy.SQLAlchemy()
| StarcoderdataPython |
3213880 | # -*- coding: utf-8 -*-
"""Define custom errors for this app."""
class Error(Exception):
"""Global error for this app. If we catch this, we will cath all childs.
Usage::
from errors import Error as PostsError
try:
# action on posts
except PostsError:
# Handle... | StarcoderdataPython |
110375 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import json
import logging
import sys
import boto3
import research_pacs.shared.dicom_util as rpacs_dicom_util
import research_pacs.shared.util as rpacs_util
from research_pacs.de_identifier.dicom import DicomDeident... | StarcoderdataPython |
1673180 | import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import scanpy as sc
from scIB import utils
from scIB import metrics
def opt_louvain(adata, label_key, cluster_key, function=None, resolutions=None,
use_rep=None,
inplace=True, plot=False, force... | StarcoderdataPython |
3371117 | <reponame>nick41746/Techjam-Application<gh_stars>0
import operator
import re
from http import HTTPStatus
import os
from flask import Flask, jsonify, request
import math
robot_re = re.compile(r"^robot#([1-9][0-9]*)$")
robots = {}
app = Flask(__name__)
def distance(pos1, pos2, metric="euclidean"):
try:
if ... | StarcoderdataPython |
3236948 | <reponame>dewoolkaridhish4/C104<gh_stars>0
import csv
with open("height-weight.csv",newline="") as f:
reader=csv.reader(f)
filedata=list(reader)
filedata.pop(0)
newdata = []
for i in range(len(filedata)):
n_num=filedata[i][1]
newdata.append(float(n_num))
n=len(newdata)
newdata.sort()
if(n%2==0):
... | StarcoderdataPython |
3207510 | <gh_stars>0
"""
Command Account Name Resolve ..
"""
from .command_base import CommandBase
class AccountNameResolveCommand(CommandBase):
def __init__(self, sub_parser=None):
self._command_list = []
super().__init__('resolve', sub_parser)
def create_parser(self, sub_parser):
pa... | StarcoderdataPython |
3268048 | from pytest import raises
def test_empty_stack_default(new_stack):
assert new_stack.head is None
def test_empty_stack_pop(new_stack):
with raises(IndexError):
new_stack.pop()
def test_empty_stack_peek(new_stack):
with raises(IndexError):
new_stack.peek()
def test_empty_stack_has_size... | StarcoderdataPython |
1613608 | from django.urls import path
from rest_framework_simplejwt.views import (TokenObtainPairView,
TokenRefreshView)
from .views import signup, LessonView, ProfessorView
urlpatterns = [
path('v1/signup/', signup, name='signup'),
path('v1/token/',
TokenObtainPai... | StarcoderdataPython |
163231 | <reponame>dkotschessa/PyPCOM
class CarTablePage(Page):
add_car_form = AddCarForm()
car_table = CarTable()
def add_car(self, car: Car):
self.add_car_form.add_car(car)
def remove_car(self, car: Car):
self.car_table.remove_car(car)
@property
def cars(self) -> List[Car]:
r... | StarcoderdataPython |
1613033 | <reponame>hemantborole/aws-iot-twinmaker-samples
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import setuptools
setuptools.setup(
name='TwinMakerSiteWiseUtil',
version='0.1',
description='Iot Twin Maker Getting Started package',
url='#',
... | StarcoderdataPython |
73820 | <gh_stars>0
# -*- coding: UTF-8 -*-
'''
Created on 25 f�vr. 2017
@author: HEAVYRAGE
'''
from abc import ABCMeta, abstractmethod
from flask_restful import fields
from _pyio import __metaclass__
class Constants(object):
'''
A constants abstract class
'''
__metaclass__ = ABCMeta
... | StarcoderdataPython |
122392 | """
unit tests for GridSearch class
"""
import tigerforecast
from tigerforecast.utils.autotuning import GridSearch
from tigerforecast.utils.optimizers import *
import jax.numpy as np
import matplotlib.pyplot as plt
import itertools
def test_grid_search(show=False):
test_grid_search_arma(show=show)
test_grid_... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.