id stringlengths 1 7 | text stringlengths 6 1.03M | dataset_id stringclasses 1
value |
|---|---|---|
67136 | <reponame>jbronikowski/genielibs
""" File utils base class for SCP on JunOS devices. """
from ..fileutils import FileUtils as FileUtilsJunOSBase
class FileUtils(FileUtilsJunOSBase):
pass | StarcoderdataPython |
3394448 | <filename>linear-networks/image-classification-dataset.py
import torch
import torchvision
from torch.utils import data
from torchvision import transforms
from d2l import torch as d2l
d2l.use_svg_display()
trans = transforms.ToTensor()
mnist_train = torchvision.datasets.FashionMNIST(root="../data", train=True,
... | StarcoderdataPython |
37247 | <gh_stars>0
#!/usr/bin/env python3
import cgi, os
import shutil
from userlogger import UserLogger
import templates
import mimetypes
from stat import S_IEXEC
def getUnusedName(file):
if not os.path.exists(file):
return file
basepath, basename = os.path.split(file)
p = basename.rfind('.')
exte... | StarcoderdataPython |
3315648 | <gh_stars>1-10
import requests
class DeviceTracker ():
def __init__(self,ip_url):
self.ip_url = ip_url
def get_json_data(self):
device_req = requests.get(url = self.ip_url)
if device_req.status_code == 200:
device_json = device_req.json()
else:
... | StarcoderdataPython |
120219 | import nibabel as nib
import numpy as np
import pdb
# library: http://nipy.org/nibabel/gettingstarted.html
data_folder = '/ihome/azhu/cs189/data/liverScans/Training Batch 2/'
num_examples_min = 28
num_examples_max = 130
def nifti_to_nparray(filename):
img = nib.load(filename)
data = img.get_data()
retur... | StarcoderdataPython |
1621455 | '''
## Problem 🤔
You are given an array of k linked-lists lists, each linked-list is sorted in ascending order.
Merge all the linked-lists into one sorted linked-list and return it.
**Example 1**
`Input: lists = [[1,4,5],[1,3,4],[2,6]]`
`Output: [1,1,2,3,4,4,5,6]`
_Explanation_
The linked-lists are:
```
[
1->4->5... | StarcoderdataPython |
4839594 | <reponame>purcell-lab/HomeAssistant-OctopusEnergy
from datetime import timedelta
import logging
from homeassistant.util.dt import (utcnow, now, as_utc, parse_datetime)
from homeassistant.helpers.update_coordinator import (
CoordinatorEntity
)
from homeassistant.components.sensor import (
DEVICE_CLASS_MONETARY,
... | StarcoderdataPython |
101160 | import json
import tweepy
with open("json/bots.json", "r") as bots:
default_bot = json.load(bots)["Default"]
auth = tweepy.OAuthHandler(default_bot["consumer_key"], default_bot["consumer_secret"])
auth.set_access_token(default_bot["access_token"], default_bot["access_token_secret"])
api = tweepy.API... | StarcoderdataPython |
3305873 | # coding=utf-8
from setuptools import setup, find_packages
setup(
name='PrefectDecorator',
version='0.0.3',
description='Some convenient decorators.',
author='RankoHata',
author_email='<EMAIL>',
maintainer='RankoHata',
maintainer_email='<EMAIL>',
license='MIT License',
packages = f... | StarcoderdataPython |
31886 | <reponame>troybots/omnibot
from omnibot import logging
from omnibot.services import stats
from omnibot.services import slack
from omnibot.services.slack import parser
logger = logging.getLogger(__name__)
class Message(object):
"""
Class for representing a parsed slack message.
"""
def __init__(self,... | StarcoderdataPython |
140863 | import FWCore.ParameterSet.Config as cms
#Tracks without extra and hits
#AOD content
RecoTrackerAOD = cms.PSet(
outputCommands = cms.untracked.vstring(
'keep recoTracks_ctfWithMaterialTracksP5_*_*',
'keep recoTracks_ctfWithMaterialTracksP5LHCNavigation_*_*',
'keep recoTracks_rsWithMaterialTracksP5... | StarcoderdataPython |
108144 | from __future__ import print_function
import FWCore.ParameterSet.Config as cms
import copy
process = cms.Process("zpdfsys")
process.maxEvents = cms.untracked.PSet(
#input = cms.untracked.int32(-1)
input = cms.untracked.int32(-1)
)
## process.source = cms.Source("PoolSource",
## debugVerbosity = cms.untr... | StarcoderdataPython |
82938 | # -*- coding: utf-8 -*-
from unittest import TestCase
from mock import MagicMock
from pika.adapters import SelectConnection
from pika.channel import Channel
from pika.exceptions import AMQPChannelError, AMQPConnectionError
from pika.spec import Basic, BasicProperties
from rabbitleap.consumer import Consumer
from rabb... | StarcoderdataPython |
3272930 | import win32com.client # required for win32 users
import Downloaders.MTS, Downloaders.URL
import Installer.Sims2Pack, Installer.Inteen, Installer.Sims3Pack
SM.Temp = "out" # usually not used
SM.Handlers["ModTheSims"] = Downloaders.MTS.Downloader
SM.Handlers["url"] = Downloaders.URL.Downloader
SM.Fogs = ["samples/inteen... | StarcoderdataPython |
3239657 | # communication with the DeLight wallet
# to read atm devault wallet and send bought amount to client
# for readability I define commands for os as a string
# before calling
import os
import json
import config as c
def start_daemon():
print('Starting daemon.')
cmd = 'DeLight/delight daemon start'
os.syste... | StarcoderdataPython |
3338703 | from __future__ import print_function
import sys
import os
import copy
# import time
import unittest
import logging
# import numpy as np
import torch
# import torch.nn as nn
# from torch.nn import Parameter
# import torch.nn.functional as F
# import torch_mlu
import torch_mlu.core.mlu_model as ct
cur_dir = os.path.d... | StarcoderdataPython |
1792107 |
from owl_model.modelobject import ModelObject
class Game(ModelObject):
"""
An OWL game
A match in OWL is a best-of-X competition where two teams play X games and
the winner of the match is considered to be the team winning the majority of
the games.
"""
cls_attr_types = {
'id': '... | StarcoderdataPython |
3295597 | <gh_stars>1-10
# -*- coding: utf-8 -*-
# Copyright (c) 2020-2021 tecnovert
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
import json
import urllib.parse
from .util import (
toBool,
)
from .basicswap_util import (
strBi... | StarcoderdataPython |
1792968 | <reponame>alanshenpku/LeetCode<gh_stars>1-10
# Time: O(n^0.25 * logn)
# Space: O(logn)
# Let's say a positive integer is a superpalindrome
# if it is a palindrome, and it is also the square of a palindrome.
#
# Now, given two positive integers L and R (represented as strings),
# return the number of superpalindromes ... | StarcoderdataPython |
52342 | #!/usr/bin/env python
# Author: by <NAME> on March 15, 2020
# Date: March 15, 2020
from matplotlib import pyplot
from pydoc import pager
from time import sleep
import argparse
import datetime as dt
import json
import matplotlib
import pandas as pd
import requests
import seaborn
import sys
import yaml
def main():
... | StarcoderdataPython |
1788569 | <reponame>yuchen352416/leetcode-example
#!/usr/bin/python3
from lib.ListLibraries import ListNode, ListNodeInitialize
class Solution:
def deleteNode(self, node: ListNode):
"""
:type node: ListNode
:rtype: void Do not return anything, modify node in-place instead.
"""
node.... | StarcoderdataPython |
1658680 | # Generated by Django 3.2.5 on 2021-07-25 21:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('products', '0002_product_image'),
('categories', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='cate... | StarcoderdataPython |
3205901 | import unittest
from stability_label_algorithm.modules.argumentation.argumentation_theory.argumentation_theory import ArgumentationTheory
from stability_label_algorithm.modules.dataset_generator.argumentation_system_generator.layered.\
layered_argumentation_system_generator import LayeredArgumentationSystemGenerat... | StarcoderdataPython |
4813408 | <filename>SuperFlow.py
from Packet import *
import socket
import Flow
#get median of interarrival time
def getMedian(vallist):
vallist.sort(key = lambda val:val[0])
tot = 0
cfreq = []
for val in vallist:
tot += val[1]
cfreq.append(tot)
medianindex = tot / 2
i = 0
while medianindex > cfreq[i]:
i += 1
retu... | StarcoderdataPython |
3295931 | # Licensed to the StackStorm, Inc ('StackStorm') 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, Version 2.0
# (the "License"); you may not use th... | StarcoderdataPython |
1700131 | from fastapi import APIRouter
from app.models.ready import ReadyResponse
router = APIRouter()
@router.get("/ready", response_model=ReadyResponse)
async def readiness_check():
return ReadyResponse(status="ok")
| StarcoderdataPython |
3232568 | <filename>source/bot_commands.py<gh_stars>1-10
import discord
import requests
import json
import os
from dotenv import load_dotenv
from source.utils import putTableAll, putTableLong, putFixtures, fetchJSON, putMatches
from source.league_code import LEAGUE_CODE
from source.team_id import TEAM_ID
from source.exceptions ... | StarcoderdataPython |
165198 | import random
from collections import deque
from typing import Any
from srl.base.rl.base import RLRemoteMemory
class ExperienceReplayBuffer(RLRemoteMemory):
def __init__(self, *args):
super().__init__(*args)
def init(self, capacity: int):
self.memory = deque(maxlen=capacity)
def length(... | StarcoderdataPython |
11518 | # -*- coding: utf-8 -*-
"""Implicitly reference attributes of an object."""
from ast import Name, Assign, Load, Call, Lambda, With, Str, arg, \
Attribute, Subscript, Store, Del
from macropy.core.quotes import macros, q, u, name, ast_literal
from macropy.core.hquotes import macros, hq
from macropy.core... | StarcoderdataPython |
1726786 | class VehicleUpdate:
def __init__(self, id, x, y, durability, remaining_attack_cooldown_ticks, selected, groups):
self.id = id
self.x = x
self.y = y
self.durability = durability
self.remaining_attack_cooldown_ticks = remaining_attack_cooldown_ticks
self.selected = sel... | StarcoderdataPython |
1614136 | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2016-present MagicStack Inc. and the EdgeDB 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... | StarcoderdataPython |
119206 | <filename>DigiroadPreDataAnalysis/digiroad/util/__init__.py
import configparser
import csv
import datetime
import json
import logging
import logging.config
import numpy
import os
import shutil
import time
import zipfile
from digiroad import carRoutingExceptions as exc
from digiroad.entities import Point
from pandas.i... | StarcoderdataPython |
3370212 | from itertools import chain
from django import forms
from django.contrib.auth import authenticate
from django.contrib.auth.models import User
from django.forms import widgets
from django.forms.models import ModelChoiceIterator
from django.template import Template, Context
from django.utils.encoding import force_unicod... | StarcoderdataPython |
3268780 | # Module: objects
# Date: 20th December 2014
# Author: <NAME>, prologic at shortcircuit dot net dot au
"""Objects Module
Implements core objects used to store data
"""
from os import geteuid
from pwd import getpwuid
from textwrap import fill
from .utils import normalize
from . import __name__, __version_... | StarcoderdataPython |
3378405 | <filename>setup.py
#!/usr/bin/python
import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='pyaig',
version='1.0.13',
license='MIT',
author=u'<NAME>',
author_email='<EMAIL>',
url='http://github.com/sterin/p... | StarcoderdataPython |
167969 | from django.conf import settings
from django.db.models.loading import get_model
def get_profile_model():
"""
Returns configured user profile model or None if not found
"""
user_profile_module = getattr(settings, 'USER_PROFILE_MODULE', None)
if user_profile_module:
app_label, model_name = u... | StarcoderdataPython |
4812508 | <filename>flute/protocol.py
import asyncio
from logging import Logger, DEBUG
import datetime
from httptools import HttpRequestParser, parse_url
from werkzeug.routing import NotFound, RequestRedirect, MethodNotAllowed
from statics import HTTP_STATUS_CODES
__all__ = ['FluteHttpProtocol']
class Response(object):
... | StarcoderdataPython |
147441 | import abc
from lbann import optimizers_pb2
import lbann.core.util
class Optimizer(abc.ABC):
"""Optimization algorithm for a neural network's parameters."""
def export_proto(self):
"""Construct and return a protobuf message."""
return optimizers_pb2.Optimizer()
# Generate Optimizer sub-classes... | StarcoderdataPython |
1719897 | <reponame>jbyu/HorizonNet
#!/usr/bin/env python
from .naive import grid_sample as naive
from .faster import grid_sample as faster
__all__ = [
"faster",
"naive",
]
| StarcoderdataPython |
4806829 | from pathlib import Path
import multiprocessing
import contextlib
from tqdm.autonotebook import tqdm
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from scipy.spatial.distance import hamming
from Bio import pairwise2, SeqIO
data_path = Path("../data/Protera")
def compute_diversity(seq1, seq... | StarcoderdataPython |
3388783 | import requests
import pytest
from neptune.neptune_api import NeptuneService
from neptune.tests.conftest import get_server_addr
@pytest.mark.fpgas(1)
def test_coco(request):
"""
Check the coco service from Neptune with a known image
Args:
request (fixture): get the cmdline options
"""
ser... | StarcoderdataPython |
1657878 | import heapq
global list_of_popularity
global list_of_filesID
list_of_popularity = [0] * 100
list_of_cost = [0] * 100
list_of_filesID = []
list_of_size = []
list_of_k_value = []
k_parameter = 0.002
counter = 0
total_cost=0
demand_counter=0
k_value=7
previous_total_cost = 1
positive_negative = True
cache_not_used_enoug... | StarcoderdataPython |
61226 | import pandas as pd
def lookup_dates(s):
"""
This is an extremely fast approach to datetime parsing.
For large data, the same dates are often repeated. Rather than
re-parse these, we store all unique dates, parse them, and
use a lookup to convert all dates.
"""
dates_dict = {date:pd.to_date... | StarcoderdataPython |
9609 | from abc import (
abstractmethod,
)
from typing import (
Any,
Callable,
cast,
FrozenSet,
Generic,
Type,
TypeVar,
)
from cancel_token import (
CancelToken,
)
from p2p.exceptions import (
PeerConnectionLost,
)
from p2p.kademlia import Node
from p2p.peer import (
BasePeer,
... | StarcoderdataPython |
179510 | <reponame>renauddahou/appointment_bot
from bs4 import BeautifulSoup
import re
import time
import telegram_message
def open_day(driver):
open_days_list = []
soup_level = BeautifulSoup(driver.page_source, 'html.parser')
month = soup_level.find_all('tbody') #, attrs = {'class':'fc-week fc-firs... | StarcoderdataPython |
1669913 | # Copyright (c) 2020 PaddlePaddle 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 appli... | StarcoderdataPython |
134350 |
__all__ = [ 'XDict' ]
class XDict(dict):
__slots__ = ()
__setattr__ = dict.__setitem__
__delattr__ = dict.__delitem__
__getitem__ = dict.get
__getattr__ = dict.get
__getnewargs__ = lambda self: getattr(dict,self).__getnewargs__(self)
__repr__ = lambda self: '<XDict %s>' % dict.__repr__(sel... | StarcoderdataPython |
1799501 | <reponame>kishima/RaspiMusicServer
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import time
import subprocess
import re
from pykakasi import kakasi
from arduino_timer import Yukkuri
import grove_gesture_sensor
import ap_music
import ap_music_server_conf
MENU_IDLE = 0
MENU_PLAYING = 1
MENU_ONMENU ... | StarcoderdataPython |
3203348 | <reponame>KamilPiechowiak/iatransfer<filename>iatransfer/utils/file_utils.py
import json
def read_contents(filename: str, encoding: str = 'utf-8') -> str:
with open(filename, 'r', encoding=encoding) as file:
return file.read()
def read_json(filename: str) -> dict:
with open(filename) as json_file:
... | StarcoderdataPython |
3354360 | # Copyright 2018 The OpenEBS Authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writ... | StarcoderdataPython |
3395738 | """
Prototype Design pattern
- Needed when creating several similar objects.
- Maybe when the cost of creating an object from scratch is large
- Create a Prototype intstance then clone it whenever needed
"""
import copy
class Prototype:
"""Protoype classs to register and clone objects"""
def __init__(... | StarcoderdataPython |
1610439 | <gh_stars>0
class BeansException(Exception):
pass
class EncodingException(BeansException):
pass
class DecodingException(BeansException):
pass
| StarcoderdataPython |
3351669 | <reponame>dmonn/socialize
import os
def create_token_file(token):
try:
home_directory = os.path.expanduser('~')
file = open(os.path.join(home_directory, ".AUTHTOKEN"), 'w')
file.write(token['token'])
file.close()
return(200)
except:
print('Something went wrong!'... | StarcoderdataPython |
45031 | ''' An example of playing randomly in RLCard
'''
import argparse
import pprint
import rlcard
from rlcard.agents import RandomAgent
from rlcard.utils import set_seed
def run(args):
# Make environment
env = rlcard.make(args.env, config={'seed': 42})
# Seed numpy, torch, random
set_seed(42)
# Set a... | StarcoderdataPython |
1766630 | <reponame>alexander-sidorov/qap-05
from typing import Any
from hw.alexander_sidorov.common import validate
from .task12 import task_12
def test_task_12() -> None:
args: Any
args = (1, 2)
validate(
task_12,
*args,
expected_data={1: 2},
)
args = "ab"
validate(
... | StarcoderdataPython |
4819553 | <reponame>ericmjl/mbtools
"""
Author: <NAME>
Purpose: A module that defines functions for doing PCR.
"""
from Levenshtein import distance
from difflib import SequenceMatcher
from Bio.Seq import Seq
import math
import numpy as np
def alignment_indices(template, primer):
"""
Finds the optimal alignment betwee... | StarcoderdataPython |
3332711 | """
PCR会战管理命令 v2
猴子也会用的会战管理
命令设计遵循以下原则:
- 中文:降低学习成本
- 唯一:There should be one-- and preferably only one --obvious way to do it.
- 耐草:参数不规范时尽量执行
"""
import os
from datetime import datetime, timedelta
from typing import List
from matplotlib import pyplot as plt
try:
import ujson as json
except:
import json
fro... | StarcoderdataPython |
183040 | BBBB BBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBB
BB BBBBBBBBBBBBBBBBBB
BB BBBBBBBBBBBBBBBB
BBBBBBB BBBBBBBBBBBBBBBBBBBBBBB
BBBBB
BBB BBBBB BB BBBB
BBBBBBB BBBBBBBBBBBBBB
BBBBBB
BBBBBBBBBBBBBBBBBBB
| StarcoderdataPython |
3300177 | """
FIT1008 Prac 3 Task 3
@purpose Summing items until a negative number is reached, for Task 3
@author <NAME> 25461257
@modified 20140810
@created 20140807
"""
import time, random
def sum_until_negative(a_list):
"""
@purpose Summing items in a list, stops as soon as a negative number is reached.
I... | StarcoderdataPython |
1765448 | from nose.tools import * # flake8: noqa
from tests.base import AdminTestCase
from admin.base.forms import GuidForm
class TestGuidForm(AdminTestCase):
def setUp(self):
super(TestGuidForm, self).setUp()
def test_valid_data(self):
guid = '12345'
form = GuidForm({
'guid': g... | StarcoderdataPython |
178477 | <filename>omnilingual/features/__init__.py<gh_stars>0
from .universal import *
| StarcoderdataPython |
1680538 | # Copyright 2017-present Open Networking Foundation
#
# 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 agr... | StarcoderdataPython |
165050 | <filename>radical/utils/logger/filehandler.py
__author__ = "Radical.Utils Development Team (<NAME>, <NAME>)"
__copyright__ = "Copyright 2013, RADICAL@Rutgers"
__license__ = "MIT"
''' Provides a file handler for the logging system.
'''
from logging import DEBUG, getLogger, Filter, FileHandler as LFileHandler
... | StarcoderdataPython |
1620345 | <reponame>WangXin93/mmpose
import torch
import torch.nn as nn
from ..registry import LOSSES
@LOSSES.register_module()
class CELoss(nn.Module):
""" Cross Entorpy Loss Wrapper
Args:
loss_weight (float): Weight of the loss. Default: 1.0.
"""
def __init__(self, loss_weight=1.):
super().... | StarcoderdataPython |
3336827 | <filename>greenlet_stackless/greenstackless.py
#! /usr/bin/python2.5
assert 0, 'see ../syncless/greenstackless.py instead'
| StarcoderdataPython |
14621 | <filename>mayan/apps/rest_api/classes.py
from collections import namedtuple
import io
import json
from furl import furl
from django.core.handlers.wsgi import WSGIRequest
from django.http.request import QueryDict
from django.template import Variable, VariableDoesNotExist
from django.test.client import MULTIPART_CONTEN... | StarcoderdataPython |
3317337 | <filename>script.py
class script(object):
START_MSG = """ Hey {}
നീ ഏതാ മോനൂസെ എന്നെ [𝗖𝗜𝗡𝗘𝗠𝗔 𝗖𝗢𝗠𝗣𝗔𝗡𝗬](https://t.me/cinimacompany123)ഗ്രൂപ്പിലേക്ക് മാത്രമേ ഉപയോഗിക്കാൻ പറ്റൂ...
വെറുതെ സമയം കളയാൻ നിൽക്കണ്ട...വേഗം ഗ്രൂപ്പിലേക്ക് വിട്ടോ സിനിമ അവിടെ കിട്ടും...🤭"""
HELP_MSG = "ഇപ്പോഴും ഇപ്പോഴും പറയാ... | StarcoderdataPython |
3370676 | # Aprimore o ex093 para que ele funcione com vários jogadores, incluindo um sistema de visualização de detalhes do
# aproveitamento de cada jogador
from time import sleep
jogadores = list()
jogador = dict()
gols = list()
total = 0
while True:
jogador['jogador'] = str(input('Nome do jogador: ')).title().strip()
... | StarcoderdataPython |
3383110 | <reponame>dana/python-message-match
import pytest
import sys
sys.path.append('..')
sys.path.append('.')
from message_match import mmatch # noqa: E402
# not nested
def test_simplest_possible():
assert mmatch({'a': 'b'}, {'a': 'b'})
def test_extra_stuff():
assert mmatch({'a': 'b', 'c': 'd'}, {'a': 'b'})
de... | StarcoderdataPython |
3251653 | # PC: Pre-commit
## PC0xx: pre-commit-hooks
from __future__ import annotations
import functools
from importlib.abc import Traversable
from typing import Any
import yaml
@functools.cache
def precommit(package: Traversable) -> dict[str, Any]:
precommit_path = package.joinpath(".pre-commit-config.yaml")
if pr... | StarcoderdataPython |
3305437 | <filename>src/python/phyre/eval_task_complexity.py
# Copyright (c) Facebook, Inc. and its affiliates.
#
# 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/LI... | StarcoderdataPython |
1719746 | """
Script to convert Qualtrics results to more manageable format.
Author: XXXXX
Usage: python convert_data.py
Required files:
- writtendescriptions.csv
- list_mapping.csv
Generates:
- written_annotations.json
- written_plain.txt
- duration_stats.json
"""
# Stdlib
import csv
import json
import os
from collections i... | StarcoderdataPython |
1687932 | <gh_stars>0
from gevent import monkey; monkey.patch_all()
import gc
import os
import sys
import json
import time
import code
import socket
import inspect
import logging
import msgpack
import cStringIO
import urlparse
import argparse
import resource
import traceback
import threading
from ast import literal_eval
import... | StarcoderdataPython |
1751847 | # python2 and python3 compatible
class EfuseClass:
""" A class for parsing efuses """
normal = ('lot','wafer','assembly','part','comment','flowcell','y' ,'x' ,'bin','noise','softbin','chiptype','barcode')
codes = ('L:' ,'W:' ,'J:' ,'P:' ,'C:' ,'F:' ,'Y:','X:','B:' ,'N:' ,'SB:', 'CT:',... | StarcoderdataPython |
125297 | #
# python_grabber
#
# Authors:
# <NAME> <<EMAIL>>
#
# Copyright (C) 2019 <NAME>
#
# 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 rig... | StarcoderdataPython |
3282780 | import time
import hiro # type: ignore
from starlette.applications import Starlette
from starlette.requests import Request
from starlette.responses import PlainTextResponse
from starlette.routing import Route
from starlette.testclient import TestClient
from slowapi.util import get_ipaddr, get_remote_address
from tes... | StarcoderdataPython |
4801083 | <reponame>maxest/MaxestFramework
import torch
import numpy as np
from torch.autograd import Variable
import torch_layers_dumper
torch.backends.cudnn.deterministic = True
torch.manual_seed(42)
torch.cuda.manual_seed(42)
np.random.seed(42)
layer1 = torch.nn.Linear(1, 24, True)
layer2 = torch.nn.Linear(24... | StarcoderdataPython |
124860 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time : 2022/1/8 8:01 下午
# @Author: zhoumengjie
# @File : BondBuilder.py
class BondPage:
def __init__(self):
# 申购评测
self.apply_bonds = []
# 证监会核准/同意注册
self.next_bonds = []
# 已申购完,即将上市的
self.ipo_bonds = []
# 隔日... | StarcoderdataPython |
3304713 | #!/usr/bin/python3
import os
import json
import sys
import pandas as pd
import plotly.express as px
# Need this line so Atom can run it :grrrff
os.chdir('/home/andres/Programs/python/covid/app/visualizations')
from urllib.request import urlopen
# with urlopen('https://github.com/datasets/geo-countries/blob/master/data/... | StarcoderdataPython |
186827 | from zipfile import ZipFile
# from skimage.io import imread
import os
import numpy as np
import pandas as pd
from PIL import Image
from pathlib import Path
from data_layer.util import image_path
# from data_layer.dataset import CovidMetadata
# DEFAULT_BASE_PATH = 'C:/Covid-Screening/data_layer/raw_data'
DEFAULT_BAS... | StarcoderdataPython |
97975 | <reponame>kishankj/python
def is_isogram(string):
pass
| StarcoderdataPython |
3370369 | <gh_stars>0
import sublime, sublime_plugin
import time
import datetime
def log_error(ex, command):
error_msg = 'Error in ' + command + ': ' + str(ex)
print error_msg
sublime.status_message(error_msg)
class SubliMapCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.edit = edit
... | StarcoderdataPython |
1789506 | <reponame>JingweiZuo/SMATE<gh_stars>10-100
import logging
import sys
from datetime import datetime
import os
#import tensorflow as tf
#os.environ['TF_CPP_MIN_LOG_LEVEL'] = '0'
#logging.getLogger("tensorflow").setLevel(logging.INFO)
##
# Try not to initialize many loggers at the same run
# def init_logging(log_file='')... | StarcoderdataPython |
3316941 | from django.db import models
from apps.Habitacion.models import Habitacion
from apps.Cliente.models import Cliente
from apps.Registrador.models import Registrador
class Estado (models.Model):
idEstado=models.CharField(primary_key=True,max_length=100)
nombre=models.CharField(max_length=100)
class Alquiler (model... | StarcoderdataPython |
3351717 | <reponame>changsuchoi/cspy<filename>swarp-register.py
from astropy.io import ascii
from astropy.io import fits
import astropy.units as u
import astropy.coordinates as coord
from astropy.table import Table, Column
from astropy.time import Time
from pyraf import iraf
import os, sys
import numpy as np
import matplotlib.py... | StarcoderdataPython |
3260826 | <filename>config/settings/local.py<gh_stars>0
from .base import * # noqa
from .base import env
# GENERAL
DEBUG = True
SECRET_KEY = env(
"DJANGO_SECRET_KEY",
default="<KEY>",
)
ALLOWED_HOSTS = ["localhost", "0.0.0.0", "127.0.0.1"]
# CACHES
CACHES = {
"default": {
"BACKEND": "django.core.cache.b... | StarcoderdataPython |
114512 | import asyncio
def main():
loop = asyncio.get_event_loop()
# Initialize components
hisayer = HiSayer()
loop.create_task(hisayer.run())
splitter = StringSplitter()
loop.create_task(splitter.run())
lowercaser = LowerCaser()
loop.create_task(lowercaser.run())
uppercaser = UpperCas... | StarcoderdataPython |
131249 | <gh_stars>1-10
from django.apps import AppConfig
class SignalNotificationConfig(AppConfig):
name = 'signal_notification'
def ready(self):
from signal_notification.notify_manager import get_registered_notify_manager, get_registered_handlers
get_registered_handlers()
get_registered_noti... | StarcoderdataPython |
4833164 | from django.conf.urls import url
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.utils.translation import ugettext_lazy as _
from cms.app_base import CMSApp
from cms.test_utils.project.sampleapp.cms_menus import SampleA... | StarcoderdataPython |
1791178 | <gh_stars>0
def test_main():
assert "main" == "main"
| StarcoderdataPython |
1743015 | <filename>spaceship.py
WIDTH = 800
HEIGHT = 600
import math
spaceship = Actor("falcon")
print(spaceship.size)
spaceship.center = WIDTH/2, HEIGHT/2
spaceship.speed = 4
spaceship.angle = 0
spaceship.direction = 0, -1
#def on_key_down(key):
# if key == keys.left:
# pass
# elif key == keys.right:
# p... | StarcoderdataPython |
101818 | import discord
import asyncio
import youtube_dl
import string
class vidPlayer:
def __init__(self, bot):
self.bot = bot
self.list = []
self.voice = None
self.player = None
@asyncio.coroutine
def playAll(self, channel: discord.Channel=None):
if len(self.list) == 0:
... | StarcoderdataPython |
1704684 | <reponame>Zarchan/mqtt_chat
import argparse
import shutil
import paho.mqtt.client as mqtt # type: ignore
import paho.mqtt.subscribe as subscribe # type: ignore
parser = argparse.ArgumentParser(description="Start a command line chat room over MQTT")
parser.add_argument('--display-name', '-d', required=True, help="Chat... | StarcoderdataPython |
1685687 | import sqlite3
import crypt_handler
# database entry object containing all the information nessecary
class DbEntry():
def __init__(self, app, url, email, username, password):
self.app = app
self.url = url
self.email = email
self.username = username
self.password = password
... | StarcoderdataPython |
4825245 | # Copyright (C) 2015-2019 SignalFx, Inc. All rights reserved.
# Copyright (C) 2020 Splunk, Inc. All rights reserved.
import collections
import json
import logging
import pprint
import requests
import six
from six.moves import queue
import threading
import zlib
from .constants import DEFAULT_INGEST_ENDPOINT, DEFAULT_T... | StarcoderdataPython |
80988 | <gh_stars>100-1000
# Copyright (c) 2020 Uber Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | StarcoderdataPython |
1715807 | import collections
import logging
import pprint
class PprintArgsFilter(logging.Filter):
'''Use pprint/pformat to pretty the log message args
ie, log.debug("foo: %s", foo)
this will pformat the value of the foo object.
'''
def __init__(self, name="", defaults=None):
super(PprintArgsFilter... | StarcoderdataPython |
3238533 | <filename>KernTool3.roboFontExt/lib/tdKernListView.py
# -*- coding: utf-8 -*-
from vanilla import *
from AppKit import *
from fontTools.pens.cocoaPen import CocoaPen
from mojo.canvas import Canvas
from mojo import drawingTools# .drawingTools import *
from fontParts.world import CurrentFont
from lib.eventTools.eventMa... | StarcoderdataPython |
3232760 | <reponame>isabella232/nnabla<filename>python/src/nnabla/experimental/graph_converters/batch_norm_batchstat.py<gh_stars>0
# Copyright 2020,2021 Sony Corporation.
# Copyright 2021 Sony Group Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance w... | StarcoderdataPython |
4830083 | # Copyright 2015 Twitter, Inc and other contributors.
#
# 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 a... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.