id stringlengths 1 8 | text stringlengths 6 1.05M | dataset_id stringclasses 1
value |
|---|---|---|
8048331 | from typing import List, Union, Dict, Any
from string import ascii_lowercase
from collections import defaultdict
import logging
import peewee as pw
import discord
from imdb import IMDb
from imdb._exceptions import IMDbDataAccessError
from .models import Server, Movie, Vote, MovieVote, UserVote, IMDBInfo
from . import... | StarcoderdataPython |
51945 | import json
import logging
import time
from pathlib import Path
from django.core.mail import EmailMultiAlternatives, get_connection
from django.core.management import BaseCommand
from slack_sdk import WebClient, errors
from database_locks import locked
from notifications.models import Notification, Subscription
from ... | StarcoderdataPython |
3569435 | class A(object):
x:int = 1
def foo(self:"A") -> int: # OK
return 0
def bar() -> int: # Needs self param
return 0
def baz(self:int) -> int: # Incorrect self type
return 0
A()
| StarcoderdataPython |
11239202 | <reponame>arrow-/PEAvish<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Track evolution dynamics like individual interactions, fitness statistics. This
information is used to create the Complex Network.
"""
import random
import gephistreamer.graph as graph
import gephistreamer.streamer as streamer
def... | StarcoderdataPython |
11357751 | from __future__ import print_function
from .__version__ import __author__, __author_email__, __copyright__, \
__description__, __license__, __title__, __url__, __version__
# from .interlock import *
from .test_demo import *
__all__ = [
'__author__', '__author_email__', '__copyright__', '_... | StarcoderdataPython |
6602768 | <filename>tests/fit/test_cost_function.py
#!/usr/bin/env python3
""" Tests for the cost functions module.
.. code-author: <NAME> <<EMAIL>>, Yale University
"""
import logging
import numpy as np
import pytest
import scipy.integrate
from typing import Any, Dict, Tuple, Union
import pachyderm.fit.base as fit_base
impo... | StarcoderdataPython |
3550125 | <reponame>swp930/squashrebase
#!/usr/bin/env python2.7
# Copyright 2016 <NAME>
#
# 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 req... | StarcoderdataPython |
6652400 | <filename>google-train-test/learn_train3.py
from __future__ import print_function
import math
from IPython import display
from matplotlib import cm
from matplotlib import gridspec
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
from sklearn import metrics
import tensorflow as tf
from tenso... | StarcoderdataPython |
5105776 | <filename>src/catsVsDogs/main.py
# = = = = = библиотеки = = = = =
# При запуске программы TensorFlow 2+ пытается запустить GPU
# Нам нужен CUDA для GPU TensorFlow
# Чтобы не выводились предупреждения при запуске программы
# пропишем две строчки:
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' #ignore
import numpy
... | StarcoderdataPython |
1679835 | from .signals import webhook_event # NOQA
from .version import __version__
from .views import WebhookReceiverView # NOQA
| StarcoderdataPython |
3218481 | <reponame>aurelienpierre/colour<gh_stars>0
"""Defines the unit tests for the :mod:`colour.models.hunter_lab` module."""
import numpy as np
import unittest
from itertools import permutations
from colour.colorimetry import TVS_ILLUMINANTS_HUNTERLAB
from colour.models import (
XYZ_to_K_ab_HunterLab1966,
XYZ_to_H... | StarcoderdataPython |
11308782 | <reponame>alice-biometrics/petisco-task-manager
import pytest
from meiga import isSuccess, Failure
from unittest.mock import Mock
from meiga.assertions import assert_success, assert_failure
from petisco import IEventPublisher
from taskmanager.src.modules.tasks.application.create.create_task import CreateTask
from ta... | StarcoderdataPython |
5176633 | import unittest
import itertools
from pycftboot import ConformalBlockTable, ConvolvedBlockTable
from pycftboot.cbt_seed1 import ConformalBlockTableSeed1
from pycftboot.cbt_seed2 import ConformalBlockTableSeed2
class TestCBTSeed1(unittest.TestCase):
def test_CBTSeed1(self):
"""Test ConformalBlockTableSeed... | StarcoderdataPython |
1952591 | class A:
def a(self):
return 'a'
| StarcoderdataPython |
1921323 | from .base_student import *
from .edm_student import *
| StarcoderdataPython |
6582027 | from base64 import b64decode
import re
from routersploit import (
exploits,
print_info,
print_error,
print_status,
print_success,
print_table,
http_request,
mute,
validators,
)
class Exploit(exploits.Exploit):
"""
Exploit implementation for Comtrend CT-5361T Password Discl... | StarcoderdataPython |
5081355 | from django.apps import AppConfig
class ModuleManagementConfig(AppConfig):
name = 'module_management'
| StarcoderdataPython |
24011 | <reponame>bgruening/bcbb
#!/usr/bin/env python
"""Convert a GFF and associated FASTA file into GenBank format.
Usage:
gff_to_genbank.py <GFF annotation file> [<FASTA sequence file> <molecule type>]
FASTA sequence file: input sequences matching records in GFF. Optional if sequences
are in the GFF
molecule typ... | StarcoderdataPython |
3452876 | from core.Controller import Controller, Utils, Request, Response, json, datetime
from core.classes.Authenticator import Authenticator
from models.User import User
from models.EmailTemplate import EmailTemplate
from core.classes.SmtpClient import SmtpClient
class PasswordRecoveryController(Controller):
def __init_... | StarcoderdataPython |
4992410 | """add revision indexes
Revision ID: 1cdd<PASSWORD>c
Revises: <PASSWORD>
Create Date: 2015-03-10 16:17:41.330825
"""
# revision identifiers, used by Alembic.
revision = '1<PASSWORD>'
down_revision = '<PASSWORD>'
from alembic import op
def upgrade():
op.create_index(op.f('ix_revision_commit'), 'revision', ['co... | StarcoderdataPython |
24411 | <gh_stars>0
#!/usr/bin/env python
#
# Drain usage example, a simple HTTP log aggregation stats monitor.
#
# Monitor an ever-growing HTTP log in Common Log Format by tailing it (let's a
# tail subprocess handle all the hassles like rename, re-creation during
# log-rotation etc.) and aggregating some stats on a time-basi... | StarcoderdataPython |
6564063 | <gh_stars>1-10
##############################################################
# Basic ElasticSearch connectivity settings
##############################################################
# index information to use in live
ELASTIC_SEARCH_HOST = "http://localhost:9200"
ELASTIC_SEARCH_INDEX = "db"
ELASTIC_SEARCH_VERSION =... | StarcoderdataPython |
1750765 | <reponame>JamesRunnalls/netcdf2geotiff
from netcdf2geotiff import rgb_geotiff, singleband_geotiff
rgb_geotiff("test3.nc", "test3.tif", "RED", "GREEN", "BLUE", "lat", "lon")
singleband_geotiff("test3.nc", "tests3.tif", "IDEPIX_SNOW_ICE", "lat", "lon") | StarcoderdataPython |
9646363 | <filename>src/email_config.py<gh_stars>1-10
#!/usr/bin/env python3
from getpass import getpass
import json
import sys
import traceback
import texttable
import api
import cloudpoint
import logs
import utils
COLUMNS = utils.get_stty_cols()
LOG_C = logs.setup(__name__, 'c')
LOG_F = logs.setup(__name__, 'f')
LOG_FC = log... | StarcoderdataPython |
3238801 | # To include Random function
import random
rock = '''
_______
---' ____)
(_____)
(_____)
(____)
---.__(___)
'''
paper = '''
_______
---' ____)____
______)
_______)
_______)
---.__________)
'''
scissors = '''
_______
---' ____)____
______)
... | StarcoderdataPython |
11303840 | <reponame>prakharsingh95/Model-vs-Model-Free-RL
import os
import argparse
from pathlib import Path
import torch
from torch.optim import Adam
import torch.nn.functional as F
from torch.utils.data import DataLoader
from torchvision.utils import save_image
import settings
import dataset
from vae import VAE
from mdrnn im... | StarcoderdataPython |
5070789 | # coding: utf-8
"""
Domain specific language for dbpedia quepy.
"""
| StarcoderdataPython |
67209 | <gh_stars>100-1000
import pytest
from enum import Enum
from toloka.client._converter import converter
from toloka.util._extendable_enum import extend_enum, ExtendableStrEnum
from toloka.client.primitives.base import BaseTolokaObject
@pytest.fixture
def test_enum():
class TestEnum(Enum):
A = 'a'
B... | StarcoderdataPython |
5039700 | from nonebot import on_command, logger
from nonebot.plugin.export import export
from nonebot.typing import T_State
from nonebot.adapters.cqhttp.bot import Bot
from nonebot.adapters.cqhttp.event import MessageEvent, GroupMessageEvent, PrivateMessageEvent
from nonebot.adapters.cqhttp.permission import GROUP, PRIVATE_FRIE... | StarcoderdataPython |
4907330 | <reponame>phil65/PrettyQt
from __future__ import annotations
from typing import Literal
from deprecated import deprecated
from prettyqt import constants, core, widgets
from prettyqt.qt import QtCore, QtGui, QtWidgets
from prettyqt.utils import InvalidParamError, bidict
REMOVE_BEHAVIOUR = bidict(
left_tab=QtWid... | StarcoderdataPython |
11324702 | from django.test import TestCase
from open.core.writeup.serializers import (
TextAlgorithmPromptSerializer,
WriteUpPromptCreateReadSerializer,
)
class WriteupPromptSerializerTests(TestCase):
def test_serializer_returns_invalid_on_empty_prompts(self):
data = {"prompt": "", "temperature": 1}
... | StarcoderdataPython |
9628546 | <filename>.local/lib/inhibiter/inhibiter.py<gh_stars>1-10
#!/usr/bin/env python3
# Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/li... | StarcoderdataPython |
11308858 | #!/usr/local/bin/python3
class CirQueue(object):
def __init__(self, size: int):
self.front = self.rear = 0
self.size = size
self.elements = [0] * self.size
print('Initiated.')
def __del__(self):
print('Destroy queue')
# def __len__(self):
def enqueue(self, value: int):
if (self.rear + 1) % self.size... | StarcoderdataPython |
6468814 | """Creo testing."""
from .fixtures import mk_creoson_post_dict, mk_getactivefile
import creopyson
def test_bom_get_paths_ok(mk_creoson_post_dict, mk_getactivefile):
"""Test bom_get_paths ok."""
c = creopyson.Client()
result = c.bom_get_paths(
file_="fakefile",
paths=True,
... | StarcoderdataPython |
1867302 | <filename>src/storage-blob-preview/azext_storage_blob_preview/_help.py<gh_stars>1-10
# coding=utf-8
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project ... | StarcoderdataPython |
5030526 | <reponame>zhuyuanxiang/Hanlp-Books-Examples<gh_stars>1-10
# -*- encoding: utf-8 -*-
"""
@Author : zYx.Tom
@Contact : <EMAIL>
@site : https://zhuyuanxiang.github.io
---------------------------
@Software : IDEA
@Project : Hanlp-Books-Examples
@File : NaiveDictionaryBasedSegmentatio... | StarcoderdataPython |
6499537 | import setuptools
setuptools.setup(
name="cex",
version="0.1.0",
url="https://github.com/KGerring/cex",
author="<NAME>",
author_email="<EMAIL>",
description="Python FCA Lattice Miner and Builder",
long_description=open('README.rst').read(),
packages=setuptools.find_packages(),
i... | StarcoderdataPython |
5074632 | # Definition for a binary tree node
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
# @param root, a tree node
# @return a boolean
def isValidBST(self, root):
return self.validate(root, float('-inf'), fl... | StarcoderdataPython |
5003123 | <filename>cm/app/api_v1/calculation_module.py
import os
import sys
import shutil
import configparser
import glob
import traceback
from datetime import datetime
#path = os.path.dirname(os.path.abspath(__file__))
SD = "my_calculation_module_directory"
path = os.path.dirname(os.path.abspath(__file__)).s... | StarcoderdataPython |
9706145 | <reponame>pedrocorreia49/floodlight
#! /usr/bin/python
import os
import sys
import subprocess
import json
import argparse
import io
import time
# manage the load balancer through the REST API
# Syntax:
# load_balancer --controller {IP:REST_PORT} --addVipPool --id {ID} --protocol {TCP} --address {IP} --lbMethod {WRR... | StarcoderdataPython |
6530849 | <filename>vhoops/external/x_tools.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import uuid
import hashlib
import datetime
import string
import json
from random import randint, choice
def strong_password():
characters = string.ascii_letters + string.digits + "_*!."
return "".join(choice(characters) for _ in ... | StarcoderdataPython |
1665617 | <gh_stars>10-100
# coding:utf-8
"""
@Time : 2021/6/2 下午4:57
@Author: chuwt
"""
from typing import (
List,
Dict,
Optional,
Any,
)
from blspy import G1Element, PrivateKey, G2Element, AugSchemeMPL
from chia.util.byte_types import hexstr_to_bytes
from chia.consensus.coinbase import create_puzzlehash_f... | StarcoderdataPython |
11315906 | import os
def get_default():
cfg = {}
cfg.update({
"z_dim": 32,
"nonlinearity": "relu",
"batch_size": 64,
"learning_rate": 0.0001,
"lam": 0.0,
"nr_resnet": 5,
"nr_logistic_mix": 10,
"nr_filters": 100,
"save_interval": 10,
"sample_r... | StarcoderdataPython |
6540277 | <filename>ingest/retraction_watch.py
import time
import boto3
import pandas as pd
import requests
from sqlalchemy import exc, func
from app import app, db
from models.journal import Journal
from models.usage import RetractionSummary, RetractionWatch
@app.cli.command("import_retraction_watch")
def import_retraction_... | StarcoderdataPython |
5144453 | <reponame>cclauss/VTK
from vtkmodules.vtkIOParallelXML import vtkXMLPartitionedDataSetCollectionWriter
from vtkmodules.vtkIOXML import vtkXMLPartitionedDataSetCollectionReader
from vtkmodules.vtkFiltersSources import vtkPartitionedDataSetCollectionSource
from vtk.test import Testing
from vtk.util.misc import vtkGetTem... | StarcoderdataPython |
1866685 | from django.shortcuts import render, redirect
from django.http import JsonResponse, HttpResponse
from django.contrib.auth import authenticate, login
from django.core.mail import send_mail
from django.contrib.auth import logout
from django.conf import settings
from django.contrib.auth.decorators import login_required
i... | StarcoderdataPython |
325740 | <filename>selenium_tests/selecting_elements.py<gh_stars>0
from selenium import webdriver #Libraries needed
from selenium.webdriver.common.keys import Keys #This gives you access to keys you so you can use things like the esc or return key. This is different to being able to type.
import time #Here we use this to delay ... | StarcoderdataPython |
6518382 | <filename>visual/draw_att.py
import pickle
import matplotlib.pyplot as plt
def load_pkl(path):
with open(path, 'rb') as f:
data = pickle.load(f)
return data
lines = [(1, 2), (2, 21), (3, 21), (4, 3), (5, 21), (6, 5), (7, 6),
(8, 7), (9, 21), (10, 9), (11, 10), (12, 11), (13, 1),
(... | StarcoderdataPython |
12835978 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
__version__ = "0.0.1"
__title__ = "Traceability" | StarcoderdataPython |
157271 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from numpy.testing import assert_allclose
try:
import matplotlib.pyplot as plt
HAS_PLT = True
except ImportError:
HAS_PLT = False
t... | StarcoderdataPython |
170784 | <filename>atropos/commands/trim/modifiers.py<gh_stars>0
# coding: utf-8
"""This module implements all the read modifications that atropos supports.
A modifier must be callable. It is implemented as a function if no parameters
need to be stored, and as a class with a __call__ method if there are parameters
(or statistic... | StarcoderdataPython |
6665457 | <reponame>Hoseung/pyRamAn
# coding: utf-8
# Draw merger tree using GalaxyMaker + ConsistenTree
#
#
# 2015. 12. 01
# Functionally OK.
# Looks ugly: displacement dx should be more adaptive.
#
# In[1]:
import tree.ctutils as ctu
def link_circle_up(x, y, r, ax, finish=0):
"""
Given two points,... | StarcoderdataPython |
3258549 | <reponame>AnthonyNing/stanCode101-Project
"""
File: extension.py
Name: <NAME>
--------------------------
This file collects more data from
https://www.ssa.gov/oact/babynames/decades/names2010s.html
https://www.ssa.gov/oact/babynames/decades/names2000s.html
https://www.ssa.gov/oact/babynames/decades/names1990s.html
Plea... | StarcoderdataPython |
274159 | <filename>guidelines_calligraphy.py
# Copyright (c) 2015 <NAME>
# Version 0.1
#------------------------------------------------------------
# FUNCTIONS
#------------------------------------------------------------
def draw_ruling(x,y):
spaceBetween = 1.5*cm #space between ruling lines
line((x, y), (x, y+xHe... | StarcoderdataPython |
8168403 | <reponame>YoushaaMurhij/VOTR_Inference<filename>VOTR/pcdet/models/dense_heads/anchor_head_template.py
import numpy as np
import torch
import torch.nn as nn
from ...utils import box_coder_utils, common_utils, loss_utils
from .target_assigner.anchor_generator import AnchorGenerator
from .target_assigner.atss_target_assi... | StarcoderdataPython |
174893 | # -*- coding: utf-8 -*-
"""DecisionTreeClassifier(Telco Dataset).ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1lSnAsYluPfeTR_sbPvf5qGcz1wBwhRNW
"""
import pandas as pd
import numpy as np
from google.colab import files
uploaded = files.upload()... | StarcoderdataPython |
398447 | <gh_stars>0
import os
import re
from datetime import datetime, timedelta
from django.conf import settings
from django.contrib.admin.models import CHANGE, LogEntry
from django.contrib.admin.options import get_content_type_for_model
from django.db import transaction
from django.utils.encoding import force_str
from djan... | StarcoderdataPython |
99189 | from pyxie.model.pynodes.values import ProfilePyNode
import pyxie.model.functions
def initialise_external_function_definitions():
# Inside <Servo.h>
function_calls = {
"Servo": {
"iterator": False,
"return_ctype": "Servo", # C type of the... | StarcoderdataPython |
4916780 | <filename>anonshot/gpp/admin.py
from django.contrib import admin
from gpp.models import Photo, Profil, Comments, Messages
admin.site.register(Photo)
admin.site.register(Profil)
admin.site.register(Comments)
admin.site.register(Messages)
| StarcoderdataPython |
3337251 | <reponame>KiLJ4EdeN/CV_PYTHON<gh_stars>1-10
import cv2
import numpy as np
img = cv2.imread('prof.jpeg', -1)
# cv2.WINDOW_AUTOSIZE is default
# but with this we can resize the window.
cv2.namedWindow('image', cv2.WINDOW_NORMAL)
cv2.imshow('image',img)
cv2.waitKey(0)
cv2.destroyAllWindows()
| StarcoderdataPython |
5129988 | <filename>src/linux/deb_pkg_deprecated/make-deb.py
# Copyright (c) 2012-2014 The CEF Python authors. All rights reserved.
# License: New BSD License.
# Website: http://code.google.com/p/cefpython/
"""
Create a Debian Package.
Required dependencies:
sudo apt-get install python-support
sudo apt-get install python-p... | StarcoderdataPython |
9644566 | <reponame>zhe-sun/dcos<gh_stars>0
import pytest
import pkgpanda.util
from pkgpanda import UserManagement
from pkgpanda.exceptions import ValidationError
def test_variant_variations():
assert pkgpanda.util.variant_str(None) == ''
assert pkgpanda.util.variant_str('test') == 'test'
assert pkgpanda.util.var... | StarcoderdataPython |
7320 | <gh_stars>0
#!/usr/bin/env python
# Copyright (c) 2016 Orange and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
... | StarcoderdataPython |
9709427 | import time
from aiy.board import Led
def led_on(board):
board.led.state = Led.ON
def led_off(board):
board.led.state = Led.OFF
def led_blink(board, duration = 1, times = 1):
for _ in range(times):
led_on(board)
time.sleep(duration)
led_off(board)
time.sleep(0.25)
| StarcoderdataPython |
1701276 | # -*- coding: utf-8 -*-
""" Sorting form aware widget"""
from eea.facetednavigation.widgets.sorting.widget import Widget
from eea.facetednavigation.widgets.sorting.interfaces import ISortingSchema
class ISortingFormAwareSchema(ISortingSchema):
""" """
class SortingFormAwareAbstractWidget(Widget):
""" Over... | StarcoderdataPython |
5014332 | # escreva um programa q leia um numero inteiro qualquer e peça
# para o usuario escolher qual sera a base de conversao
# binario, octal, hexadecimal
num = int(input("diga um numero inteiro"))
print("1 - binario")
print("2 - octal")
print("3 - hexadecimal")
entrada = int(input("escolha sua conversao"))
if entrada == 1... | StarcoderdataPython |
1926470 | <filename>base_site/alelo/migrations/0001_initial.py
# Generated by Django 2.2.6 on 2019-11-24 14:03
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [("mainapp", "0002_category_enable")]
operations = [
... | StarcoderdataPython |
8039045 | <reponame>generalov/spec-ibride<gh_stars>0
__author__ = 'lucky'
| StarcoderdataPython |
155843 | """
Copyright 2014 Rackspace
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 agreed to in writing, software
dist... | StarcoderdataPython |
3381200 | <filename>osf/ray_utils.py
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | StarcoderdataPython |
11372467 | <filename>speech/utils.py
import requests
import time
import cloudinary
import cloudinary.uploader
import cloudinary.api
from credentials import API_KEY, API_SECRET, CLOUD_NAME
import cloudconvert
api = cloudconvert.Api('<KEY>')
cloudinary.config(cloud_name=CLOUD_NAME, api_key=API_KEY, api_secret=API_SECRET)
"""
per... | StarcoderdataPython |
9748721 | from segmentation_rt.dl.dataloader.dataloader import DatasetPatch
from tests.dl.utils import TorchioTestCase
class TestDatasetPatch(TorchioTestCase):
def setUp(self):
super().setUp()
self.dataset_patch = DatasetPatch(self.dir, ["label"], patch_size=(5, 5, 5),
... | StarcoderdataPython |
3538326 | <reponame>jack-pappas/conda<gh_stars>1000+
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import absolute_import, division, print_function, unicode_literals
from functools import reduce as _reduce
from logging import getLogger
log = getLogger(__name_... | StarcoderdataPython |
8062696 | import math
from fractal import Range2D
def py_create_fractal(pix: Range2D, frac: Range2D, iterations, data):
x_scale = (frac.x2 - frac.x1) / (pix.x2 - pix.x1)
y_scale = (frac.y2 - frac.y1) / (pix.y2 - pix.y1)
colors = []
for n in range(iterations + 1):
# @Eriksonn referred to by OLC
... | StarcoderdataPython |
4804637 | from uuid import uuid4
from collections import OrderedDict
class Node:
def __init__(self, obj, rank=0, parent=None):
self.obj = obj
self.rank = rank
self.parent = parent or self
self.uid = str(uuid4())
def __repr__(self):
is_root = self is self.parent
return f... | StarcoderdataPython |
3428922 | <filename>src/behavior_monitor/MainWindow.py
#!/usr/bin/env python
import rospy
import cv2
import rospkg
import os
import math
from PyQt5 import QtCore, QtGui, QtWidgets
from behavior_monitor.TempWindow import Ui_TempWindow
from behavior_monitor.subContainer import subContainer
class MonitorWindow(Ui_TempWindow):
... | StarcoderdataPython |
263534 | <reponame>Scottpedia/seafdav
# -*- coding: utf-8 -*-
# (c) 2009-2020 <NAME> and contributors; see WsgiDAV https://github.com/mar10/wsgidav
# Original PyFileServer (c) 2005 <NAME>.
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license.php
from wsgidav import compat, util
from wsgidav.lock_ma... | StarcoderdataPython |
5106930 | <gh_stars>0
from test_plus.test import TestCase
from .factories import *
from ..models import Task
from ..models import Plan
class TestTask(TestCase):
def setUp(self):
#self.plan = Plan.objects.create(name="my Plan")
#self.task = Task.objects.create(description="my Task",plan=self.plan)
se... | StarcoderdataPython |
12825876 | from typing import Dict, Any, Optional
import abc
from magic_config.interfaces import AbstractSettingField, AbstractLoader, AbstractSettingsManager
from magic_config.utils import NULL
_FIELDS_REGISTRY = '_fields_registry'
class BaseSettingsManagerMeta(abc.ABCMeta):
"""
metaclass for settings manager. sets... | StarcoderdataPython |
3295278 | <gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 28 16:04:28 2021
@author: vamsi
"""
import os
import sys
import numpy as np
import pandas as pd
# import matplotlib
# matplotlib.use('Agg')}
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from scipy.stats import... | StarcoderdataPython |
5151631 | # src dest weight
edges = '''
1 2 2
1 3 3
1 5 3
2 3 2
2 4 4
3 4 1
3 5 2
4 6 3
5 6 1
'''
capacity = {1:1, 2:3, 6:-4}
# capacity is a dict using {node:capacity}.
# If not specified, defaults to 0
from network import solver
solver(edges, capacity, plot=True, verbose=False) | StarcoderdataPython |
55940 | # encoding: UTF-8
"""
定时服务,可无人值守运行,实现每日自动下载更新历史行情数据到数据库中。
"""
from DataService.tushareData import *
from datetime import datetime
if __name__ == '__main__':
taskCompletedDate = None
# 生成一个随机的任务下载时间,用于避免所有用户在同一时间访问数据服务器
taskTime = datetime.now().replace(hour=17, minute=30, second=0)
# 进入主循环
... | StarcoderdataPython |
3218323 | <filename>setup.py
# -*- coding: utf-8 -*-
from __future__ import print_function
from io import open
from setuptools import setup, find_packages
try:
from distutils.command.build_py import build_py_2to3 as build_py
except ImportError:
from distutils.command.build_py import build_py
setup(
name='CommonCrawl... | StarcoderdataPython |
3569209 | from flyai.train_helper import submit, upload_data, download, sava_train_model
"""""""""""""""""""""""""""
" 提交训练 "
"""""""""""""""""""""""""""
# train_name: 提交训练的名字,推荐使用英文,不要带特殊字符
# code_path: 提交训练的代码位置,不写就是当前代码目录,也可以上传zip文件
# cmd: 在服务器上要执行的命令,多个命令可以用 && 拼接
# 如:pip install -i https://pypi.flyai.com/si... | StarcoderdataPython |
12807107 | """
desispec.io.frame
=================
I/O routines for Frame objects
"""
import os.path
import time
import numpy as np
import scipy, scipy.sparse
from astropy.io import fits
from astropy.table import Table
import warnings
from desiutil.depend import add_dependencies
from desiutil.log import get_logger
from ..fram... | StarcoderdataPython |
11340939 | from __future__ import absolute_import
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Ver... | StarcoderdataPython |
12829521 | <reponame>SleepNoMore/CodingBat
'''
The number 6 is a truly great number.
Given two int values, a and b, return True if either one is 6.
Or if their sum or difference is 6.
'''
def love6(a, b):
return a == 6 or b == 6 or a + b == 6 or abs(a - b) == 6
# love6(6, 4) → True
# love6(4, 5) → False
# love6(1, 5) → Tru... | StarcoderdataPython |
9692374 | from frame_list import FrameList
class Video:
"""Encapsulates a video and its frames."""
def __init__(self, filename):
"""
Args:
filename: The video's filename.
"""
self.filename = filename
self.frames = FrameList(self)
self.__start = 0
def __l... | StarcoderdataPython |
11250869 | <filename>tensorforce/tests/test_ddpg_agent.py
# Copyright 2017 reinforce.io. 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/LICEN... | StarcoderdataPython |
1614142 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 5 16:26:43 2019
@author: kazuki.onodera
"""
import numpy as np
import pandas as pd
import gc, os
from glob import glob
from multiprocessing import cpu_count, Pool
import utils
PREF = 'f005'
funcs = ['min', 'mean', 'max', 'std', 'skew']
num_agg ... | StarcoderdataPython |
8134198 | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# 详细的配置文件
AUTHOR = u'<NAME>'
SITENAME = 'PingBook Blog'
SITESUBTITLE ='import __hello__ import this'
SITEURL = 'https://pingbook.top'
SITE_THUMBNAIL = '/static/images/profile.jpg'
SITE_THUMBNAIL_TEXT = 'Might come with a beard'
# ... | StarcoderdataPython |
1918822 | #!/usr/bin/env python3
from time import sleep, time
from datetime import datetime
from math import pi, sqrt
import pyaudio
import numpy as np
import concurrent.futures
from flystim.stim_server import launch_stim_server
from flystim.screen import Screen
from flystim.trajectory import Trajectory
from multi_sensory_t... | StarcoderdataPython |
3243676 | from du.ctee.transformers.BaseTransformer import BaseTransformer
class PasstroughTransformer(BaseTransformer):
def __init__(self):
BaseTransformer.__init__(self)
def transform(self, line, style):
return line
| StarcoderdataPython |
4961763 | <reponame>segfaultmagnet/squirtlebot<gh_stars>1-10
__author__ = '<NAME>'
__copyright__ = 'Copyright 2017, <NAME>'
__license__ = 'Beer-Ware License Rev. 42'
__maintainer__ = '<NAME>'
__email__ = '<EMAIL>'
__website__ = 'https://github.com/segfaultmagnet/squirtlebot'
__credits__ = ['<NAME>']
__version_... | StarcoderdataPython |
3508699 | <gh_stars>1-10
import sys
import os
import subprocess
import re
import pathlib
import pytest
import tomlkit
here = os.path.dirname(os.path.realpath(__file__))
repo_dir = pathlib.Path(f"{here}/../").resolve()
dist_dir = pathlib.Path(f"{repo_dir}/dist").resolve()
build_file_re = re.compile(r"^\s*- Built (.*)\s*$", fla... | StarcoderdataPython |
6540699 | """Scrap (but sometimes useable) code that doesn't yet have a proper home
List repositories for a given user or organization, along with 78 fields of info.
>>> from hubcap.scrap import repos_info, actions_info
>>>
>>> repos = repos_info('i2mint') # doctest: +SKIP
>>> print(repos.shape) # doctest: +SKIP
(60, 78)
>>... | StarcoderdataPython |
11303839 | # hf-experiments
# @author <NAME> (<EMAIL> at g<EMAIL> dot <EMAIL>)
# Copyright (c) 2021 <NAME> (<EMAIL> at <EMAIL> dot <EMAIL>)
import os
import spacy,re,json
from spacy.tokens import Doc
from skweak import heuristics, gazetteers, aggregation, utils
def get_entities(doc: Doc, layer=None):
"""write the entities a... | StarcoderdataPython |
5143276 | #!/usr/bin/env python
import argparse
import binascii
import datetime
import gzip
import json
import magic
import os
import pymongo
import sys
def read_gzip(filename):
with gzip.open(filename) as file:
content = file.read()
return content
def read_plain(filename):
with open(filename) as file:
... | StarcoderdataPython |
6476661 | from __future__ import with_statement
import select
import sys,os,re,time
import threading
import datetime
import subprocess as subp
sys.path[0]=''
sys.path.append(os.path.abspath('/home/myuser/CASE'))
from connect import sock
PORT = 6501
SELECT_SEC=1
client=sock.client(PORT)
# sys.stdout.flush()
# search for las... | StarcoderdataPython |
8111105 | #!/usr/bin/env python
"""Unit tests for serialisation of authorisation service requests.
NERC DataGrid Project
"""
from ndg.xacml.test.context import AnyUriAttributeValue
__author__ = "<NAME>"
__date__ = "18/01/12"
__copyright__ = "(C) 2012 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE fi... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.