id stringlengths 1 8 | text stringlengths 6 1.05M | dataset_id stringclasses 1
value |
|---|---|---|
5087027 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 19 08:14:34 2018
@author: uber-abdul
"""
import numpy as np #for mathematical calculation
import matplotlib.pyplot as plt #for ploting nice chat and graph
import pandas as pd
dataset = pd.read_csv('Position_Salaries.csv')
X = dataset.iloc[:,... | StarcoderdataPython |
196289 | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | StarcoderdataPython |
8161859 | <reponame>Ketsia-a/djangoporto
from django.shortcuts import render
from django.http import HttpResponse
from .models import Image,Location,Category
# Create your views here.
def homepage(request):
images = Image.objects.all()
locations = Location.get_locations()
category = Category.objects.all()
conte... | StarcoderdataPython |
3466467 | <reponame>loonghao/rayvision_sync<gh_stars>0
"""Download models.
Including download, automatic download (the task is fully rendered,
one frame is downloaded after downloading one frame), download so
the un-downloaded task is recorded (the task is rendered).
"""
# Import built-in modules
import time
import os
# Impo... | StarcoderdataPython |
3217261 | <gh_stars>10-100
from tests.fields.subclass_models import RaceParticipant, RacePlacingEnum
from tortoise.contrib import test
class TestCustomFieldFilters(test.IsolatedTestCase):
tortoise_test_modules = ["tests.fields.subclass_models"]
async def asyncSetUp(self):
await super().asyncSetUp()
awa... | StarcoderdataPython |
231759 | <gh_stars>0
import json
import os
import tempfile
from time import time
from softframe.classification import lib
from softframe.classification.app import classificar_documento_para_tipo
from softframe.processing.utils import Parser
from softframe.database import DatabaseConnector
from lxml import etree
from selenium ... | StarcoderdataPython |
8093592 | <reponame>peiss/ant-learn-python-100P
def read_file():
result = []
with open("./student_grade_input.txt") as fin:
for line in fin:
line = line[:-1]
result.append(line.split(","))
return result
def sort_grades(datas):
return sorted(datas,
key=lambda x: ... | StarcoderdataPython |
1946906 | import setuptools
with open("README.md", "r") as f:
long_description = f.read()
with open("requirements.txt", "r") as f:
install_requires = [line.strip('\n') for line in f.readlines()]
setuptools.setup(
name="visepoch",
version='0.2.1',
author="<NAME>",
description="A package for visualising E... | StarcoderdataPython |
1892956 | <gh_stars>10-100
import serial, os, math, argparse
from time import sleep
BLOCK_SIZE = 64 # 128 for parts with >8k flash
REQ_ENTER = (0xde, 0xad, 0xbe, 0xef)
ACK = (0xaa, 0xbb)
NACK = (0xde, 0xad)
FILE = None
def crc8_update(data, crc):
crc ^= data
for i in range(0, 8):
if crc & 0x80 != 0:
... | StarcoderdataPython |
1773959 | <filename>api/__init__.py
import os
import sys
import pymysql
import logging
from chatterbot import ChatBot
from chatterbot import languages
from chatterbot.response_selection import get_random_response, get_first_response, get_most_frequent_response
from chatterbot.trainers import ChatterBotCorpusTrainer, ListTrainer
... | StarcoderdataPython |
3427573 | import csv
import requests
import pandas as pd
FRED_DGS30 = 'https://www.quandl.com/api/v3/datasets/FRED/DGS30/data.csv?api_key=<KEY>'
with requests.Session() as s:
download = s.get(FRED_DGS30)
decoded_content = download.content.decode('utf-8')
cr = csv.reader(decoded_content.splitlines(), delimiter = '... | StarcoderdataPython |
8178767 | import inspect
import facebook
from . import FacebookTestCase
class FacebookAllConnectionsMethodTestCase(FacebookTestCase):
def test_function_with_zero_connections(self):
token = facebook.GraphAPI().get_app_access_token(self.app_id, self.secret, True)
graph = facebook.GraphAPI(token)
sel... | StarcoderdataPython |
8087944 | <filename>tests/Modem/test_Modem.py
import sys
import pytest
sys.path.append(".")
sys.path.append("..")
sys.path.append("../..")
from Hologram.Network.Modem.MockModem import MockModem
class TestModem(object):
def test_invalid_is_connected(self):
modem = MockModem()
with pytest.raises(Exception, m... | StarcoderdataPython |
6637825 | from operator import xor
import numpy as np
import scipy.special
from dataclasses import dataclass, field
from pb_bss_eval.distribution.complex_angular_central_gaussian import (
ComplexAngularCentralGaussian,
ComplexAngularCentralGaussianTrainer,
normalize_observation,
)
from pb_bss_eval.distribution.mixtu... | StarcoderdataPython |
1868614 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import json
import os
from html.parser import HTMLParser
import requests
import progressbar
class GenreScapper(HTMLParser):
def __init__(self):
super(GenreScapper, self).__init__()
self.genre = None
self.inGoodTag = Fa... | StarcoderdataPython |
9625001 | # OpenCV program to detect face in real time
# import libraries of python OpenCV
# where its functionality resides
import cv2
import sys
import numpy as np
def process_vid(url_path):
print('url is ' + url_path)
# load the required trained XML classifiers
# https://github.com/Itseez/opencv/blob/master/
... | StarcoderdataPython |
3394053 | <reponame>intel/Theano-dev<gh_stars>10-100
from __future__ import absolute_import, print_function, division
from itertools import product
import unittest
from nose.plugins.skip import SkipTest
import six.moves.builtins as builtins
from six import integer_types
import numpy
import math
import theano
import theano.ten... | StarcoderdataPython |
3214019 | import csv
from dataclasses import dataclass
from datetime import date
from pathlib import Path
from typing import Optional, Iterable
@dataclass
class ReportEntry:
"""An entry in a report."""
pdf_path: Path
"""The path on disk to the pdf file."""
pdf_hash_type: str
"""The hash algorithm used to ... | StarcoderdataPython |
6701599 | import pytest
from rest_api.controller.request import Question
from rest_api.controller.response import Answer, AnswersToIndividualQuestion
def test_query_dsl_with_without_valid_query_field():
query = {
"query": {
"bool": {
"must": [
{"match": {"title": "Se... | StarcoderdataPython |
6579324 | <gh_stars>0
from setuptools import setup
setup(
name='grow-ext-kintaro',
version='1.0.4',
license='MIT',
author='<NAME>',
author_email='<EMAIL>',
include_package_data=False,
packages=[
'kintaro',
],
install_requires=[
'google-api-python-client==1.6.2',
'pyth... | StarcoderdataPython |
1858585 | <filename>Genotypes.py
from os import listdir
import re
files = listdir('./../files')
vcfs = [i for i in filter(lambda x: x.endswith('.vcf.gz'), files)]
prefix = [re.sub('.vcf.gz', '', vcf) for vcf in vcfs]
if len(prefix) == 0:
print("There are no vcf.gz files in the files/ directory.")
print("Bye!")
exit()
else:
... | StarcoderdataPython |
11328380 | <gh_stars>1-10
from fastapi import FastAPI
from fastapi.responses import JSONResponse
from typing import Optional
from pydantic import BaseModel
# Schemas
class Password(BaseModel):
length: int
def length(self, length):
self.length = length
return self.length
password = Password()
| StarcoderdataPython |
3567326 | <reponame>connectthefuture/tensorflow<gh_stars>10-100
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.o... | StarcoderdataPython |
1766466 | <reponame>tordans/osmcha-django<filename>osmchadjango/users/migrations/0011_auto_20190206_1257.py
# Generated by Django 2.0.10 on 2019-02-06 12:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0010_auto_20190123_1129'),
]
operations ... | StarcoderdataPython |
333187 | <reponame>SantiagoMille/micom<filename>micom/workflows/db_media.py
"""Test growth media for a model database."""
import pandas as pd
from cobra.medium import find_external_compartment
from micom.annotation import annotate_metabolites_from_exchanges
from micom.db import load_zip_model_db, load_manifest
from micom.workf... | StarcoderdataPython |
12820358 | <gh_stars>0
#!/usr/bin/env python
"""
Script for testing kernel code before
running the experimental code.
"""
import numpy as np
from data import get_dataset
import kernel
def is_pos_def(K):
return np.all(np.linalg.eigvals(K) > 0)
def test_nsk(B):
k = kernel.by_name('nsk', base_kernel='rbf', gamma=1e-1, nor... | StarcoderdataPython |
3477754 | <reponame>tokuma09/MLproject_template
import os
import pickle
import tempfile
from google.cloud import storage as gcs
class GCSOperator():
def __init__(self, project_id, bucket_name, credentials=None):
"""GCSOperator GSC wrapper class
This class provides following APIs.
- upload file
... | StarcoderdataPython |
1745425 | <reponame>namuan/print-rider-py
from http import HTTPStatus
from flask import request, make_response, render_template, current_app, redirect
from printrider import db_config
from printrider.prints import prints_blueprint
from printrider.prints.service import save_document, find_document
@prints_blueprint.route('/')... | StarcoderdataPython |
9679748 | # Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# 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 |
5053367 | <filename>app/stack_widgets/__init__.py
from .playlist_widget import PlayListWidget
from .kugou_api_widget import KugouApiWidget
from .metadata_widget import MetadataWidget
| StarcoderdataPython |
1669351 | # Defines the following shortcuts:
# signal.name -> return the shortname
# signal -> display nicely the content of the signal
# signal(3) -> recompute the signal at time 3, and display nicely
# signal +1 -> increment the signal time of 1, recompute, and display.
# signal.deps -> display the graph dependancy up... | StarcoderdataPython |
4840469 | # Maximum path sum II
# Problem 67
# By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.
# 3
# 7 4
# 2 4 6
# 8 5 9 3
# That is, 3 + 7 + 4 + 9 = 23.
# Find the maximum total from top to bottom in triangle.txt (right click and 'Save ... | StarcoderdataPython |
6478263 | import pytest
@pytest.fixture
def testcases():
return {
"used": (
"""
def test_used(snapshot):
assert snapshot == 'used'
"""
),
"unused": (
"""
def test_unused(snapshot):
assert snapshot == 'unused'... | StarcoderdataPython |
4906824 | <gh_stars>1-10
##
## Copyright (C) 2017, <NAME>, all rights reserved.
##
## This file is part of Camera Network
## (see https://bitbucket.org/amitibo/cameranetwork_git).
##
## Redistribution and use in source and binary forms, with or without modification,
## are permitted provided that the following conditions are m... | StarcoderdataPython |
1945449 | # SPDX-License-Identifier: MIT
#
# Copyright (c) 2021 The Anvil Extras project team members listed at
# https://github.com/anvilistas/anvil-extras/graphs/contributors
#
# This software is published at https://github.com/anvilistas/anvil-extras
import sys
from functools import lru_cache
__version__ = "2.1.0"
def __d... | StarcoderdataPython |
3365535 | <filename>third-party/xed/examples/mfile.py
#!/usr/bin/env python
# -*- python -*-
#BEGIN_LEGAL
#
#Copyright (c) 2017 Intel Corporation
#
# 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
#
# ... | StarcoderdataPython |
11221730 | <reponame>GeniALE/SiteWebGeniALE
from django.apps import AppConfig
class OrchesterCmsIntegrationConfig(AppConfig):
name = 'orchester_cms_integration'
| StarcoderdataPython |
11245408 | import psutil
from django.db import models
class Stats(models.Model):
@staticmethod
def sizeof_fmt(num, suffix='B'):
for unit in ['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi']:
if abs(num) < 1024.0:
return "%3.1f%s%s" % (num, unit, suffix)
num /= 1024.0
... | StarcoderdataPython |
8189486 | <reponame>42cc/dashr-gw<filename>apps/core/tests/test_utils.py
from decimal import Decimal
from django.test import TestCase
from apps.core.models import GatewaySettings
from apps.core.utils import (
get_minimal_transaction_amount,
get_received_amount,
)
class UtilsTest(TestCase):
def setUp(self):
... | StarcoderdataPython |
3356482 | #!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2014-2019 CNRS
# 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 limita... | StarcoderdataPython |
8119991 | import os
import network
import time
import ntptime
import ubinascii
import machine
import micropython
import gc
from umqtt.simple import MQTTClient
class pir:
state_msg = "{\"Time\":\"%s\",\"Uptime\":\"%s\",\"UptimeSec\":%s,\"MemFree\":%s,\"MemAlloc\":%s,\"Stack\":%s,\"Sleep\":%s,\"MqttCount\":%s,\"POWER\":\"%s\... | StarcoderdataPython |
1833903 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import datetime
import hashlib
import logging
import time
from bisect import bisect_right
from collections import OrderedDict, defaultdict
fro... | StarcoderdataPython |
11358689 | import os
import re
import sys
from py._io.terminalwriter import get_terminal_width
from . import __version__ as testmynb__version__
from ._ansi import green, red, orange, strip_ansi
class TestHandler:
def __init__(self, *notebooks):
self.notebooks = notebooks
@property
def _summary(self):
... | StarcoderdataPython |
8157965 | <reponame>sdruskat/toolbox-scripts
#!/usr/bin/python
# -*- coding: utf-8 -*-
#############################################################################
# Copyright 2018ff. <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License... | StarcoderdataPython |
5176992 | <filename>pytd62/common.py
import math
import numpy as np
import pandas as pd
import sys, clr
fileobj = open("path.txt", "r", encoding="utf_8")
sys.path.append(fileobj.readline().strip())
clr.AddReference("OpenTDv62")
import OpenTDv62
clr.AddReference('System')
from System.Drawing.Imaging import ImageFormat
from System... | StarcoderdataPython |
54602 | <reponame>dsroche/obliv<filename>tests/test_fstore.py
#!/usr/bin/env python3
"""Test program for the fstore class."""
import unittest
import tempfile
import random
from obliv import fstore
def randbytes(s):
return bytes(random.getrandbits(8) for _ in range(s))
class TestFstore(unittest.TestCase):
def setUp(... | StarcoderdataPython |
1701008 |
GLOBAL_DISCOUNT_PRODUCT = ('E', 'B', 'N', 'M', 'R', 'Q', 'S','T','X','Y','Z')
class Discount(object):
def __init__(self, discount_purchase=None, discount_receive=None, ref_skus="", occurence=0, free=False):
self.discount_purchase = discount_purchase
self.discount_receive = discount_receive... | StarcoderdataPython |
6691998 | <gh_stars>10-100
"""empty message
Revision ID: 0029_fix_email_from
Revises: 0028_fix_reg_template_history
Create Date: 2016-06-13 15:15:34.035984
"""
# revision identifiers, used by Alembic.
revision = "0029_fix_email_from"
down_revision = "0028_fix_reg_template_history"
import sqlalchemy as sa
from alembic import ... | StarcoderdataPython |
3213974 | <reponame>deepshig/mastermind
import copy
from kripke_model import get_relations, generate_worlds, get_proposition
from codemaker import LENGTH_OF_CODE
from github_com.erohkohl.mlsolver.kripke import KripkeStructure
class KnowledgeManager:
"""
Maintains the knowledge structure for the game.
Initialises wi... | StarcoderdataPython |
3269341 | #!/usr/bin/env python
from setuptools import setup, find_packages
import sys
import sys, os
print(os.path.dirname(sys.executable), '\n')
setup(name='bornraytrace',
version='0.2',
description='Weak gravitational lensing: born raytrace maps, noise and intrinsic alignments',
author='<NAME>',
url... | StarcoderdataPython |
3226523 | <reponame>zxteloiv/TrialBot<filename>trialbot/data/datasets/tsv_dataset.py
from trialbot.data.datasets.file_dataset import FileDataset
class TSVDataset(FileDataset):
def __init__(self, filename, sep="\t", has_title=True, lazy=True):
super().__init__(filename, lazy)
self._sep = sep
self._has... | StarcoderdataPython |
3263235 | <reponame>Arcensoth/mecha
from pathlib import Path
import pytest
from beet import Context, Function, run_beet
from pytest_insta import SnapshotFixture
from mecha import AstNode, CompilationDatabase, CompilationUnit, DiagnosticError, Mecha
from mecha.contrib.annotate_diagnostics import annotate_diagnostics
from mecha.... | StarcoderdataPython |
237272 | class CrabNavy:
def __init__(self, positions):
self.positions = positions
@classmethod
def from_str(cls, positions_str):
positions = [int(c) for c in positions_str.split(",")]
return cls(positions)
def calculate_consumption(self, alignment):
total = 0
for posi... | StarcoderdataPython |
209329 | # http test
import sys
from urllib.request import Request, urlopen
from datetime import datetime
try:
url = 'http://www.naver.com'
request = Request(url)
resp = urlopen(request)
resp_body = resp.read().decode('utf-8') # usally data's type is byte
print(resp_body) # this program is browser. but, do... | StarcoderdataPython |
12802812 | from django.conf.urls import url
from django.contrib import admin
from .views import (
PostCreateAPIView,
PostDetailAPIView,
PostUpdateAPIView,
PostDeleteAPIView,
PostListAPIView
)
urlpatterns = [
url(r'^$', PostListAPIView.as_view(), name='list'),
url(r'^create/$', PostCreateAP... | StarcoderdataPython |
5097302 |
from .PacketFieldType import PacketFieldType
class ComplexFieldType(PacketFieldType):
@classmethod
def _CreateInstance(cls):
"""
Default is ComplexFieldType(PacketFieldType)
"""
return cls(PacketFieldType)
def __init__(self, dataType, attributes=None):
... | StarcoderdataPython |
4958054 | <reponame>Aparna-Sakshi/sktime<filename>sktime/classification/compose/tests/test_column_ensemble.py<gh_stars>1-10
# -*- coding: utf-8 -*-
"""Column ensemble test code."""
__author__ = ["TonyBagnall"]
import numpy as np
from numpy import testing
from sktime.classification.compose import ColumnEnsembleClassifier
from ... | StarcoderdataPython |
352354 | <filename>spatial_lda/primal_dual.py
import logging
import numpy as np
from scipy.special import gammaln, digamma, polygamma
import scipy.sparse
import scipy.sparse.linalg
# Line-search parameters
ALPHA = 0.1
BETA = 0.5
MAXLSITER = 50
# Primal-dual iteration parameters
MU = 1e-3
MAXITER = 500
TOL = 1e-2
def make_g... | StarcoderdataPython |
28892 | <gh_stars>0
import argparse
import logging
import sys
import json
import plotly.offline
import plotly.graph_objs as go
sys.path.append(sys.path[0] + "/..")
from utils.fileprovider import FileProvider
from preprocessing.reader import EvalitaDatasetReader
from nltk.tokenize import TweetTokenizer
logging.getLogger().se... | StarcoderdataPython |
317321 | <filename>awwward/migrations/0002_auto_20210403_1439.py<gh_stars>0
# Generated by Django 3.1.7 on 2021-04-03 14:39
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_depen... | StarcoderdataPython |
3421899 | <reponame>toaomatis/greenchoice-variable-tariffs
DOMAIN = "greenchoice_variable_tariffs"
CONF_POSTAL_CODE = 'postal_code'
CONF_USE_ELECTRICITY = 'use_electricity'
CONF_USE_LOW_TARIFF = 'use_low_tariff'
CONF_USE_GAS = 'use_gas'
DEFAULT_POSTAL_CODE = '9999ZZ'
DEFAULT_USE_ELECTRICITY = True
DEFAULT_USE_LOW_TARIFF = True... | StarcoderdataPython |
4860953 | from ..model_tests_utils import (
status_codes,
DELETE,
PUT,
POST,
GET,
ERROR,
random_model_dict,
check_status_code,
compare_data
)
from core.models import (
Organization
)
org_test_data = {
'org_test_0':{
'org0': {
"description": "Test",
... | StarcoderdataPython |
108527 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
def import_data(file_name, time_column_index=None, mode='csv', header=True, room_name=None, tz=0):
"""
Load raw data from the disk.
:type file_name: str
:param file_name: the name of the raw data file
:type time_column_index: int
:param time_col... | StarcoderdataPython |
3351826 | <reponame>mahmoud/clastic<filename>clastic/tests/test_meta.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from clastic import Application, render_basic, MetaApplication
from clastic.middleware.cookie import SignedCookieMiddleware
from clastic.tests.common import cookie_hello_world
def test_meta_ba... | StarcoderdataPython |
9754205 | import os
import uuid
from .. import BASE_URL, test_csv_file, test_tif_file
from ..user import test_token
test_upload_name = "pytest_upload_csv"
test_export_cm_layer_uuid = "3ef057c3-b65a-448f-9718-d46c33b9ec3b"
| StarcoderdataPython |
277471 | <gh_stars>0
import random
from datetime import datetime, time, timedelta
from faker import Faker
from ..tournament import models as TModels
from ..users.forms import UserCreationForm
from ..users.models import User
# setjum testsorp í database-ið
def generate_initial_data():
print("Generating initial data...")
... | StarcoderdataPython |
6547804 | """
entradas
valora-->A-->float
valorb-->B-->float
valorc-->C-->float
salidas
valorx1-->x1-->float
valorx2-->x2-->float
"""
#entradas
A=float(input("Ingrese el valor de a "))
B=float(input("Ingrese el valor de b "))
C=float(input("Ingrese el valor de c "))
#cajanegra
D=B**2-4*A*C
if D==0:
x1=-B/(2*A)
print(... | StarcoderdataPython |
6484997 | <reponame>Rockysed/PSC_classification
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 1 14:08:03 2019
@author: rocco
"""
import h5py
from sklearn.ensemble import RandomForestClassifier as RFC
from sklearn.decomposition import PCA
from sklearn import svm
from sklearn.model_selection import train_test_split
... | StarcoderdataPython |
3311732 | <reponame>SusannaMichael/OCN506A<gh_stars>0
"""
Code to try to plot data better
"""
#imports
import numpy as np
import sys, os
import matplotlib.pyplot as plt
import pickle
import argparse
import matplotlib.pyplot as plt
#local imports
sys.path.append(os.path.abspath('../shared'))
import my_module as mymod
from imp... | StarcoderdataPython |
12826569 | <filename>formatter_for_output.py<gh_stars>1-10
"""
Support classes for coloring the console output
"""
import logging
import sys
from config import FrameworkConfiguration
def format_console_output():
"""
Format console with a common format and if selected with a colored output
"""
logging.basic... | StarcoderdataPython |
1873485 | # Copyright (c) 2013, ac and contributors
# For license information, please see license.txt
import datetime
import frappe
from accounting.accounting.utils import get_fiscal_date_range
from frappe import _
def execute(filters=None):
filter_type = filters.get('filter_type')
if filter_type == 'Date Range':
... | StarcoderdataPython |
1605570 | #!/usr/bin/python
# Copyright 2020 Makani Technologies 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | StarcoderdataPython |
291732 | import os
import sys
import time
import subprocess
from rich import print
env = os.environ.copy()
def main():
subprocess.run(["sh", "wget_cmems.sh"], env=env)
if __name__ == "__main__":
start = time.time()
try:
main()
except KeyboardInterrupt:
elapsed = round(time.time() - start, 1... | StarcoderdataPython |
1728629 | num = int(input("Enter the number :"))
add=0
for i in range(1,num+1):
add=add+(i**3)
print("sum =",add)
| StarcoderdataPython |
3346420 | # Standard Library packages
import os
import platform
import sys
from time import time
# 3rd party packages
from PyQt5.QtCore import (pyqtSignal, pyqtSlot, QEasingCurve, QPoint, QPropertyAnimation, QSettings, QSize, Qt, QTimer)
from PyQt5.QtGui import (QIcon, QPixmap, QColor, QPainter, QBrush)
from PyQt5.QtWidgets imp... | StarcoderdataPython |
3201523 | <reponame>BrianCarela/google-python-exercises<gh_stars>0
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""A tiny Python program to chec... | StarcoderdataPython |
6643690 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator 2.3.3... | StarcoderdataPython |
1940398 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Persistent identifier fetchers.
A proper fetcher is defined as a function that re... | StarcoderdataPython |
1849855 |
# Copyright 2020, Battelle Energy Alliance, LLC
# ALL RIGHTS RESERVED
"""
Populates user manual with automatic documentation.
"""
import os
import collect_tex
build_path = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'build'))
source_path = os.path.relpath(os.path.join(build_path,... | StarcoderdataPython |
8113787 | import ast, os
from app.extinsions import db
from sqlalchemy.event import listens_for
basedir = os.path.abspath(os.path.dirname(__file__))
likes = db.Table('likes',
db.Column('user_id', db.Integer, db.ForeignKey('user.id')),
db.Column('post_id', db.Integer, db.ForeignKey('post.id'))
... | StarcoderdataPython |
4895062 | <reponame>specter119/py4cytoscape<filename>py4cytoscape/filters.py<gh_stars>10-100
# -*- coding: utf-8 -*-
"""Functions for working with FILTERS for the selection of nodes and edges in
networks, including operations to import and export filters. In the Cytoscape
user interface, filters are managed in the Select tab of... | StarcoderdataPython |
1791394 | <reponame>dcopm999/pharmcrm2-goods
# Generated by Django 3.2.7 on 2021-10-08 08:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('goods', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='catalog',
... | StarcoderdataPython |
3265596 | <gh_stars>0
import sys
sys.path.append('../modules/')
import matplotlib.pyplot as plt
import numpy as np
import sounddevice as sd
import time
import fsk
import microphone
from sinais import specgram, bandpass
fc = 44100
Bd = 1200
carrier = 1200
N = 500
bandwidth = carrier/2 + carrier*0.1
print('### BAUD {} CARRIER {... | StarcoderdataPython |
44738 | <reponame>Sajaki/intellij-community<gh_stars>1-10
from django import apps
import requests | StarcoderdataPython |
8193048 | <gh_stars>0
#########################################
# File name: Tetris.py #
# Author: <NAME> #
# Course: ICS3U #
# Instructor: <NAME> #
# --------------------------------------#
# Last Modified: 11/12/2017 @ 21:02 #
####################... | StarcoderdataPython |
237729 | import sys
import argparse
import statistics as stat
from config import *
import os
delay = 30
parser = argparse.ArgumentParser('Analysis Plots')
parser.add_argument('--topo',
type=str,
required=True,
help='what topology to generate summary for')
parser.add_argument('--payment-graph-type',
... | StarcoderdataPython |
4804062 | <filename>stu_grade_prediction.py
# -*- coding: utf-8 -*-
"""
@author: Emmanuel
"""
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
import warnings
import time
from sklearn.linear_model import ElasticNet, Lasso, Linear... | StarcoderdataPython |
9758189 | <gh_stars>0
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from Array import Array
def generalSum(lhs, rhs):
return lhs + rhs
#
if __name__ == "__main__":
with open("../rsc/test_val", "r") as fic:
line = fic.readline()
arr = Array(line.split(" "))
processedSum = arr.map(int).reduce(genera... | StarcoderdataPython |
8144896 | <reponame>eyalev/gcloud
# Copyright 2013 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... | StarcoderdataPython |
1952419 | import sys
import argparse
import pandas
import fasttext
import pymorphy2
from sentencepiece import SentencePieceProcessor as sp_processor
from razdel import tokenize
from razdel.substring import Substring
from grammar_ngram_lm import load_grams, make_ngram_correction, make_hypotheses_neni
grams = load_grams()
to... | StarcoderdataPython |
4978117 | <gh_stars>10-100
import os.path
from setuptools import setup, find_packages
setup(
name="eastern",
description="Simple Kubernetes Deployment",
long_description=open(os.path.join(os.path.dirname(__file__), "README.md")).read(),
long_description_content_type="text/markdown",
version="4.5.1",
pac... | StarcoderdataPython |
1986839 | <filename>AART_project/LSTM/DNN.py
from __future__ import print_function
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from scipy import stats
from IPython.display import display, HTML
from sklearn import metrics
from sklearn.metrics import classification_report
from... | StarcoderdataPython |
3298803 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2017-02-23 00:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('programme', '0054_auto_20170212_2334'),
]
operations = [
migrations.AddField(
model_name='programme',
... | StarcoderdataPython |
9715687 | """
Hard-coded
"""
import asyncio
import traceback
from sentry_sdk import capture_exception
import aioredis
from blob import Context
from config import Config
from helpers import userHelper, new_utils
from lib import logger
from objects.constants.BanchoRanks import BanchoRanks
from objects.constants.IdleStatuses impo... | StarcoderdataPython |
6451148 | # Copyright 2016 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | StarcoderdataPython |
5097146 | <gh_stars>10-100
#!/usr/bin/env/python3
import json
import datetime
from collections import namedtuple
QuietTime = namedtuple('QuietTime', 'start end')
def get_quiet_times(filename):
"""
reads a json text file of the form
[
{"start": {"hour": 17, "minute": 17, "second": 0}, "end": {"hour": 17, ... | StarcoderdataPython |
9758347 | """"
usage-
./manage.py builddata load_knowledgebase_csv ~/Documents/Scratch/knowledgebase.csv
Creates derived dataset of constants used by JS frontend. Data is sourced from cla_common.
you can then load the fixture with-
./manage.py loaddata cla_backend/apps/knowledgebase/fixtures/kb_from_spreadsheet.json
"""
from ... | StarcoderdataPython |
8035945 | <filename>src/mypy_structured_data/__init__.py
from mypy.plugin import Plugin
__version__ = "0.1.1"
class StructuredDataPlugin(Plugin):
pass
def plugin(version: str):
# ignore version argument if the plugin works with all mypy versions.
return StructuredDataPlugin
| StarcoderdataPython |
3358002 | from django.db import models
from django.utils import timezone
from django.contrib.auth.models import User
# Create your models here.
class Reference(models.Model):
title = models.CharField(max_length = 250)
description = models.CharField(max_length=250)
## description = models.TextField()
link... | StarcoderdataPython |
6433961 | """
Work command
~~~~~~~~~~~~~~~~~
You get moni
:copyright: (c) 2021-2021 M2rsho
:license: MIT, see LICENSE for more details.
"""
from discord.ext import commands
import discord
from discord.ext.commands.core import is_owner
import support
from discord.ext.commands import cooldown, BucketType
import random
from cogs... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.