id stringlengths 1 7 | text stringlengths 6 1.03M | dataset_id stringclasses 1
value |
|---|---|---|
4828718 | <filename>scripts/deepsplines_tutorial.py<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This script exemplifies how to use DeepSplines in a network,
starting from the PyTorch CIFAR-10 tutorial:
https://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html
"""
import time
import torch
import tor... | StarcoderdataPython |
3271676 | from trame.html import vuetify, Element, Div, Span
def create_project_generation(
validation_callback, validation_output, validation_check, run_variables
):
with Div(
classes="d-flex flex-column fill-height justify-space-around",
v_if="currentView == 'Project Generation'",
):
with ... | StarcoderdataPython |
1752464 | <gh_stars>0
# -*- coding: utf-8 -*-
# Copyright 2018 The Blueoil 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... | StarcoderdataPython |
3203180 | from base import BaseWorker
| StarcoderdataPython |
1604422 | from oauth2_provider.middleware import OAuth2TokenMiddleware
class AccesTokenOAuth2TokenMiddleware(OAuth2TokenMiddleware):
def process_request(self, request):
if not request.META.get('HTTP_AUTHORIZATION', '').startswith('Bearer') and \
request.GET.get('access_token'):
bearer = ... | StarcoderdataPython |
3350891 | from __future__ import annotations
from pathlib import Path
from typing import Type, TYPE_CHECKING, Any
from pycep.typing import BicepJson
from checkov.bicep.parser import Parser
from checkov.bicep.utils import get_scannable_file_paths
from checkov.common.graph.db_connectors.db_connector import DBConnector
from chec... | StarcoderdataPython |
102695 | <filename>Modules/tobii/eye_tracking_io/time/sync.py
from tobii.eye_tracking_io._native import tetio
from tobii.eye_tracking_io.time.clock import Clock
from tobii.eye_tracking_io.mainloop import Mainloop, MainloopThread
from tobii.eye_tracking_io.browsing import EyetrackerInfo
class State(object):
UNSYNCHRONIZED ... | StarcoderdataPython |
1659174 | from backend.api.models import Horario
from rest_framework import serializers
class HorarioSerializer(serializers.ModelSerializer):
"""
HorarioSerializer Serializer de Horario
Args:
serializers (ModelSerializer): Serializer del modulo rest_framework
"""
class Meta:
"""
M... | StarcoderdataPython |
1726206 | <reponame>umihai1/github_publish
#!/usr/bin/env python
"""
Main test function to execute all tests found in the current directory
"""
import sys
import logging
import xmlrunner
try:
import unittest2 as unittest
except ImportError:
import unittest
def main():
tests = unittest.TestLoader().discover('.',... | StarcoderdataPython |
3201439 | from decimal import Decimal
import decimal
import time
import json
import random
import argparse
import requests
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
import logging
with open('config.json','r') as conf:
configs = json.loads(conf.read())
rpc_user = configs['rpc_user']
rpc_passwo... | StarcoderdataPython |
3353138 | """Additional file information in Database
Revision ID: ec66a0a3186b
Revises: 4b41e84f7aac
Create Date: 2022-01-20 17:00:16.089851
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "ec66a0a3186b"
down_revision = "4b41e84f... | StarcoderdataPython |
1672335 | <filename>protonfixes/gamefixes/312530.py
""" Game fix for Duck Game
"""
#pylint: disable=C0103
from protonfixes import util
def main():
""" https://www.protondb.com/app/312530#bXY0Kuwwlz
"""
util.winedll_override('dinput', 'n')
util.append_argument('-nothreading')
| StarcoderdataPython |
180775 | from . import common
class Devices(common.Resource):
def __init__(self, sigfox):
super().__init__(sigfox, "devices/")
def retrieve_undelivered_callbacks(self, id, query=""):
""" Retrieve a list of undelivered callbacks and errors for a
given device, in reverse chronological order... | StarcoderdataPython |
3334373 | <reponame>ZhengyangXu/Algorithm-Daily-Practice
#
# @lc app=leetcode.cn id=139 lang=python3
#
# [139] 单词拆分
#
# https://leetcode-cn.com/problems/word-break/description/
#
# algorithms
# Medium (49.95%)
# Likes: 992
# Dislikes: 0
# Total Accepted: 146.7K
# Total Submissions: 292.3K
# Testcase Example: '"leetcode"\n... | StarcoderdataPython |
3298590 | <reponame>piotr-worotnicki/raspberry-pi-rgb-led-controller
# Generated by Django 2.1.2 on 2018-12-29 19:37
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('led', '0001_initial'),
]
operations = [
migratio... | StarcoderdataPython |
1673139 | # 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... | StarcoderdataPython |
20272 | <filename>tests/test_timeconversion.py
import unittest
from datetime import datetime, timezone
from pyfuppes import timeconversion
class TestTimeconv(unittest.TestCase):
@classmethod
def setUpClass(cls):
# to run before all tests
print("testing pyfuppes.timeconversion...")
... | StarcoderdataPython |
1628847 | <reponame>camerondphillips/MAYAN
from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.contrib import messages
from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, Http404
from djan... | StarcoderdataPython |
3220483 | <gh_stars>1-10
from . import redshift_query
import logging
def main():
logging.basicConfig()
redshift_query.query({})
return 0
| StarcoderdataPython |
1778424 | <filename>src/token_auth/settings.py<gh_stars>1-10
# Django settings for cms project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('<NAME>', '<EMAIL>'),
)
CACHE_BACKEND = 'locmem:///'
MANAGERS = ADMINS
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_... | StarcoderdataPython |
1688325 | from azureml.core import Run
from mlapp.main import MLApp
from mlapp.handlers.wrappers.file_storage_wrapper import file_storage_instance
from mlapp.integrations.aml.utils.run_class import load_config_from_string, tag_and_log_run, tag_and_log_outputs
import argparse
from config import settings
from mlapp.managers.flow_... | StarcoderdataPython |
83482 | class Calculator:
def __init__(self):
self.calculation = 0
self.operation = None
def plus(self, num):
self.calculation += num
def minus(self, num):
self.calculation -= num
def multiply(self, num):
self.calculation *= num
def divide(self, num):
... | StarcoderdataPython |
1744104 | <filename>guess/urls.py<gh_stars>0
from django.conf.urls import url
from .views import GuessResultList, CachedGuessResultList
urlpatterns = [
url(r'^guessresult/(?P<pagepath>.+)/(?P<effectivetype>.+)/$', GuessResultList.as_view(), name='guess_result'),
url(r'^guessresult/(?P<pagepath>.+)/$', GuessResultList.as... | StarcoderdataPython |
3326684 | <gh_stars>0
import itertools
import types
import numpy as np
import hierarchy as hrcy
def test_get_transition_rate():
capacities = [3, 1]
state_in = [[2, 1], [1, 0]]
state_out = [[2, 0], [1, 0]]
r = 1.1
lmbda = [2, 3]
mu = [[0.2, 0.1], [1.2, 1.1]]
assert (
hrcy.transitions.get_ra... | StarcoderdataPython |
3252114 | import time
from turtle import Screen
from player import Player
from car_manager import CarManager
from scoreboard import Scoreboard
screen = Screen()
screen.setup(width=600, height=600)
screen.tracer(0)
player=Player()
car_manager=CarManager()
scoreboard=Scoreboard()
screen.listen()
screen.onkeypress(player.move_for... | StarcoderdataPython |
1613875 | <filename>src/visualizers/error.py
from pathlib import Path
def check_directory_exists(dir_path: Path, dir_type: str):
if not dir_path.exists():
print(f"{dir_type} directory doesn't exists: {dir_path}")
exit(1)
| StarcoderdataPython |
169574 | <filename>tests/test_eval_metrics.py
import unittest
from citeomatic.eval_metrics import precision_recall_f1_at_ks, average_results
class TestEvalMetrics(unittest.TestCase):
def test_precision_recall_f1_at_ks(self):
gold_y = ['1', '2', '3']
pred_y = ['1', '4', '3']
scores_y = [1.0, 0.1, 0.... | StarcoderdataPython |
1648612 | <gh_stars>0
import sqlite3
import pandas as pd
class DBConnect:
def __init__(self, db_path):
self.con = sqlite3.connect(db_path)
self.cur = self.con.cursor()
def initialize_db(self):
self.cur.execute("DROP TABLE IF EXISTS officer_payment")
self.cur.execute("DROP TABLE IF EXI... | StarcoderdataPython |
1681470 | """/**
* @author [<NAME>]
* @email [<EMAIL>]
* @create date 2020-05-14 11:49:34
* @modify date 2020-05-14 11:49:34
* @desc [
Data module for statistics.
Prefix SUF indicates "sufficient". Used for data mins.
]
*/
"""
##########
# Sufficient Data Checks
##########
SUF_TABLE_DATA = 5
SUF_ERR_LIST = 5
SUF... | StarcoderdataPython |
1726570 | from django.http import JsonResponse, HttpResponseBadRequest, HttpResponse
from src.tipboard.app.applicationconfig import getRedisPrefix
from src.tipboard.app.properties import BASIC_CONFIG, REDIS_DB, DEBUG, ALLOWED_TILES
from src.tipboard.app.cache import MyCache, save_tile
from src.tipboard.app.utils import checkAcce... | StarcoderdataPython |
3385110 | import os
import numpy as np
import gensim
class YearTextEmbeddings:
"""
Representation of the year using average base embeddings of entities
"""
def __init__(self, entity_embeddings, years_folder, output_file, tfidf = False):
self.entity_embeddings = entity_embeddings
self.years_folder... | StarcoderdataPython |
1780375 | """This module is part of the CFSAN SNP Pipeline. It contains the code to
calculate the pairwise SNP distances between samples.
"""
from __future__ import print_function
from __future__ import absolute_import
import itertools
from snppipeline import utils
from snppipeline.utils import verbose_print
def calculate_s... | StarcoderdataPython |
1721091 | import mxnet as mx
from mxnet import gluon
from mxnet.gluon import HybridBlock
from ceecnet.utils.get_norm import *
class Conv2DNormed(HybridBlock):
"""
Convenience wrapper layer for 2D convolution followed by a normalization layer
All other keywords are the same as gluon.nn.Conv2D
"""
... | StarcoderdataPython |
1697682 | from permutation import Permutation
from itertools import permutations
from time import time
import numpy as np
import math
"""
This has several perfect hash functions to give each position of the cube
a unique coordinate. It can also reverse the hash function to give the
relavent cube information back from a coordin... | StarcoderdataPython |
3246164 | <reponame>Elzei/show-off
#!/usr/bin/env python2.7
def dividers(value):
answer = []
for i in xrange(1, (value // 2 ) + 1):
if (value % i) == 0:
answer.append(i)
return answer
def dividers2(value):
return filter(lambda x: (value % x) == 0, xrange(1, (value // 2) + 1))
def dividers_g... | StarcoderdataPython |
1766898 | from algoliasearch_django import AlgoliaIndex
from algoliasearch_django.decorators import register
from products.models import Product
@register(Product)
class ProductIndex(AlgoliaIndex):
# should_index = "is_expensive_item"
fields = ["user", "title", "content", "price", "is_public"]
tags = 'get_random_m... | StarcoderdataPython |
1657048 | <reponame>focusunsink/study_python<filename>np/8_assure_quality_with_testing/7_to_8_all_close.py<gh_stars>0
# -*- coding:utf-8 -*-
"""
Project : numpy
File Name : 7_to_8_all_close
Author : Focus
Date : 8/23/2021 9:02 AM
Keywords : assert_allclose, assert_array_equal,
Abstract : |a - b| <= (atol + rtol * |b|... | StarcoderdataPython |
1766553 | <filename>primetest.py
import time
NUM_PRIMES = 50000
array = list(range(0, NUM_PRIMES))
isPrime = True
t1 = time.time()
i = 2
idx = 0
while (idx < NUM_PRIMES):
isPrime = True;
y = 0
for y in range(0, idx):
if (i % array[y] == 0):
isPrime = False
break
i... | StarcoderdataPython |
1626222 | <reponame>mikemartino/cookbook
from recipebook.cookbook import Cookbook
from recipebook.ingredient import Ingredient
from recipebook.recipe import Recipe, Time
def main():
cookbook = Cookbook()
print(cookbook.table_of_contents.pretty_print())
# cookbook.recipes.append(Recipe("Chickpea Burgers", Time(45, ... | StarcoderdataPython |
4804958 | <gh_stars>1-10
from django import forms
from djangoProject1.polls.models import Profile
class AddProfileForm(forms.ModelForm):
MAX_LENGTH = 30
first_name = forms.CharField(max_length=15, label="First Name", widget=forms.TextInput(attrs={
'id': "id_first_name", "type": "text", "name": "first_nam... | StarcoderdataPython |
3223447 | <reponame>mazurbeam/django-cities
from django.contrib.gis.db import models
class AlternativeNameManager(models.Manager):
def get_queryset(self):
return super(AlternativeNameManager, self).get_queryset().exclude(kind='link')
| StarcoderdataPython |
3246205 | def wordBreakCount(dictionary, txt):
txtl = len(txt)
maxw = 0
d = dict()
lens = set()
for word in dictionary:
wlen = len(word)
maxw = max(wlen, maxw)
if wlen not in d:
d[wlen] = []
d[wlen].append(word)
lens.add(wlen)
print(txtl, d, lens, maxw... | StarcoderdataPython |
3346722 | <reponame>Feuoy/campus-network-login<filename>signIn.py
# coding:utf-8
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from PIL import Image
import pandas as pd
import time
import identifyRandcode
# import getValidAccount
class Cn_SignIn():
"""
这个类模拟登录校园网
"""
def __... | StarcoderdataPython |
93997 | from setuptools import setup
setup(
name="medicus",
version="0.1",
packages=["medicus"]
) | StarcoderdataPython |
151039 | <filename>home/hairygael/InMoov2.minimalTorso.py
#file : InMoov2.minimalTorso.py
# this will run with versions of MRL 1.0.107
# a very minimal script for InMoov
# although this script is very short you can still
# do voice control of a right Arm
# for any command which you say - you will be required to say a confirmat... | StarcoderdataPython |
3399520 | <reponame>k1lgor/linux-update
#!/bin/python3
from time import sleep
import os
def update():
"""Update method"""
print('''
=====================
Updating has begun...
=====================
''')
os.system("apt update && apt dist-upgrade -y")
sleep(2)
os.system("apt ... | StarcoderdataPython |
3208705 | <reponame>KinmanCovey/fifth-row-py<filename>fifth-row-test.py
#!/usr/bin/env python
import unittest, fifthrow
from fifthrow.fifthrow import *
class FifthRowTest(unittest.TestCase):
def test_sandboxed_url(self):
'''
FifthRow object's url should be the sandboxed url.
'''
self.assertE... | StarcoderdataPython |
55094 | from components.base.ecu.types.impl_ecu_simple import SimpleECU
from components.base.ecu.software.ecu_software import ECUSoftware
from components.security.ecu.software.impl_app_layer_secure import SecureApplicationLayer
from layers.impl_comm_module_my_protocol import MyProtocolCommModule
class MyProtocolECU(SimpleECU)... | StarcoderdataPython |
4813804 | #################################################################################################
# Visual object tracking in panoramic video
# Master thesis at Brno University of Technology - Faculty of Information Technology
# Author: <NAME> (<EMAIL>)
# Supervisor: Doc. Ing. <NAME>, Ph.D.
# Module: eval... | StarcoderdataPython |
3324676 | <gh_stars>0
"""
:author: <NAME>
"""
from typing import Union, Optional, Sequence, Tuple, Set
NargsValue = Union[str, int, Tuple[int, Optional[int]], Sequence[int], Set[int], range]
NARGS_STR_RANGES = {'?': (0, 1), '*': (0, None), '+': (1, None)}
SET_ERROR_FMT = 'Invalid nargs={!r} set - expected non-empty set where ... | StarcoderdataPython |
4810621 | import abc
class Recorder:
def __init__(self):
self.record = 0
def Record(self):
if self.record == 0:
self.record = 1
def RecordStop(self):
if self.record == 1:
self.record = 0
@abc.abstractmethod
def ProcessRecord(self, value):
pass | StarcoderdataPython |
83680 | <filename>satchless/image/views.py
from django.http import HttpResponseNotFound
from django.shortcuts import get_object_or_404, redirect
from . import IMAGE_SIZES
from . import models
def thumbnail(request, image_id, size):
image = get_object_or_404(models.Image, id=image_id)
if not size in IMAGE_SIZES:
... | StarcoderdataPython |
3267056 | # Generated by Django 2.2.13 on 2020-06-18 17:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sites', '0041_remove_action_equivalent_command'),
]
operations = [
migrations.AddField(
model_name='site',
name='ad... | StarcoderdataPython |
191131 | import tkinter as tk
from tkinter import ttk
from pprint import pprint
app = tk.Tk()
# ------------ Label ---------
label1Top = tk.Label(app, text = "Нажми на Checkbox")
label1Top.pack()
def checkbutton_check():
print('checkbox', var1.get())
label1Top.config(text=var1.get())
# ---------- CheckBox ---------... | StarcoderdataPython |
1783563 | import click
import requests
import pandas
from io import StringIO
import re
import os
class CurrencyCode(click.ParamType):
name = 'symbol'
def convert(self, value, param, ctx):
if value.isalpha():
return value.upper()
self.fail('%s is not a valid symbol' % value, param, ctx)
cl... | StarcoderdataPython |
4802580 | #! /usr/bin/env python3
import glob
import jinja2
import re
import os
import subprocess
import sys
import textwrap
import yaml
from typing import List
TEMPLATE = """
vars.http_vhosts["{{hostname}}"] = {
http_uri = "{{ uri }}"
http_vhost = "{{ vhost | default(hostname) }}"
http_ssl = {{ ssl | default('true') }... | StarcoderdataPython |
1662622 | import torch
from torchvision import transforms as T
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
def to_same_size(A, focus_map):
'''
Input: aim_size_image
Image_need_to_be_resize
Output: resized_image
'''
A_size = list(A.size())
foc... | StarcoderdataPython |
3260745 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# 该例程将提供print_string服务,std_srvs::SetBool
import rospy
from std_srvs.srv import SetBool, SetBoolResponse
def stringCallback(req):
# 显示请求数据
if req.data:
rospy.loginfo("Hello ROS!")
# 反馈数据
return SetBoolResponse(True, "Print Successully")
else:
... | StarcoderdataPython |
1708860 | <filename>utils_eval.py
import sys
print(sys.executable)
import sklearn
sklearn.__version__
import torch.nn as nn
import torch.optim as optim
import nltk
from nltk import word_tokenize
nltk.download('punkt')
import dill
print('next')
from torchtext import data
from torchtext import datasets
from torchtext.vocab im... | StarcoderdataPython |
132916 | """
Plotting convenience functions.
"""
from math import ceil
import ipywidgets as widgets
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import numpy as np
from model_base import get_ext_input
# define basics
prop_cycle = plt.rcParams["axes.prop_cycle"]
colors = prop_cycle.by_key()["color"]... | StarcoderdataPython |
1678578 | <reponame>sajjadt/competitive-programming
from functools import lru_cache
from operator import getitem
LIMIT = 10000 + 1
pow_table = [1]
for i in range(LIMIT):
pow_table.append(2*pow_table[-1])
best_choice = [0, 0, 0, 1]
for disp in range(3, 150):
b = best_choice[-1]
for j in range(disp):
best_choice.append... | StarcoderdataPython |
169266 | <reponame>plutoyuxie/mmgeneration
import os.path as osp
from mmgen.datasets.builder import build_dataloader, build_dataset
class TestPersistentWorker(object):
@classmethod
def setup_class(cls):
imgs_root = osp.join(osp.dirname(__file__), '..', 'data/image')
train_pipeline = [
dic... | StarcoderdataPython |
3283011 | <reponame>luisriverag/certbot
"""Common utilities for certbot_apache."""
import shutil
import sys
import unittest
import augeas
import josepy as jose
try:
import mock
except ImportError: # pragma: no cover
from unittest import mock # type: ignore
from certbot.compat import os
from certbot.plugins import co... | StarcoderdataPython |
1715318 | <reponame>rexor12/holobot<gh_stars>1-10
from .action_base import ActionBase
from .do_nothing_action import DoNothingAction
from .reply_action import ReplyAction
| StarcoderdataPython |
3324670 | #!/usr/bin/env python3
#
# Copyright 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import itertools
import logging
import os
import re
import sys
from cros.factory.utils import cros_board_utils
... | StarcoderdataPython |
146854 | import os.path as op
from pylama.check_async import check_async
from pylama.config import parse_options
from pylama.core import filter_errors, parse_modeline, run
from pylama.errors import Error, remove_duplicates
from pylama.hook import git_hook, hg_hook
from pylama.main import shell, check_path
def test_filter_err... | StarcoderdataPython |
3210589 | import xml.etree.ElementTree as ET
import time
import select
from io import StringIO
from threading import Thread, Event, Lock
from os import read
from .coqapi import Ok, Err
from .xmltype import *
class CoqHandler:
def __init__(self, state_manager, printer):
self.printer = printer
self.state_mana... | StarcoderdataPython |
3344658 | """Problem 51: Prime digit replacements"""
import unittest
from utils.primes import seive_of_erat
def replace_digits(p, digits):
"""If p contains more than one of the same digit, replace them will all
other possible digits."""
if 0 in digits:
other_digits = [str(d) for d in list(range(1, 10))
... | StarcoderdataPython |
3251240 | <gh_stars>1-10
from contextlib import suppress
from discord.ext import commands
class Context(commands.Context):
async def send(self, content=None, *, tts=False, embed=None, file=None, files=None, delete_after=None, nonce=None, allowed_mentions=None, reference=None, mention_author=None):
try:
r... | StarcoderdataPython |
3380501 | from django.apps import AppConfig
class IrekuaModelsConfig(AppConfig):
name = 'irekua_models'
verbose_name = 'irekua-models'
| StarcoderdataPython |
3296628 | from fiber import Process, SimpleQueue
def foo(q, a, b):
q.put(a + b)
if __name__ == '__main__':
q = SimpleQueue()
p = Process(target=foo, args=(q, 42, 21))
p.start()
print(q.get())
p.join()
| StarcoderdataPython |
3277492 | <filename>test/check-gui-sh.sikuli/check-gui-sh.py
wait("1530638293676.png", 10)
| StarcoderdataPython |
129472 | <reponame>crestdatasystems/rubrik-polaris-sdk-for-python<gh_stars>0
import os
import pytest
from conftest import util_load_json, BASE_URL
from rubrik_polaris.sonar.scan import ERROR_MESSAGES
FILE_TYPES = ['ANY', 'HITS', 'STALE', 'OPEN_ACCESS', 'STALE_HITS', 'OPEN_ACCESS_HITS']
@pytest.mark.parametrize("scan_name, re... | StarcoderdataPython |
1731833 | from .custom_model import get_custom_model
from . import archs | StarcoderdataPython |
146602 | import os
import json
from typing import Dict
from fintools.settings import get_logger
from fintools.utils import StringWrapper, timeit
from .settings import (
INDUSTRY_SEARCH_DEFAULT_FILENAME,
INDUSTRY_SEARCH_DEFAULT_THRESHOLD
)
logger = get_logger(name=__name__)
class Main:
threshold = INDUSTRY_SEARC... | StarcoderdataPython |
1625422 | <filename>envs/CARLA/carla_lib/client_example.py
#!/usr/bin/env python3
# Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
#### This script has been ... | StarcoderdataPython |
191914 | <reponame>pvtokmakov/video_cluster
from src.datasets.kinetics import load_annotation_data, get_video_names_and_annotations, load_value_file
import os
import torch
import json
import argparse
from os.path import join
import numpy as np
from src.objectives.localagg import run_kmeans_multi_gpu, run_kmeans
DEFAULT_KMEANS... | StarcoderdataPython |
3240435 | #!/usr/bin/env python
# Copyright (c) 2007 XenSource, Inc.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE A... | StarcoderdataPython |
3346475 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
import torch.nn as nn
from typing import Dict, List, NamedTuple, Optional
from torch import Tensor
EncoderOut = NamedTuple(
... | StarcoderdataPython |
74027 | from setuptools import find_packages, setup
description = 'Create webhook services for Dialogflow using Python'
setup(
name='dialogflow-fulfillment',
version='0.4.4',
author='<NAME>',
author_email='<EMAIL>',
packages=find_packages('src'),
package_dir={'': 'src'},
url='https://github.com/gc... | StarcoderdataPython |
127021 | <reponame>ShujaKhalid/deep-rl
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import C... | StarcoderdataPython |
36897 | import pandas as pd
from visions import visions_string, visions_datetime
from visions.core.model import TypeRelation
from visions.core.model.relations import InferenceRelation
from visions.utils.coercion import test_utils
def to_datetime_year_week(series):
"""Convert a series of the format YYYY/UU (year, week) t... | StarcoderdataPython |
3388038 | class GenericUriParser(UriParser):
"""
A customizable parser for a hierarchical URI.
GenericUriParser(options: GenericUriParserOptions)
"""
@staticmethod
def __new__(self,options):
""" __new__(cls: type,options: GenericUriParserOptions) """
pass
| StarcoderdataPython |
182208 | <filename>ae5_tools/cli/commands/pod.py
import sys
import click
from ..login import cluster_call
from ..utils import add_param, ident_filter, global_options
@click.group(short_help='info, list',
epilog='Type "ae5 user <command> --help" for help on a specific command.')
@global_options
def pod():
'''... | StarcoderdataPython |
1623308 | <gh_stars>1-10
""" Module for definig an instance of a detected symptom """
class Symptom:
""" An object to represent an occurence of a specific symptom"""
def __init__(self, tag, action_msg, signal):
self.tag = tag
self.action_msg = action_msg
self.signal = signal
self.sta... | StarcoderdataPython |
3244649 | import discord
import discord.ext.commands as commands
import time as time_module
import sys
import pickle
import asyncio
sys.path.insert(0, "../")
import util
class Reminders(commands.Cog):
def __init__(self, bot, timeouts, generic_responses):
self.bot = bot
self.timeouts = timeouts
self... | StarcoderdataPython |
1610091 | <filename>patch_performance/__init__.py
from cb_performance import get_all_cb_sets_perf, group_poll_results, get_perf_totals
from cb_score import compute_overhead
from perf_constants import SIZE_PERF_NAME
from farnsworth.models import PatchScore, Round, PatchType
import logging
l = logging.getLogger("patch_performanc... | StarcoderdataPython |
1722918 | # Reads data from QuickBooks Excel output, and combines two detail profit and loss files (from two time periods) into one
# file which keeps the detail from each time period but also shows the comparision between the two periods
import numpy as np
import pandas as pd
def read_db_from_file(filename):
# Read in th... | StarcoderdataPython |
3379425 | <gh_stars>1-10
# Simple Class with class variable
# Class with init
# Class with StaticMethod
# Class with print method
# Advance class with inheritance
class Person:
Answer = 42 # Class Variable, Shared by all instance
def __init__(self, name):
self.name = name # Instance Variable
... | StarcoderdataPython |
1607294 | <filename>studentdb/api/urls.py
from django.urls import path
from rest_framework.urlpatterns import format_suffix_patterns
from api import views
urlpatterns = [
path('add', views.AddAPIView.as_view()),
path('students', views.StudentListAPIView.as_view()),
path('student/<id>', views.StudentDetailAPIView.as_... | StarcoderdataPython |
1692788 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
MAST Portal
===========
Module to query the <NAME> Archive for Space Telescopes (MAST).
"""
from __future__ import print_function, division
import warnings
import json
import time
import os
import re
#import keyring
import io
import numpy as np
f... | StarcoderdataPython |
1690092 | import pytest
from bids.layout import BIDSLayout
from os.path import join, abspath, sep
from bids.tests import get_test_data_path
@pytest.fixture(scope='module')
def layout():
data_dir = join(get_test_data_path(), '7t_trt')
return BIDSLayout(data_dir)
def test_bold_construction(layout):
ents = dict(subj... | StarcoderdataPython |
97935 | """empty message
Revision ID: <PASSWORD>
Revises: <PASSWORD>
Create Date: 2018-07-18 12:08:54.854137
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
from alembic.ddl import postgresql
revision = '<PASSWORD>'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = ... | StarcoderdataPython |
3282513 | <reponame>asl-usgs/earthquake-heliplot<filename>lib/parallelplotVelocity.py<gh_stars>1-10
#!/usr/bin/env python
# --------------------------------------------------------------
# Filename: parallelplotVelocity.py
# --------------------------------------------------------------
# Purpose: Plots velocity data (filtered... | StarcoderdataPython |
3293599 | <filename>src/mygrad/math/misc/funcs.py
from mygrad.tensor_base import Tensor
from .ops import Abs, Cbrt, Maximum, Minimum, Sqrt
__all__ = ["abs", "absolute", "cbrt", "clip", "sqrt", "maximum", "minimum"]
def abs(a, constant=False):
""" ``f(a) -> abs(a)``
Parameters
----------
a : array_like
c... | StarcoderdataPython |
1623304 | <reponame>ottomattas/INFOMAIGT-AGENTS
#! /usr/bin/env -S python -u
from game import Game
from random_agent import RandomAgent
from bandit_agent import BanditAgent
from neural_network_agent import NNAgent
import argparse, time, cProfile
import numpy as np
import multiprocessing as mp
from collections import Co... | StarcoderdataPython |
1730307 | from enum import Enum
class TankBody(Enum):
VT1 = 1
VT2 = 2
VT3 = 3
VT4 = 4
class Tank:
def __init__(self) -> None:
self.body:TankBody = TankBody.VT1
self.hasExtraArmour: bool = False #附加装甲
self.hasAutomaticWeaponStation: bool = False #自动武器站
self.hasAirConditioner... | StarcoderdataPython |
4838075 | <reponame>ValRat/raster-vision
from copy import deepcopy
import rastervision as rv
from rastervision.command import (CommandConfig, CommandConfigBuilder,
BundleCommand)
from rastervision.protos.command_pb2 \
import CommandConfig as CommandConfigMsg
from rastervision.rv_config impo... | StarcoderdataPython |
121191 | # -*- coding:utf-8 -*-
from multiprocessing import Pool, Queue, Lock, SimpleQueue
import Queue
import os
import time
import random
import argparse
import utils
MAX_PROCESS = 5
def executor(name, r_queue):
# print 'Run task %s (%s)...' % (name, os.getpid())
start = time.time()
time.sleep(random.random() ... | StarcoderdataPython |
4835379 | import pytest
from scrapy_autoextract.errors import QueryError, summarize_exception
def test_query_error():
exc = QueryError({"foo": "bar"}, "sample error")
assert str(exc) == "QueryError: message='sample error', query={'foo': 'bar'}"
@pytest.mark.parametrize("exception, message", [
(QueryError({}, "do... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.