id stringlengths 1 8 | text stringlengths 6 1.05M | dataset_id stringclasses 1
value |
|---|---|---|
16358 | from django.apps import AppConfig
from django.db.models.signals import post_migrate
from django.utils.translation import gettext_lazy as _
class SitesConfig(AppConfig):
name = 'src.base'
verbose_name = _("Modulo de Frontend")
| StarcoderdataPython |
12813584 | import sys
from pony_barn import client as pony
from base import GitBuild
class PonyBuild(GitBuild):
def __init__(self):
super(PonyBuild, self).__init__()
self.name = "surlex"
self.repo_url = 'git://github.com/codysoyland/surlex.git'
if __name__ == '__main__':
build = PonyBuild()
... | StarcoderdataPython |
93840 | <reponame>TakesxiSximada/dumpcar<filename>scripts/get-db-raw-snapshot-mysql.py
import getpass
import argparse
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument('host')
parser.add_argument('user')
parser.add_argument('db')
args = parser.parse_args()
child = subprocess.run('mysqldump -h {} -u {}... | StarcoderdataPython |
3422660 | <reponame>baiyanquan/k8sTools
# -*- coding: utf-8 -*
class K8sRepository(object):
def __init__(self):
pass
@staticmethod
def create_k8s_namespace_view_model(result):
success = []
try:
for each_host in result['success']:
for each_resource in result['suc... | StarcoderdataPython |
1651285 | <reponame>DiceNameIsMy/recruiting<gh_stars>0
# Generated by Django 3.2.4 on 2021-06-27 14:44
from django.db import migrations, models
import recruiting.utils.handler
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
... | StarcoderdataPython |
5134549 | """
# Sample code to perform I/O:
name = input() # Reading input from STDIN
print('Hi, %s.' % name) # Writing output to STDOUT
# Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail
"""
# Write your code here
t = int(input())
for _ in range(t):
cos... | StarcoderdataPython |
3361442 | import time
import ttn
app_id = "solar-pi0-ws-app"
access_key = "<KEY>"
#to send the reconfiguration message, to see where we do it
def send_reconfiguration_message(seconds_until_next_meassure):
try:
message = "reconfig_sleep_time;" + str(seconds_until_next_meassure)
publish.single("config_sensor_... | StarcoderdataPython |
1750538 | <gh_stars>0
import os
from multime.auxotroph_analysis import load_model
me = load_model.load_me_model(json=True)
aerobicity='anaerobic'
if aerobicity == 'anaerobic':
prefix = '_anaerobic'
else:
prefix = ''
for gene_obj in list(me.translation_data):
gene = gene_obj.id
source_dir = os.getcwd() + '/kno... | StarcoderdataPython |
3429628 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 13 18:41:38 2021
@author: divyoj
"""
## importing libraries:
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib.animation import FuncAnimation
import os
# # note that this must be executed before 'import numba'
# o... | StarcoderdataPython |
6418326 | <filename>2020/18/solution.py
from typing import Tuple
def apply_operator(lv, rv, operator) -> float:
return lv + rv if operator == "+" else lv * rv
def log(*kargs):
pass
def eval_expression(exp_str: str, start: int = 0) -> Tuple[float, int]:
log(f"==> eval_expression(\"{exp_str}\", {start})")
exp... | StarcoderdataPython |
9728346 | <reponame>shikharmn/lightly
import sys
import tempfile
from lightly.utils import save_custom_metadata
from tests.api_workflow.mocked_api_workflow_client import MockedApiWorkflowSetup, MockedApiWorkflowClient
class TestCLICrop(MockedApiWorkflowSetup):
@classmethod
def setUpClass(cls) -> None:
sys.mod... | StarcoderdataPython |
6649682 | frase = str(input('Digite uma frase: ')).strip().upper()
palavras = frase.split()
junto = ''.join(palavras)
inverso = ''
for letra in range(len(junto) - 1, -1, -1):
inverso += junto[letra]
if inverso != junto:
print('NÃO É UM PALÍNDROMO')
else:
print('PALÍNDROMO')
"""from unidecode import unidecode
x = 'pa... | StarcoderdataPython |
155697 | from simupy.block_diagram import BlockDiagram
import simupy_flight
import numpy as np
from nesc_testcase_helper import plot_nesc_comparisons, int_opts, benchmark
from nesc_testcase_helper import ft_per_m, kg_per_slug
Ixx = 3.6*kg_per_slug/(ft_per_m**2) #slug-ft2
Iyy = 3.6*kg_per_slug/(ft_per_m**2) #slug-ft2
Izz = 3.6... | StarcoderdataPython |
9726224 | <gh_stars>0
# Generated by Django 2.2.4 on 2019-12-16 19:03
from django.db import migrations, models
import phonenumber_field.modelfields
class Migration(migrations.Migration):
dependencies = [
('property', '0013_auto_20191202_2055'),
]
operations = [
migrations.RemoveField(
... | StarcoderdataPython |
5098211 | # -*- coding: utf-8 -*-
import argparse
import json
import sys
from ..googlenews import get_news_by_geolocation
FIELDS = ['title', 'url', 'description']
def execute(args):
if args.geolocation:
city, state = args.geolocation
result = get_news_by_geolocation(city, state)
if args.fields:
... | StarcoderdataPython |
6675625 | # -*- coding: utf8 -*-
# Filename: renameFiles.py
#
########################################################################
# This is a program to rename files and folders in
# a given folder by applying a set of renaming rules
#
# <NAME> (<EMAIL>)
#
# Specify the path with the variable path
# To see if rules work wit... | StarcoderdataPython |
5117914 | <reponame>ealogar/servicedirectory<gh_stars>0
'''
(c) Copyright 2013 Telefonica, I+D. Printed in Spain (Europe). All Rights
Reserved.
The copyright to the software program(s) is property of Telefonica I+D.
The program(s) may be used and or copied only with the express written
consent of Telefonica I+D or in accordance... | StarcoderdataPython |
6541300 | import unittest
import sys
sys.path.append('../')
import service
import installer
import yaml
class TestStringMethods(unittest.TestCase):
def test_russian(self):
p1 = Test1()
txt = service.handler(p1, None)
self.assertEqual(len(txt), 7)
def test_other_russian(self):
p1 = Test2... | StarcoderdataPython |
6615546 | """https://github.com/RonTang/SimpleTimsort/blob/master/SimpleTimsort.py
"""
import time
import random
"""
二分搜索用于插入排序寻找插入位置
"""
def binary_search(the_array, item, start, end):
if start == end:
if the_array[start] > item:
return start
else:
return start + 1
if start > en... | StarcoderdataPython |
326501 | <reponame>srg91/salt
# -*- coding: utf-8 -*-
'''
Common code shared between the nacl module and runner.
'''
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
import os
# Import Salt libs
from salt.ext import six
import salt.syspaths
import salt.... | StarcoderdataPython |
336369 | <reponame>rutgerhartog/apocrypha
from scipy.stats import chisquare as chi2
def calculate_chisquare(text: bytes) -> float:
return chi2(text).statistics
| StarcoderdataPython |
3342947 | # Copyright 2017-present <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 required by applicable law or agreed ... | StarcoderdataPython |
5116650 | <reponame>titanous/fdb-document-layer
#!/usr/bin/python
#
# setup_mongo.py
#
# This source file is part of the FoundationDB open source project
#
# Copyright 2013-2018 Apple Inc. and the FoundationDB project authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except i... | StarcoderdataPython |
9651377 | <filename>hostlock/apps.py
from django.apps import AppConfig
class HostlockConfig(AppConfig):
name = 'hostlock'
| StarcoderdataPython |
4938603 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-04-12 09:47
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('cms_test2', '0006_auto_20180412_0942'),
]
operatio... | StarcoderdataPython |
4971971 | # Authors: <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import numpy as np
from ..utils import logger, verbose
from ..parallel import parallel_func
from ..io.pick import channel_type, pick_types
def _time_gen_one_fold(clf, X, y, train, test, scoring):
"""Aux function of time_generalization"""
from sklearn.m... | StarcoderdataPython |
4936293 | <reponame>sulealothman/arbraille<filename>braille/__init__.py<gh_stars>1-10
from .BrailleToAlphabet import BrailleToAlphabet
from .AlphabetToBraille import AlphabetToBraille
from .BrailleFile import BrailleFile
#from .ConvertToArabic import BrailleToArabic
from .Main import Main | StarcoderdataPython |
1792920 | <filename>Python-Data-Structures-and-Algorithms-master/Chapter05/stack_queue_1.py
class Queue:
def __init__(self):
self.inbound_stack = []
self.outbound_stack = []
def dequeue(self):
if not self.outbound_stack:
while self.inbound_stack:
self.outbound_stack.ap... | StarcoderdataPython |
5019189 | from .pkg import a
| StarcoderdataPython |
4892187 | <reponame>jcferrara/fantasy-football-start-or-sit
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 1 01:25:36 2021
@author: JustinFerrara
"""
import pandas as pd
def get_gamelog(player_code, year):
player_url = 'https://www.pro-football-reference.com' + player_code[0:len(player_code)-4] +... | StarcoderdataPython |
6662149 | <reponame>Saebasol/Heliotrope
"""
MIT License
Copyright (c) 2021 SaidBySolo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, co... | StarcoderdataPython |
5026364 | <reponame>synxlin/chinese-chat-bot
#/usr/bin/env python3
#-*- coding: utf-8 -*-
import gc
import pyaudio
import wave
import numpy as np
from os import path
import subprocess
from queue import Queue, Empty
from threading import Thread, Lock
from time import sleep
from .recognizer import Recognizer
from .jarvis import ... | StarcoderdataPython |
6619919 | import numpy as np
from sklearn.svm import LinearSVC
from sklearn.datasets import load_svmlight_file
import random
#data
data = load_svmlight_file("leu")
# subSampling
l =len(data[1])
start = int(round(l*0.70,0))
#N = random.sample(range(start,l), 1)
N = int(round(l*0.80,0))
print("Number of sub sample %d" %N)
... | StarcoderdataPython |
5184463 | """
This example demonstrates the use of a newly implemented oak-d worker: hand_asl
To implement a new worker, please refer to the following steps:
1. Define a new oak-d node type in:
<cep_root>/src/curt/curt/modules/vision/oakd_node_types.py
In this example, the new type is "hand_asl"
2. Implement the actual logic of... | StarcoderdataPython |
3473392 | """ A wechat personal account api project
See:
https://github.com/littlecodersh/ItChat
"""
from setuptools import setup, find_packages
from codecs import open
from os import path
import itchat
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_descri... | StarcoderdataPython |
9642222 | import pyowm
import pyowm.utils
import json
import requests
import re
def varosLekerese():
data = json.loads(requests.get("http://ipinfo.io/json").text)
return data["city"]
parancs = self.parancs
beszed = self.beszed
h = self.h
hangFelismeres = self.hangFelismeres
if "időjárás" in parancs.lower() or "hőmérsé... | StarcoderdataPython |
6672190 | <filename>HeapSort/HeapSort.py<gh_stars>0
#!/bin/python
def Heapify(DataList, Size):
Layer = 1
ParentIndex = 1
while ParentIndex < Size:
ParentIndex = ParentIndex << 1
Layer += 1
ParentIndex = 2**(Layer-1) - 2
while ParentIndex >= 0:
LeftIndex = 2 * ParentIndex + 1
if LeftIndex < Size:
TmpParent = Pare... | StarcoderdataPython |
245427 | <filename>tweet-reader/tweet_producer.py
import pandas as pd
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
from kafka import KafkaProducer
from get_authentication import get_authentication
auth_dict = get_authentication()
auth = OAuthHandler(auth_dict['CONSUME... | StarcoderdataPython |
12846719 | <filename>scripts/figures/gene_abundance.py
#%%
import scanpy as sc
import pandas as pd
from pathlib import Path
from vectorseq.utils import check_gene_abundance, create_dir
from vectorseq.marker_constants import BrainGenes
data_dir = Path("/spare_volume/vectorseq-data")
figure_save_dir = create_dir(data_dir / "gene_a... | StarcoderdataPython |
9689187 | # Copyright (c) 2020 Rik079, <NAME>, Zibadian, Micro-T. All rights reserved.
__version__ = "Alpha"
# Discord login Token
token = ""
# Path to modules folder
modulepath = "./modules"
# AWS credentials
aws_id = ''
aws_secret = ''
aws_region = 'us-west-2'
# Staff
# ------------------------
# Admins
adminids = []
#... | StarcoderdataPython |
1950126 | <reponame>prodProject/WorkkerAndConsumerServer
from enum import Enum
from CommonCode.passwordHashOrDehashHelper import PasswordHasherOrDeHasher
from Enums.passwordEnum import PasswordMode
from Password.passwordHelper import PasswordHelper
from Services.loginService import LoginService
class States(Enum):
START =... | StarcoderdataPython |
8086206 | <gh_stars>0
from generator import User
from generator import Database
def generator_bot():
print("Bienvenido al sistema de gestión de usuarios!")
Database.create_table()
menu()
def menu():
res = input('Quiere crear, eliminar o buscar un usuario? \n[a] Crear \n[b] Eliminar \n[c] Buscar \n> ')
if res... | StarcoderdataPython |
9676701 | import logging
from ..settings import azure_configs
from ..settings import local_configs
from ..settings import gcp_configs
from .base import BlobStorage
from .gcp import GoogleCloudStorage
from .azure import AzureStorage
from .local import LocalStorage
def BlobStorageFactory(provider="local") -> BlobStorage:
""... | StarcoderdataPython |
168935 | <filename>vendor/iptables-1.8.7/iptables-test.py
#!/usr/bin/env python
#
# (C) 2012-2013 by <NAME> <<EMAIL>>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or... | StarcoderdataPython |
1930740 | <filename>.venv/lib/python3.8/site-packages/opencensus/trace/span_context.py<gh_stars>0
# Copyright 2017, OpenCensus 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 |
11382232 | <filename>services/ap_to_redis.py
#!/usr/bin/env python3
from mycelium.components import RedisBridge, Connector
from mycelium_utils import Scripter
class ScripterExt(Scripter):
def run_main(self):
rb = RedisBridge(db=self.rd_cfg.databases['robot'])
self.conn = Connector(self.cfg.ap_to_redis, self... | StarcoderdataPython |
3359377 | <gh_stars>0
"""
Common utilities
"""
import numpy as np
import torch
from shapely.geometry import Polygon
def check_numpy_to_torch(x):
if isinstance(x, np.ndarray):
return torch.from_numpy(x).float(), True
return x, False
def check_contain_nan(x):
if isinstance(x, dict):
return any(chec... | StarcoderdataPython |
11336293 | """This module contains custom mpld3 plugins to add useful features to the graph.
The JavaScript in the Python files was built from the TypeScript source files in the
`mpld3-plugins` directory.
Classes
-------
InteractiveLegend
Class defining an mpld3 plugin to create an interactive legend.
RangeSelectorButtons
... | StarcoderdataPython |
11374782 | <gh_stars>1-10
from unittest.result import TestResult, failfast
from instant_coverage import clear_url_caches
from django.http import HttpResponse
from django.test import SimpleTestCase
from django.test.utils import setup_test_environment, teardown_test_environment
from django.views.generic import View
from mock impo... | StarcoderdataPython |
3399899 | import requests
import json
import re
import psycopg2.extensions
import bot.secret as secret
def reply_text(cur, reply_token, REPLY_ENDPOINT, HEADER, text, userid):
reply = ''
"""
url= secret.WCDAPI
response = requests.get(url)
tenki = json.loads(response.text)
"""
if re.match('登録 ', tex... | StarcoderdataPython |
3298573 | """
Testing tool to validate serialization and deserialization.
WARNING: Not for production use.
Specifically constructed to assist with json loading and dumping within the library.
As a secondary case, this displays how many python serializers/deserializers should be able to take
advantage of the dataclass usage.
""... | StarcoderdataPython |
8020301 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 10 11:01:52 2018
@author: alex
"""
import mechanize
import re
import time
from selenium import webdriver
browser = webdriver.Firefox()
#mechanize can not work correctly
def login():
browser = mechanize.Browser()
browser.set_hand... | StarcoderdataPython |
1968940 | from .baserepository import BaseRepository
from factories.customer import CustomerFactory
from connection.results.customersigninresult import CustomerSignInResult
from .actions.customer import CustomerActions
from decorators.repositories import RepositoryConnected
#from decorators.decorators import RequiredParams
from ... | StarcoderdataPython |
4911300 | from typing import List
# O(n) time complexity and O(n) space complexity
# def backspaceCompare(self, s: str, t: str) -> bool:
# return back(s, []) == back(t, [])
#
# def back(s: str, stack: List):
# for i in s:
# if i != "#":
# stack.append(i)
# elif stack:
# stack.pop(... | StarcoderdataPython |
11325429 | <reponame>KarsSloeserwij/SimpleAStarPython
import math
class Astar():
def __init__(self, board):
self.board = board
pass
def get_distance(self, a, b):
return abs(a.x - b.x) + abs(a.y - b.y)
def retrace_path(self, start, end):
print("FOUND PATH")
path = []
currentState = end;
while(... | StarcoderdataPython |
11317134 | from django.apps import AppConfig
class DocumentsConfig(AppConfig):
name = 'documents'
verbose_name = 'Mục Tài Liệu'
verbose_name_plural = 'Mục Tài Liệu'
| StarcoderdataPython |
8015142 | import sys
import time
from os import getpid
from queue import Queue, Empty
import traceback
from _thread import allocate_lock, start_new_thread
from speedysvc.logger.std_logging.LoggerServer import LoggerServer
from speedysvc.client_server.shared_memory.SHMClient import SHMClient
from speedysvc.client_server.base_cla... | StarcoderdataPython |
3531607 | from django.urls import path
from .views import register
app_name = 'accounts'
urlpatterns = [
path('cadastro-usuario/', register, name='register'),
] | StarcoderdataPython |
4852204 | import sys
import time
import threading
from ns4help import *
class Model:
def __init__(self, func, *args, **kwargs):
self.func = func
self.args = args
self.kwargs = kwargs
def run(self, t_run: int):
try:
t_model = ModelFunc(self.func, *self.args, **self.kwa... | StarcoderdataPython |
51689 | import unittest
import prody
import numpy as np
import pytest
import itertools
from path import Path
from ..mhc_peptide import BasePDB
from ..sampling.generate_peptides import PeptideSampler
from .. import utils
from ..helpers import isolate, isolated_filesystem
@pytest.fixture()
def default_mhc():
return utils... | StarcoderdataPython |
80184 | import discord
from discord.ext import commands
import octorest
class OctoPrint(commands.Cog):
def __init__(self, bot: commands.AutoShardedBot):
self.bot = bot
#bot.loop.create_task(self.connect_printer())
async def connect_printer(self):
await self.bot.wait_until_ready()
t... | StarcoderdataPython |
3238076 | #!/usr/bin/env python
'''
This script starts all Turtlebot control services
which are defined under `srv/` folder.
The key setence is:
turtle_services = TurtlebotControlRosServices()
turtle_services.start()
WARNING: `SetPose` is not supported for real robot, only for Gazebo simulation.
'''
from ros_turtl... | StarcoderdataPython |
11222390 | <filename>scriptbase/disk.py
# Copyright 2016-19 <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 required by applicable la... | StarcoderdataPython |
1990083 | <reponame>swreinehr/katana
def test_import_applications_property_graph():
import galois.lonestar.analytics.bfs
import galois.lonestar.analytics.jaccard
import galois.lonestar.analytics.pagerank
import galois.lonestar.analytics.connected_components
import galois.lonestar.analytics.kcore
def test_im... | StarcoderdataPython |
9755208 | from datetime import datetime
from bson import json_util
from mongoengine import StringField, connect, Document, DateField, ReferenceField, ListField, QuerySet
connect("article")
class CustomQuerySet(QuerySet):
def to_json(self):
return "[%s]" % (",".join([doc.to_json() for doc in self]))
class Tag(Do... | StarcoderdataPython |
8033903 | <reponame>opensciencegrid/network_analytics
import threading
class ConnectionListener(object):
"""
This class should be used as a base class for objects registered
using Connection.set_listener().
"""
def on_connecting(self, host_and_port):
"""
Called by the STOMP connection once a ... | StarcoderdataPython |
11381200 | """
Data related to configuration
"""
import copy
import pkg_resources
import asdf
def get_defaults():
filename = pkg_resources.resource_filename(
'pydrad',
'configure/data/defaults.asdf',
)
with asdf.open(filename) as af:
return copy.deepcopy(dict(af.tree))
| StarcoderdataPython |
369293 | <gh_stars>1-10
{
"targets": [
{
"target_name": "addon",
"sources": [ "src/logql.cc" ],
"libraries": [ "<!(pwd)/logql.so" ]
}
]
}
| StarcoderdataPython |
5018171 | <reponame>caoyukun0430/Computer-Networking-A-Top-Down-Approach-NOTES
from socket import *
import os
import sys
import struct
import time
import select
import binascii
ICMP_ECHO_REQUEST = 8
ICMP_ECHO_REPLY = 0
PING_NUMBER = 4
def checksum(str):
csum = 0
countTo = (len(str) / 2) * 2
count = 0
while coun... | StarcoderdataPython |
1964926 | import json
import math
from elasticsearch import ConnectionError, NotFoundError
import falcon
from reach.web.views import template
def _get_pages(current_page, last_page):
"""Return a list of pages to be used in the rendered template from the
last page number."""
pages = []
if current_page > 3:
... | StarcoderdataPython |
1708136 | <filename>dataset.py
import time
import torch
import numpy as np
import pandas as pd
import scipy
from h5py import File
import itertools, random
from tqdm import tqdm
from loguru import logger
import torch.utils.data as tdata
from typing import List, Dict
class TrainHDF5Dataset(tdata.Dataset):
"""
HDF5 datase... | StarcoderdataPython |
12860663 | <filename>modules/tankshapes/__init__.py
""" Tank shapes package for Guns.
This init file marks the package as a usable module.
"""
| StarcoderdataPython |
4939461 | from django.apps import AppConfig
class PersoonlijkConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'persoonlijk'
| StarcoderdataPython |
8060684 | <reponame>mpolson64/Ax-1
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import json
from typing import Any, Callable, Type, Dict
from ax.core.experiment import Exp... | StarcoderdataPython |
1891595 | """Entry point for CLI commands."""
import click
from .predict import predict
from .preprocess import preprocess
from .test import test
from .train import train
@click.group()
def entry_point():
"""Entry point for CLI commands."""
# TODO: configure logging on app start
entry_point.add_command(preprocess)
entr... | StarcoderdataPython |
11354184 | <gh_stars>1-10
import urllib.request
import os
URLS = (
'https://raw.githubusercontent.com/maigfrga/spark-streaming-book/master/data/movielens/tags.csv', # noqa
'https://raw.githubusercontent.com/maigfrga/spark-streaming-book/master/data/movielens/ratings.csv', # noqa
'https://raw.githubusercontent.com/m... | StarcoderdataPython |
282234 | #!/usr/bin/python
# Project : diafuzzer
# Copyright (C) 2017 Orange
# All rights reserved.
# This software is distributed under the terms and conditions of the 'BSD 3-Clause'
# license which can be found in the file 'LICENSE' in this package distribution.
from struct import pack, unpack
from cStringIO import Stri... | StarcoderdataPython |
11289188 | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import (
PuntoVenditaViewSet,
)
# Create a router and register our viewsets with it.
ROUTER = DefaultRouter()
ROUTER.register('punti-vendita', PuntoVenditaViewSet)
# The API URLs are now determined automatically b... | StarcoderdataPython |
5025006 | <filename>test/command_line/test_refine_bravais_settings.py
from __future__ import absolute_import, division, print_function
import json
import os
import pytest
from cctbx import sgtbx, uctbx
from dxtbx.serialize import load
from dials.command_line import refine_bravais_settings
def test_refine_bravais_settings_i... | StarcoderdataPython |
1606025 | <reponame>diegushko/utils
import torch
import torch.nn as nn
from math import ceil
base_model = [
# expand_ratio, channels, repeats, stride, kernel_size
[1, 16, 1, 1, 3],
[6, 24, 2, 2, 3],
[6, 40, 2, 2, 5],
[6, 80, 3, 2, 3],
[6, 112, 3, 1, 5],
[6, 192, 4, 2, 5],
[6, 320, 1, 1, 3]
]
pth... | StarcoderdataPython |
11271216 | <filename>replicable/spec.py<gh_stars>0
from __future__ import print_function, unicode_literals, division, generators
import contextlib
from itertools import product
import numpy as np
import xxhash
try:
import itertools.imap as map
except ImportError:
pass
try:
import itertools.izip as zip
except ImportE... | StarcoderdataPython |
5192107 | <filename>src/creationals/scraper_factory.py
'''
@author: oluiscabral
'''
from scrapers.url import URL
from actioners.interfaces.i_login_control import ILoginControl
from scrapers.composites.compare_scraper import CompareScraper
from creationals.stockreport_factory import StockReportScraperFactory
from creationals.comp... | StarcoderdataPython |
8106115 | """
Very thin wrapper around Fabric. We basically re-implement
the ``fab`` executable.
We use this when we need to create PyCharm run configurations that run Fabric tasks.
"""
if __name__ == '__main__':
from fabric.main import main
main()
| StarcoderdataPython |
6687934 | import matplotlib.pyplot as plt
import numpy as np
import csv
from learningModels.process import LearningProcess, compute_avg_return, points_history
from learningModels.GameEnv import SnakeGameEnv
def write_data(file, data):
"""Save the data in csv file.
file (str): Path where the file will be saved.
da... | StarcoderdataPython |
88587 | <reponame>astro-projects/astro
from astro.files.base import File, get_files # noqa: F401 # skipcq: PY-W2000
| StarcoderdataPython |
6437261 | <filename>run.py
#! /usr/bin/env python
import argparse
from tensorflow.keras import models
from hts.preprocess import *
from hts.visualize import predict_plot
from hts.utils import merge_data, load_raw_data, parse
from hts.model import Model
import datetime
parser = argparse.ArgumentParser()
parser.add_argument('--t... | StarcoderdataPython |
6496458 | # Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | StarcoderdataPython |
3598920 | import pygame
class Label(pygame.sprite.Sprite):
msg: str
position: str
def __init__(self, font_size, position):
pygame.sprite.Sprite.__init__(self)
self.position = position
self.font = pygame.font.Font("28_Days_Later.ttf", font_size)
self.msg = ""
self... | StarcoderdataPython |
167768 | import sys
def check_leap_year(year):
if (year % 4) == 0:
if (year % 100) == 0:
if (year % 400) == 0:
return 1
else:
return 0
else:
return 1
else:
return 0
def get_next_date(dd, mm, yy):
if check_leap_year(yy)... | StarcoderdataPython |
5188027 | <filename>mall/superadmin/models.py
#coding=utf-8
from mall.database import Column, Model, SurrogatePK, db, reference_col, relationship
import datetime as dt
#系统更新版本号
class SystemVersion(SurrogatePK,Model):
__tablename__ = 'system_versions'
#版本号
number = Column(db.String(20))
#标题
title = Column(db.String(100))
... | StarcoderdataPython |
318356 | <reponame>dmrib/linguicator-predictor<gh_stars>0
import asyncio
import websockets
import logging
from linguicator_predictor.websocket import handle_websocket_connection
from linguicator_predictor.models.en.distilgpt2 import DistilGPT2
PORT = 8765
HOST = '0.0.0.0'
LOGGING_FORMAT = '%(asctime)s - %(levelname)s - %(mess... | StarcoderdataPython |
3443242 | <reponame>YuriSpiridonov/LeetCode<gh_stars>10-100
"""
Design a parking system for a parking lot. The parking lot has three kinds
of parking spaces: big, medium, and small, with a fixed number of slots for
each size.
Implement the ParkingSystem class:
- ParkingSystem(int big, int medium, int s... | StarcoderdataPython |
3271890 | <reponame>alex-evans/fgolf
from django.db import models
from bs4 import BeautifulSoup
import requests
class Player(models.Model):
name = models.CharField(max_length=200, unique=True)
class Meta:
ordering = ['name']
def __str__(self):
return self.name
class Person(models.Model):
nam... | StarcoderdataPython |
397261 | # The MIT License (MIT)
# Copyright (c) 2022 by the xcube development team and contributors
#
# 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 limit... | StarcoderdataPython |
128780 | #-*- coding: utf-8
import json
import time
import requests
from bs4 import BeautifulSoup
# pixiv url and login url.
PIXIV = 'https://www.pixiv.net'
LOGIN_URL = 'https://accounts.pixiv.net/login'
LOGIN_POST_URL = 'https://accounts.pixiv.net/api/login?lang=zh_tw'
# user-agnet.
headers = {'User-Agent' : 'Mozilla/5.0 (Wi... | StarcoderdataPython |
333912 |
import os
import sys
_PWEG_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))).replace('\\', '/')
sys.path.insert(0, '%s/thirdparty_packages' % _PWEG_ROOT) # to include QtPy package
from qtpy.QtWidgets import QApplication
class PluginBase(object):
def __init__(self):
pass
def _co... | StarcoderdataPython |
1955896 | import numpy as np
from node import Node
def main():
nodes=[]
num_pwr_cycles = 10
t_on_sunlight = 0.5 # t_s (or t_on) when nodes in sleep mode under sunlight
t_off_sunlight = 0.5 # t_off when nodes under sunlight
t_on_shadow = 0.1 # t_s (or t_on) when nodes in sleep mode in shadow
t_off_shadow = 2 # ... | StarcoderdataPython |
202404 | <reponame>Syntle/PythonBot
import discord
class Embeds:
def cooldown(h, m, s):
description = None
h = round(h)
m = round(m)
s = round(s)
if int(h) is 0 and int(m) is 0:
description = f'⏱️ Please wait {s} seconds before trying this command again!'
elif ... | StarcoderdataPython |
1809457 | import os
os.chdir('./data/')
for data_file in os.listdir():
with open(data_file) as f:
lines=f.readlines()
header =lines[0]
if not "v_{y}" in header:
with open(data_file, "r+") as f:
for line in lines[1:]:
f.write(line)
input("go to hell headers!!!")
... | StarcoderdataPython |
5116135 | <filename>dashboard/current.py
import pandas as pd
import numpy as np
import plotly.graph_objects as go
import dash_core_components as dcc
EVEN_COLOR = "white"
ODD_COLOR = "aliceblue"
def plot_current(data, sort, ascending):
df = data.get_dataset("countries_total")
df_pivot = pd.pivot_table(
df, ind... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.