id stringlengths 1 7 | text stringlengths 6 1.03M | dataset_id stringclasses 1
value |
|---|---|---|
1656384 | <reponame>elixir-no-nels/nels-core
from tornado import gen
def coroutine_return():
raise gen.Return()
def return_with_status(hndlr, status_code, response_key=None, response_val=None):
hndlr.set_header('Content-Type', 'application/json')
hndlr.set_status(status_code)
if response_key and response_val:
... | StarcoderdataPython |
1766864 | from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
@apphook_pool.register
class BackCallHook(CMSApp):
app_name = "roller_site"
name = "Back call"
_urls = ["rollercms.urls"]
def get_urls(self, page=None, language=None, **kwargs):
return ["rollercms.urls"]
@apphook_pool... | StarcoderdataPython |
3292355 | import torch
from torch import nn
from torch.nn.utils import spectral_norm
from generators.common import blocks
class Wrapper:
@staticmethod
def get_args(parser):
parser.add('--embed_padding', type=str, default='zero', help='zero|reflection')
parser.add('--embed_num_blocks', type=int, default=6... | StarcoderdataPython |
1637090 | from typing import Optional
from discord.ext import commands
from .utils import checks
from .utils.dataIO import DataIO
from discord import Member, Embed, Role, utils
import discord
from datetime import datetime,timedelta
import time
import re
from typing import Union
import json
class Userinfo(commands.Cog):
"""... | StarcoderdataPython |
4814974 | <reponame>zhu4ce4/lianjia
# -*- coding: utf-8 -*-
from peewee import *
import datetime
import settings
if settings.DBENGINE.lower() == 'mysql':
database = MySQLDatabase(
settings.DBNAME,
host=settings.DBHOST,
port=settings.DBPORT,
user=settings.DBUSER,
passwd=settings.DBPAS... | StarcoderdataPython |
1797103 | #!/usr/bin/env python
"""
Compute the DSigma profiles for different lenses
"""
import os
import pickle
from astropy.table import Table
from jianbing import scatter
from jianbing import wlensing
TOPN_DIR = '/tigress/sh19/work/topn/'
# Lensing data using medium photo-z quality cut
s16a_lensing = os.path.join(TOPN_DI... | StarcoderdataPython |
1732672 | import argparse
import sys
import helpers
def preprocess_argv():
# Remove script from argv
argv = sys.argv[1:]
if len(argv):
command_abbreviations = {
'l': 'list',
'u': 'update',
'n': 'new',
'd': 'delete',
'p': 'periods'
}
... | StarcoderdataPython |
20197 | <reponame>rodrigocamposdf/MovieBot<gh_stars>1-10
import movies
def action_handler(action, parameters, return_var):
return_values = {}
if action == 'trendings':
return_values = get_trendings(parameters, return_var)
elif action == 'search':
return_values = search_movies(parameters, return_va... | StarcoderdataPython |
186332 |
import os.path
import sublime_plugin
import sublime
def get_setting(
setting,
default=None,
window=None,
settings_file='OpenHighlightedPath.sublime-settings',
project_settings='open_highlighted_path',
settings_only=False,
project_only=False
):
"""
FIXME: Maybe cache the settings,
... | StarcoderdataPython |
3346503 | import functools
def part1(input_data):
risk_level = 0
height = len(input_data)
width = len(input_data[0])
for j in range(height):
for i in range(width):
cell = input_data[j][i]
if j > 0 and input_data[j - 1][i] <= cell:
continue
if j < heigh... | StarcoderdataPython |
55679 | # coding=utf-8
from __future__ import absolute_import, division, print_function, \
unicode_literals
from .manager import *
from .storages import *
| StarcoderdataPython |
1691594 | <filename>prediction/config.py
"""
prediction.config
~~~~~~~~~~~~~~~~~
Provides the flask config options
"""
import os
from os import path
LIDC_WILDCARD = ['LIDC-IDRI-*', '**', '**']
class Config(object):
PROD_SERVER = os.getenv('PRODUCTION', False)
DEBUG = False
CURRENT_DIR = path.dirname(... | StarcoderdataPython |
134360 | # Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. 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 requ... | StarcoderdataPython |
1651441 | from django.apps import AppConfig
class TurfsConfig(AppConfig):
name = 'turfs'
| StarcoderdataPython |
1706250 | <reponame>LyQuid12/Whitehat-CLI<gh_stars>0
from setuptools import setup, find_packages
import re
with open('README.md') as f:
long_description = f.read()
version = ''
with open('wht/__init__.py') as f:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1)
if not vers... | StarcoderdataPython |
1744412 | import torch
import argparse
# ----- Parser -----
def parser():
PARSER = argparse.ArgumentParser(description='Training parameters.')
# Dataset
PARSER.add_argument('--dataset', default='CelebA', type=str,
choices=['CIFAR10', 'CelebA', 'Imagenette', 'ImageNet32', 'ImageNet64'],
... | StarcoderdataPython |
21480 | <filename>tests/unit/states/test_slack.py
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`<NAME> <<EMAIL>>`
'''
# Import Python libs
from __future__ import absolute_import, unicode_literals, print_function
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit im... | StarcoderdataPython |
3307219 | # -*- coding: utf-8 -*-
import sys
import urwid
import subprocess
import threading
from pyhn.popup import Popup
from pyhn.poller import Poller
from pyhn.config import Config, FALSE_WORDS, TRUE_WORDS
from pyhn import __version__
PY3 = False
if sys.version_info.major == 3:
PY3 = True
if PY3:
from urllib.parse ... | StarcoderdataPython |
1789433 | <filename>sql_gen/test/playground/rewire_verb_compiled.py
def root(context, missing=missing, environment=environment):
resolve = context.resolve_or_missing
undefined = environment.undefined
if 0:
yield None
l_0_adquery = resolve("adquery")
l_0_entity_def_id = resolve("entity_def_id")
l_0... | StarcoderdataPython |
3322422 | from selenium import webdriver
import time
import math
def calc(xx):
return str(math.log(abs(12*math.sin(int(xx)))))
browser = webdriver.Chrome()
try:
link = "http://suninjuly.github.io/alert_accept.html"
browser.get(link)
button = browser.find_element_by_css_selector("button.btn")
button.click(... | StarcoderdataPython |
31800 | <gh_stars>1-10
import cupy as cp
import numpy as np
import pandas as pd
import itertools
import math
import networkx as nx
from gpucsl.pc.kernel_management import get_module
function_names = [
"compact<6,6>",
]
module = get_module("helpers/graph_helpers.cu", function_names, ("-D", "PYTHON_TEST"))
def test_compac... | StarcoderdataPython |
3209225 | import asyncio
import time as ttime
from bluesky_queueserver.manager.task_results import TaskResults
def test_TaskResults_update_uid():
"""
TaskResults: Test that task result UID is updated.
"""
async def testing():
tr = TaskResults()
uid = tr.task_results_uid
assert isinsta... | StarcoderdataPython |
4821329 | <gh_stars>0
import numpy as np
from datasets import load_dataset
from itertools import chain
from gensim.models import KeyedVectors
import pickle
def preprocess_conll_data(dataset, embedding_model, dimensions):
"""
Takes the CoNLL dataset, an embedding model and the dimensionality
of its embeddings as inpu... | StarcoderdataPython |
28777 | from itertools import product
from tools.general import load_input_list
def get_new_active_range(current_active_set, dimensions):
lowest = [0] * dimensions
highest = [0] * dimensions
for point in current_active_set:
for i, coord in enumerate(point):
if coord < lowest[i]:
... | StarcoderdataPython |
155610 | <reponame>rajeevyasarla/3SD<filename>compute_and_plot.py
import os
import torch
from sklearn.metrics import f1_score, precision_score, recall_score
'''from sklearn.metrics import (precision_recall_curve, PrecisionRecallDisplay)
from sklearn.metrics import precision_recall_curve'''
import cv2
import pdb
import numpy as... | StarcoderdataPython |
56963 | import json
import re
import requests
from lxml import etree
def get(url: str) -> dict:
"""
title、imgs、videos
"""
data = {}
headers = {
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25",
... | StarcoderdataPython |
1676052 | from datetime import datetime
import pandas as pd
import googlemaps
def get_data_from_google_api(work, csv1_path):
"""
##################################################################
### This code generates public transportation to a location
### using Google's Directions API.
### __... | StarcoderdataPython |
107384 | # Dummy models.py file to allow for tests to run
from django.db import models
class CCTestModel(models.Model):
name = models.CharField(max_length=10)
age = models.IntegerField()
gender = models.CharField(max_length=10)
price = models.PositiveIntegerField()
discount = models.PositiveIntegerField()
... | StarcoderdataPython |
3204370 | from requests.models import Response
from uuid import UUID
class Experiment(object):
# TODO: fill in from experiment create non-optional members
def __init__(self):
pass
def create_project(name: str) -> Response:
"""Create a project in the Vision API
Args:
name (str): the project ... | StarcoderdataPython |
1611979 | import logging
import json
from io import StringIO
from cliff.command import Command
from cliff.lister import Lister
from cliff.show import ShowOne
from prataiclient import utils
urllib3_logger = logging.getLogger('requests')
urllib3_logger.setLevel(logging.CRITICAL)
logging = logging.getLogger(__name__)
class Fu... | StarcoderdataPython |
4818713 | # Generated by Django 2.2.4 on 2019-08-12 12:51
import uuid
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Database",
fields=[
... | StarcoderdataPython |
169740 | <filename>proj/manageapp/apps.py<gh_stars>0
import django.apps
class AppConfig(django.apps.AppConfig):
name = "proj.manageapp"
lavel = "manageapp"
| StarcoderdataPython |
53578 | from django.shortcuts import render
from django.views.generic import CreateView
from django.urls import reverse_lazy
from dal import autocomplete
# from .models import Country, Person
# from .forms import PersonForm
from .models import Country
from .forms import CountryForm
# Create your views here.
# class PersonCrea... | StarcoderdataPython |
1652126 | <filename>format_apex_log.py
import sublime, sublime_plugin
class FormatApexLogCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.format(edit)
self.foldAllTags()
self.highlightDebugs()
def format(self, edit):
# get all contents of view as a list of lines
... | StarcoderdataPython |
164027 | <filename>apps/cc_cms/admin.py
from django_summernote.admin import SummernoteModelAdmin
from .models import Page, ColumnsSection, Content, DynamicText
class PageAdmin(SummernoteModelAdmin):
summernote_fields = '__all__'
def register_cms(admin_site):
admin_site.register(Page, PageAdmin)
admin_site.regist... | StarcoderdataPython |
3376566 | <filename>plot_dm.py
import matplotlib.pyplot as plt
import numpy as np
import sys
sys.path.append( './pkg' )
import pymod_dm
time = np.loadtxt("res/time.dat")
data = np.loadtxt("res/dm_0.dat")
field = np.loadtxt("res/ef_0.dat")
t = np.loadtxt("res/time.dat")
n_lvl = 3
idx = ['Rr1n1', 'Rr2n2']
dm = pymod_dm.assignD... | StarcoderdataPython |
1610606 | <filename>example/task.py
from bixi.app import App
app = App(node_id='task')
@app.task
async def task_test():
print('task_test')
| StarcoderdataPython |
4830865 | #!/usr/local/bin/python3
#
# roster-checker.py
# cs1570-grader
#
# Created by <NAME> on 05/14/17.
# Copyright 2017. <NAME>. All rights reserved.
#
import sys
import csv
import os
from pprint import pprint
def printError(error):
sys.stdout = sys.stderr
print(error)
sys.exit(1)
def parseRosterFile(filena... | StarcoderdataPython |
1642219 | <filename>infercnvpy/_util.py
import numpy as np
# Determine the right tqdm version, see https://github.com/tqdm/tqdm/issues/1082
try:
import ipywidgets # type: ignore # NOQA
from tqdm.auto import tqdm
except ModuleNotFoundError:
from tqdm import tqdm # NOQA
def _ensure_array(a):
"""If a is a matri... | StarcoderdataPython |
1752683 | pessoas = {}
geral = []
sidade = media = 0
while True:
pessoas.clear()
pessoas['nome'] = str(input('Nome: ')).strip().upper()
while True:
pessoas['sexo'] = str(input('Sexo: [M/F] ')).strip().upper()[0]
if pessoas['sexo'] in 'MF':
break
print ('Digite apenas M ou F')
p... | StarcoderdataPython |
4826316 | from pyquil.parser import parse
from pyquil.api._qac import AbstractCompiler
from pyquil import Program
def parse_equals(quil_string, *instructions):
expected = list(instructions)
actual = parse(quil_string)
assert expected == actual
class DummyCompiler(AbstractCompiler):
def get_version_info(self):... | StarcoderdataPython |
1777878 | class Heap:
def __init__(self, l):
self.tree = l
self.heapify()
def swap(self, idx1, idx2):
value1 = self.tree[idx1]
self.tree[idx1] = self.tree[idx2]
self.tree[idx2] = value1
# O(n)
def heapify(self):
last_parent_index = (len(self.tree) - 2) // 2
... | StarcoderdataPython |
3221972 | <reponame>kuan0020/quickzoom<gh_stars>0
from __future__ import print_function
from datetime import timedelta
import datetime
import time
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
from webdriver_m... | StarcoderdataPython |
4838555 | <filename>newlog.py
from flask import Flask, render_template, request, redirect, url_for
app = Flask(__name__)
str1 = []
@app.route('/input')
def input():
return render_template('input.html')
@app.route('/log', methods=['POST'])
def log():
user = request.form['name']
str1.append(user)
... | StarcoderdataPython |
3368462 | <reponame>swipswaps/signalfx-agent<filename>tests/monitors/telegraf_statsd/telegraf_statsd_test.py<gh_stars>1-10
import re
import time
from functools import partial as p
import pytest
from tests.helpers.agent import Agent
from tests.helpers.assertions import has_datapoint_with_dim, has_datapoint_with_metric_name, reg... | StarcoderdataPython |
3304856 | # blank lines are not displayed
import csv
with open('compresult.csv',"r",newline='\r\n') as fhObj:
cReader = csv.reader(fhObj)
for rec in cReader:
print(rec)
| StarcoderdataPython |
184471 | <gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 31 17:25:51 2017
@author: misaka-wa
"""
# <Test> [preprocessing::BioParser]
from preprocess.BioParser import bio_parse
dataframe = bio_parse('./dssp/sources/1a00.dssp')
AA = dataframe.AA.map(lambda x:x.replace(' ', '')) # amino acid
Structure = dataframe.STRU... | StarcoderdataPython |
3320109 | from django.core.management.base import BaseCommand
from django.db import transaction
from core.models import CategoryCampaing, TagCampaing
from core.models import Campaing, Like, News
from core.models import Reward, Payment, User, Raised
from core.models import Comment, SubComment, Currency
class Command(BaseCommand... | StarcoderdataPython |
151592 | # Generated by Django 4.0 on 2022-06-14 17:34
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('evernote', '0009_note_tag_delete_notehastag'),
]
operations = [
migrations.RenameField(
model_name='note',
old_name='tag',
... | StarcoderdataPython |
1788001 | # Copyright 2017 AT&T Intellectual Property. All other 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 |
3212878 | <gh_stars>0
from SLIX.toolbox import *
class TestToolbox:
def test_all_peaks(self):
# Create an absolute simple peak array
arr = numpy.array([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0])
real_peaks = numpy.argwhere(arr == 1).flatten()
toolbox_peaks = all_peaks(arr, cut_edges=False)
as... | StarcoderdataPython |
1720708 | <reponame>shawwn/cpython
from . import basic, basic2
| StarcoderdataPython |
3294283 | <gh_stars>0
"""
This script runs the FlaskDeepServer application using a development server.
"""
from os import environ
from FlaskDeepServer import app
import logging
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s... | StarcoderdataPython |
3339315 | import numpy as np
import operator
from enum import Enum
import pandas as pd
from os import path
class record:
"""
Cette classe permet d'enregistrer une année d'information.
Les instances de cette classe sont regroupées dans la liste *account.history*. Habituellement l'utilisateur utilisera la fonction de... | StarcoderdataPython |
117594 | import asyncio
# import spec_checker.modules.fast_speedtest as fast
from spec_checker.modules.speedtest_net import Speedtest
from spec_checker.modules.utilities import truncate
# from main import speed_stage
from PyQt5.QtCore import QObject, QThread, pyqtSignal, QTimer
from asyncqt import asyncSlot
import asyncio
impo... | StarcoderdataPython |
3278015 | # -*- coding: utf-8 -*-
import sys
import os
import tty
import termios
import threading
stdoutfd = sys.stdout.fileno()
stdinfd = sys.stdin.fileno()
old_settings = termios.tcgetattr(sys.stdin)
tty.setcbreak(stdinfd)
def rd():
return os.read(stdinfd, 1)
def wr(s):
sys.stdout.write(s)
sys.stdout.flush()
cla... | StarcoderdataPython |
157490 | # 780. Reaching Points
import collections
class Solution:
# brute force: MLE
def reachingPoints(self, sx: int, sy: int, tx: int, ty: int) -> bool:
if sx > tx or sy > ty: return False
q = collections.deque([(sx, sy)])
while q:
cx, cy = q.popleft()
if cx ==... | StarcoderdataPython |
49409 | import unittest
class TestVerilogToEdif(unittest.TestCase):
pass | StarcoderdataPython |
3386577 | import json
with open('academ.geojson') as json_file:
data = json.load(json_file)
for p in data['features']:
a = (p['geometry'])
for tArray in a['coordinates']:
print(tArray)
print(type(tArray))
print(len(tArray))
print(' ')
| StarcoderdataPython |
1740208 | '''
Tests of parameter_plots.py module
'''
import pytest
import os
import numpy as np
import scipy.interpolate as si
import matplotlib.image as mpimg
from ogusa import utils, parameter_plots, income
# Load in test results and parameters
CUR_PATH = os.path.abspath(os.path.dirname(__file__))
base_params = utils.safe_r... | StarcoderdataPython |
58118 | <filename>docker-builds/performance/codeclient.py
import os
import signal
import socket
from time import time, sleep
class CodeClient():
"""This class defines a CodeClient object
Conncects via socket to docker containers in order to compile and execute code.
Attributes:
code (str): The code that ... | StarcoderdataPython |
3327127 | <reponame>astroufsc/python-FLI
#!/usr/bin/python
"""
desc: Setup script for 'FLI' package.
auth: <NAME> (<EMAIL>)
date: 7/25/2012
notes: Install with "python setup.py install".
Requires FLI SDK and Linux Kernel Module
from http://www.flicamera.com/software/index.html
The SDK library should b... | StarcoderdataPython |
165139 | from resources import resource_log_group as re_log_group
from resources import resource_log_stream as re_log_stream
from resources import resource_log_event as re_log_event
from resources import resource_names as re_names
from contents import contents_json as ct
from s3 import s3_class as s3
import boto3... | StarcoderdataPython |
3219967 | <reponame>IINemo/isanlp_srl_framebank
import multiprocessing as mp
import numpy as np
ARG_SPECIAL_TAG = 'ARGSPECIAL'
PRED_SPECIAL_TAG = 'PREDSPECIAL'
def make_embeded_form(word):
if word:
# return word[1].encode('utf8')
return u"{}_{}".format(word[1], word[0])
else:
return word
class ... | StarcoderdataPython |
84586 | <reponame>mrcsantos1/pySEP
import tkinter as tk
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
<<<<<<< HEAD
=======
import networkx as nx
<<<<<<< HEAD
from PIL import Image, ImageTk
>>>>>>> 61cee31 (logo adicionada)
=======
>>>>>>> c68287f (cál... | StarcoderdataPython |
138126 | <gh_stars>1-10
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/Users/blogin/Projects/dash-masternode-tool/src/ui/ui_revoke_mn_dlg.ui.autosave'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidget... | StarcoderdataPython |
18995 | """
The system RoBERTa trains on the AGB dataset with softmax loss function.
At every 1000 training steps, the model is evaluated on the AGB dev set.
"""
from torch.utils.data import DataLoader
from sentence_transformers import models, losses
from sentence_transformers import SentencesDataset, LoggingHandler, Sentence... | StarcoderdataPython |
1703950 | <reponame>audacious-software/Simple-Messaging-Dialog-Engine-Support
def quicksilver_tasks():
return [
('simple_messaging_send_pending_messages', '--no-color', 5,),
('nudge_active_sessions', '--no-color', 10,),
]
| StarcoderdataPython |
3271451 | <gh_stars>0
from pyjenkins.job import Job, JobStatus
class Jenkins(object):
def __init__(self):
self._jobs_rota = [[Job('spam', JobStatus.OK),
Job('eggs', JobStatus.OK)],
[Job('spam', JobStatus.FAILING),
Job('eggs', JobSta... | StarcoderdataPython |
85922 | <reponame>sethvargo/vaex
import numpy as np
import pyarrow as pa
import pytest
from typing import Any, Optional, Tuple, Dict, Iterable, Sequence
DataFrameObject = Any
ColumnObject = Any
import vaex
from common import *
from vaex.dataframe_protocol import _from_dataframe_to_vaex, _DtypeKind, _VaexBuffer, _VaexColumn, ... | StarcoderdataPython |
3269546 | <filename>devices/help_button/help_button.py
# -*- coding: utf-8 -*-
import RPi.GPIO as GPIO
from time import sleep
from call_client import CallClient
RED_LED_GPIO = 4
RED_TACT_GPIO = 17
GPIO.setmode(GPIO.BCM)
GPIO.setup(RED_LED_GPIO, GPIO.OUT)
GPIO.setup(RED_TACT_GPIO, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
is_call... | StarcoderdataPython |
1746806 | <reponame>jearistiz/guane-intern-fastapi<gh_stars>10-100
from app.config import sttgs
from app.utils.http_request import post_to_uri
def test_post_to_uri():
task_complexity = 0
task_query_url = (
sttgs.get('GUANE_WORKER_URI') + f'?task_complexity={task_complexity}'
)
response = post_to_uri(
... | StarcoderdataPython |
3362651 | from __future__ import annotations
from numpy import array, ndarray
class UGridNetwork1D:
"""This class is used for define/put/inquire/get Network1D data
Attributes:
name (str): The network name.
node_x (ndarray): The x-coordinates of the network node.
node_y (ndarray): The y-coordin... | StarcoderdataPython |
4816151 | #-*- coding: utf-8 -*-
try:
import requests
import os.path
import time
import sys
except ImportError:
exit("install requests and try again ...")
import os
os.system ("clear")
banner = """
\033[31m █████╗ ██╗ ██╗██████╗ \033[0m Author :\033[93m <NAME> Z\033[0m
\033[31m ██╔══██╗╚██╗██╔╝██╔══██╗\0... | StarcoderdataPython |
140606 | <gh_stars>0
# Generated from APi.g4 by ANTLR 4.9
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys
def serializedATN():
with StringIO() as buf:
buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\63")
buf.write("\u018f\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5... | StarcoderdataPython |
3271523 | <gh_stars>0
from typing import Optional
from pydantic import BaseModel, Extra
from .http_bindings import HttpServerBinding
from .web_sockets_bindings import WebSocketsServerBinding
from .kafka_bindings import KafkaServerBinding
from .anypoint_mq_bindings import AnypointMqServerBinding
from .amqp_bindings import AmqpS... | StarcoderdataPython |
4802078 | <gh_stars>1-10
import asyncio
import background
asyncio.run(background.connect())
| StarcoderdataPython |
90182 | <reponame>bevrand/bevrand
import subprocess
import json
import time
import argparse
parser = argparse.ArgumentParser(description='Create a docker-compose file based on arguments given')
tests_action_arg = parser.add_argument('--tests', type=str, default='component_tests',
help='Te... | StarcoderdataPython |
26523 | <gh_stars>0
#!env/bin/python3
from app import app
app.run(debug=True, host="localhost", port=8202)
| StarcoderdataPython |
3278262 | <filename>djaludir/core/tests/models/test_privacy.py
from django.conf import settings
from django.test import TestCase
from djaludir.core.models import Privacy
from djtools.utils.logging import seperator
class CorePrivacyTestCase(TestCase):
fixtures = ['user.json', 'privacy.json']
def setUp(self):
... | StarcoderdataPython |
3399678 | <gh_stars>1-10
import opensim as osim
from osim.http.client import Client
from osim.env import ProstheticsEnv
import os
import time
from collections import deque
import pickle
from baselines.ddpg.models import Actor, Critic
from baselines.ddpg.memory import Memory
from baselines.ddpg.ddpg import DDPG
import baselines.... | StarcoderdataPython |
199475 | from flask import Flask, request, redirect, render_template, session, flash
from mysqlconnection import MySQLConnector
import datetime
import re
app = Flask(__name__)
app.secret_key = "ThisIsSecret!"
mysql = MySQLConnector(app,'full_friends_db')
DATE_REGEX = re.compile(r'^(1[0-2]|0[1-9])/(3[01]|[12][0-9]|0[1-9])/[0-9... | StarcoderdataPython |
1668069 | <reponame>YahooArchive/ZooChiefs
#!/usr/bin/env python
# Copyright (C) 2012 Yahoo! 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://ww... | StarcoderdataPython |
1699361 | <filename>ABC124/C.py
s = list(input())
o0, o1, e0, e1 = 0,0,0,0
for i in range(len(s)//2):
if s[i*2] == "0":
o0 += 1
elif s[i*2] == "1":
o1 += 1
if s[i*2+1] == "0":
e0 += 1
elif s[i*2+1] == "1":
e1 += 1
if len(s)%2 == 1:
if s[len(s)-1] == "0":
o0 += 1
el... | StarcoderdataPython |
91597 | from .dosed1 import DOSED1
from .dosed2 import DOSED2
from .dosed3 import DOSED3
__all__ = [
"DOSED1",
"DOSED2",
"DOSED3",
]
| StarcoderdataPython |
1774989 | import audio.audioHandler as audio
import numpy as np
import matplotlib.pyplot as plt
import csv
import time
from app.supression.spectralSubtraction import spectralSubtraction
from app.supression.fastLMS import fastLMS
from app.supression.plca import plcaWavelet
def runTests():
audioPrefix = 'audio_files/'
r... | StarcoderdataPython |
41722 | class BaseServerException(Exception):
def __init__(self, detail, status_code, message):
super().__init__(message)
self.detail = detail
self.status_code = status_code
class SearchFieldRequiered(BaseServerException):
def __init__(self):
super().__init__(detail='entity', status_co... | StarcoderdataPython |
3379749 | """Resource view class containing all logic for creating, checking, and updating resource views."""
import logging
from os.path import join
from typing import Any, Dict, List, Optional, Union
from hdx.utilities.uuid import is_valid_uuid
from hdx.api.configuration import Configuration
from hdx.data.hdxobject import HD... | StarcoderdataPython |
3363525 | <reponame>98llm/tir-script-samples
#//-------------------------------------------------------------------
#/*/{Protheus.doc} MATA037
#
#@author carlos.capeli
#@since 13/11/2019
#@version P12
#/*/
#//-------------------------------------------------------------------
from tir import Webapp
import unittest
import time
c... | StarcoderdataPython |
72877 | <reponame>vo0doO/pydj-persweb<filename>authentication/socialaccount/providers/foursquare/urls.py
from authentication.socialaccount.providers.oauth2.urls import default_urlpatterns
from .provider import FoursquareProvider
urlpatterns = default_urlpatterns(FoursquareProvider)
| StarcoderdataPython |
3316792 | import settings
import handlers.base_handler
import csv
class CartogramHandler(handlers.base_handler.BaseCartogramHandler):
def get_name(self):
return "Myanmar"
def get_gen_file(self):
return "{}/mmr_processedmap.json".format(settings.CARTOGRAM_DATA_DIR)
def validate_values(self, val... | StarcoderdataPython |
33031 | <filename>tests/test_primary_beams.py<gh_stars>1-10
"""Unit tests for testing support
"""
import logging
import os
import unittest
import numpy
from astropy import units as u
from astropy.coordinates import SkyCoord
from arl.data.polarisation import PolarisationFrame
from arl.image.operations import export_image_t... | StarcoderdataPython |
3360833 | <reponame>MaineKuehn/classad
"""
Literal constants: integer, float, string, boolean, error, or undefined
"""
from typing import Union
from classad._base_expression import PrimitiveExpression
class Undefined(PrimitiveExpression):
"""
The keyword ``UNDEFINED`` (case insensitive) represents the ``UNDEFINED`` va... | StarcoderdataPython |
136383 | import sqlalchemy as sa
from .exc import ClassNotVersioned, ImproperlyConfigured
from .manager import VersioningManager
from .operation import Operation
from .transaction import TransactionFactory
from .unit_of_work import UnitOfWork
from .utils import (
changeset,
count_versions,
get_versioning_manager,
... | StarcoderdataPython |
1776294 | import mailpile.app
import mailpile.commands
import mailpile.ui
# Load the standard plugins
from mailpile.plugins import *
__all__ = ['Mailpile',
"app", "commands", "plugins", "mailutils", "search", "ui", "util"]
class Mailpile(object):
"""This object provides a simple Python API to Mailpile."""
def ... | StarcoderdataPython |
1791513 | <filename>redap/specs/group/one.py
# -*- coding: utf-8 -*-
from . import get_group_spec, def_group, param_path
response_def = {
'definition': def_group,
'response': {
"description": "Single group",
"schema": {
"$ref": "#/definitions/Group"
}
}
}
data = get_group_spec(
... | StarcoderdataPython |
1765961 | # Copyright (c) 2015-2019 by the parties listed in the AUTHORS file.
# All rights reserved. Use of this source code is governed by
# a BSD-style license that can be found in the LICENSE file.
# import functions into our public API
from .tod import TOD, TODCache
from .interval import Interval, OpFlagGaps
from .tod_... | StarcoderdataPython |
3379047 | <gh_stars>1-10
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
from torch.optim.lr_scheduler import StepLR
import torchvision
import torchvision.transforms as transforms
from torchvision import models
import tensorly as tl
import tens... | StarcoderdataPython |
4837407 | import argparse
import requests
import json
import logging
queries = {}
def load_queries():
global queries
with open("queries.json", 'r') as f:
queries = json.load(f)
def dump_all():
for lang in queries.keys():
dump(lang)
def dump(lang):
""" dumps """
logging.info("Saving properti... | StarcoderdataPython |
3311504 | # _*_ coding: utf-8 _*_
"""
Created by Alimazing on 2018/4/2.
"""
import os
__author__ = 'Alimazing'
is_dev_mode = os.path.exists('app/config/dev.py') # 'development' & 'product' (开发环境 or 生产环境)
TOKEN_EXPIRATION = 30 * 24 * 3600
EXTERNAL_URL = 'api.ivinetrue.com' # 外部(远程)地址
INTERNAL_URL = '0.0.0.0:8080' # 内部(本地)地址
... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.