id stringlengths 1 7 | text stringlengths 6 1.03M | dataset_id stringclasses 1
value |
|---|---|---|
134355 | <gh_stars>100-1000
# This file is meant to be run inside lldb as a command after
# the attach_linux.dylib dll has already been loaded to settrace for all threads.
def __lldb_init_module(debugger, internal_dict):
# Command Initialization code goes here
# print('Startup LLDB in Python!')
import lldb
try:... | StarcoderdataPython |
1740622 | <gh_stars>0
# Create a SQL alchemy session maker to be used
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
SQLALCHEMY_DATABASE_URL = "postgresql+psycopg2://admin:admin@localhost/pht_conductor"
engine = create_engine(
SQLALCHEMY_DATABASE_URL, # connect_args={"check_same_thread": Fals... | StarcoderdataPython |
1712329 | <filename>test/tutorial/scripts/api/download_data_metadata.py
from dbio.dss import DSSClient
dss = DSSClient()
UUID = "ffffaf55-f19c-40e3-aa81-a6c69d357265"
VERSION = "ffffaf55-f19c-40e3-aa81-a6c69d357265"
# Download the metadata only
dss.download(
bundle_uuid=UUID,
version=VERSION,
replica="aws",
do... | StarcoderdataPython |
3356028 | <reponame>m-star18/atcoder<filename>submissions/abc101/b.py
import math
n = int(input())
n_check = n
num = []
for i in range(int(math.log10(n)+1)+1):
num.append(n % 10)
n /= 10
n -= num[i]/10
if n_check%int(sum(num)) == 0:
ans = 'Yes'
else:
ans = 'No'
print(ans)
| StarcoderdataPython |
3306972 | <filename>website/views.py<gh_stars>10-100
"""
This module registers flask app views.
"""
from flask import Blueprint, render_template
views = Blueprint('views', __name__)
def base() -> str:
"""
Loads the main html template.
---
Args: None
Returns:
base.html: base html template.
"""
... | StarcoderdataPython |
4814902 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Access Missouri model managers for legislative tasks.
"""
from billmanager import BillManager | StarcoderdataPython |
1795851 | <reponame>kykosic/pycats
"""
Pipe type class.
It can be used to fluently sequence computations on any object,
but is especially useful to transform lazily evaluated data, such
as Python generators.
Users of R will find it similar to the dplyr `%>%` operator.
"""
from abc import ABC, abstractmethod... | StarcoderdataPython |
1750544 | <filename>gym_PBN/envs/bittner/base.py<gh_stars>0
"""
This file contains arcane magics.
"""
import copy
import itertools
import pickle
import random
import time
from os import path
import networkx as nx
import numpy as np
from scipy.special import smirnov
class Node:
def __init__(self, index, bittnerIndex, name,... | StarcoderdataPython |
178843 | import requests
import re
from bs4 import BeautifulSoup
from tika import parser
import json
<<<<<<< HEAD
=======
url = "https://www.facebook.com/legal/terms/plain_text_terms"
file_location = "sample.pdf"
>>>>>>> 076b8689d58d090438c3a5b07b32e4972b849093
# Subroutine for webpages
# Proven that it works for facebook (i... | StarcoderdataPython |
3367097 | <gh_stars>0
# -*- coding: utf-8 -*- #
# Copyright 2019 Google LLC. 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
#
# U... | StarcoderdataPython |
1791914 | <gh_stars>1-10
from torch.utils.data import Dataset
class HumanPoseEstimationDataset(Dataset):
"""
HumanPoseEstimationDataset class.
Generic class for HPE datasets.
"""
def __init__(self):
pass
def __len__(self):
pass
def __getitem__(self, item):
pass
def ev... | StarcoderdataPython |
81355 | # -*- encoding: utf-8 -*-
"""
Query the S3 bucket containing Sierra progress reports, and log
a report in Slack
"""
import datetime as dt
import itertools
import json
import os
import boto3
import requests
from interval_arithmetic import combine_overlapping_intervals, get_intervals
def get_matching_s3_keys(s3_clie... | StarcoderdataPython |
3377855 | <reponame>Krish-sysadmin/DjangoPollsApp
from django.apps import AppConfig
class StartingpageConfig(AppConfig):
name = 'startingpage'
| StarcoderdataPython |
3396827 | <filename>registry/donor/models.py<gh_stars>0
from registry.extensions import db
from registry.list.models import DonationCenter, Medals
class Batch(db.Model):
__tablename__ = "batches"
id = db.Column(db.Integer, primary_key=True)
donation_center = db.Column(db.ForeignKey(DonationCenter.id))
imported_... | StarcoderdataPython |
3386864 | <filename>tests/compatability/testng/before_and_after/src/python/run_tests.py
import BeforeAndAfter
from proboscis import TestProgram
if __name__ == '__main__':
# Run Proboscis and exit.
TestProgram().run_and_exit()
| StarcoderdataPython |
4801098 | # TG-UserBot - A modular Telegram UserBot script for Python.
# Copyright (C) 2019 Kandarp <https://github.com/kandnub>
#
# TG-UserBot 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 3 of t... | StarcoderdataPython |
119091 | import unittest
class TestCanary(unittest.TestCase):
def test_add_one_two(self):
self.assertEqual(3, 1 + 2)
| StarcoderdataPython |
4827481 | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | StarcoderdataPython |
495 | <gh_stars>10-100
#!/usr/bin/env python
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from haruhi_dl.aes import aes_decrypt, aes_encrypt, aes_cbc_decrypt, aes_cbc_encrypt, aes_decryp... | StarcoderdataPython |
85663 | """Mark as module for PyTest."""
def left(string, seq=(' ', '\t', '\r', '\n')):
res = ""
for c in string:
if c in seq:
res += c
else:
break
return res
def right(string, seq=(' ', '\t', '\r', '\n')):
return left(reversed(string), seq)
import xml.etree.cElementT... | StarcoderdataPython |
13155 | <reponame>jschmidtnj/cs584
#!/usr/bin/env python3
"""
decoder file
decoder class
"""
import tensorflow as tf
class BahdanauAttention(tf.keras.layers.Layer):
def __init__(self, units):
"""
attention layer from Bahdanau paper
"""
super().__init__()
self.w1 = tf.keras.layers... | StarcoderdataPython |
1602501 | # coding=utf-8
from __future__ import absolute_import, division, print_function
import io
import sys
import os
import struct
from math import floor, log10
from datetime import datetime, timedelta
from collections import OrderedDict
import re
import errno
import dbf
HEADER_SIZE = 0x29
FOOTER_ENTRY_SIZE = 0x19
ENCRYP... | StarcoderdataPython |
157789 | from gtts import gTTS
import os
tts = gTTS(text='temperatura a 30 grados', lang='es')
tts.save('apagado.mp3')
| StarcoderdataPython |
1730481 | '''
单词接龙
字典 wordList 中从单词 beginWord 和 endWord 的 转换序列 是一个按下述规格形成的序列:
序列中第一个单词是 beginWord 。
序列中最后一个单词是 endWord 。
每次转换只能改变一个字母。
转换过程中的中间单词必须是字典 wordList 中的单词。
给你两个单词 beginWord 和 endWord 和一个字典 wordList ,找到从 beginWord 到 endWord 的 最短转换序列 中的 单词数目 。
如果不存在这样的转换序列,返回 0。
'''
from typing import List
class Graph:
def __ini... | StarcoderdataPython |
4822550 | from pprint import pprint
import textfsm
template_file = "ex7_show_int_status.template"
template = open(template_file)
with open("ex7_show_int_status.txt") as f:
raw_text_data = f.read()
re_table = textfsm.TextFSM(template)
data = re_table.ParseText(raw_text_data)
template.close()
print()
new_list = []
keys = r... | StarcoderdataPython |
43374 | <gh_stars>0
# This software was developed by employees of the National Institute of
# Standards and Technology (NIST), an agency of the Federal Government.
# Pursuant to title 17 United States Code Section 105, works of NIST employees
# are not subject to copyright protection in the United States and are
# considered t... | StarcoderdataPython |
4802045 | import numpy as np
def calculate_matrix(Ptran, states, number_processes):
"""Extends a HMM, corresponding to a binary Markov Process,
(i.e. 0 or 1 open channels) to model up until K open channels
by assuming K independent binary Markov processes."""
# Fill in diagonals such that each row sums to 1
... | StarcoderdataPython |
3223016 | statementArr = [
'startSwitch("variableName")',
'endSwitch()',
'''getComment("This is a comment")''',
"puts('Something to print')",
"getClassBeginning('sampleClass')",
"getClassEnding()",
'setVar(valueToGet="1", valueToChange="x")',
'startCase("x")',
'endCase()',
'startDefault()',
'endDefault()',
"equals(th... | StarcoderdataPython |
1667537 | #!/usr/bin/python
#-*- encoding: utf-8 -*-
"""
A Docutils Publisher script for the Legal Resource Registry
"""
import re,os,os.path,sys
try:
import locale
locale.setlocale(locale.LC_ALL, '')
except:
pass
pth = os.path.split(sys.argv[0])[0]
pth = os.path.join(pth,"..")
pth = os.path.abspath(pth)
from doc... | StarcoderdataPython |
103378 | """Project metadata
Information describing the project.
"""
# The package name, which is also the so-called "UNIX name" for the project.
package = 'ecs'
project = "Entity-Component-System"
project_no_spaces = project.replace(' ', '')
version = '0.1'
description = 'An entity/component system library for games'
authors... | StarcoderdataPython |
3356844 | <filename>catana/services/email.py<gh_stars>0
"""Email service"""
import smtplib
from email.mime.text import MIMEText
from catana.core.config import EMAIL, EMAIL_HOST, EMAIL_PASSWORD, EMIAL_HOST_PORT
class Email:
"""Class to send emails to users"""
smtp: smtplib.SMTP
def __init__(self, auth=False):
... | StarcoderdataPython |
1690468 | import sqlite3
from flask import current_app, g # g is a namespace object that can store data during an application context.
def get_db():
if 'db' not in g: # if the object g does not have database, then create a new connection with it
g.db = sqlite3.connect(
current_app.config['DATABASE'], # t... | StarcoderdataPython |
3371515 | """
Executor class.
"""
from __future__ import unicode_literals
import yaml
import subprocess
from voluptuous import Schema
from contextlib import closing
from functools import partial
from six import PY2
from locale import getpreferredencoding
class BaseExecutor(object):
"""
A generic executor class.
... | StarcoderdataPython |
1783979 | <filename>tests/__init__.py<gh_stars>0
"""Unit test package for itpminer."""
| StarcoderdataPython |
3292660 | from operator import getitem
from pendulum import period
def auto_none_days(days, points):
"""Autoincrement don't works days yet with None."""
return points + [None for _ in range(len(days) - len(points))]
def guide(total_points, graph_period):
"""Gerenate guide line with dayoffs."""
def weekday(d... | StarcoderdataPython |
4837826 | <filename>libartipy/geometry/__init__.py<gh_stars>1-10
from .quaternion import Quaternion
from .pose import Pose
from .coordinate_system import CoordinateSystem, CoordinateSystemConverter
from .camera import Camera
| StarcoderdataPython |
4816857 | __author__ = 'n3k'
import os
from FakeTLSServer import WebServerSetup
from Configuration import Configuration
class TestControllerException(Exception):
pass
class TestController(object):
"""
This class is holds a dictionary with singletons per "client_address:hostname"
that holds the tracking for all... | StarcoderdataPython |
3397475 | ID = "channels"
permission = 3
privmsgEnabled = True
def execute(self, name, params, channel, userdata, rank, chan):
channels = ", ".join(self.channelData.keys())
self.sendNotice(name, "I'm currently connected to the following channels: {0}".format(channels)) | StarcoderdataPython |
1731368 | <filename>modules/hub/hub/features/donations/views.py
from datetime import datetime
from dataclasses import dataclass
from typing import List
import string
import requests
from flask import Blueprint, Response, request, url_for, redirect
from flask.views import MethodView
from flask_babelplus import gettext as _
from... | StarcoderdataPython |
3308196 | <gh_stars>0
from words import is_clean
def test_clean():
assert is_clean("snowdrift") is True
assert is_clean("snowdrift's") is False
assert is_clean("Englishes") is False
assert is_clean("steve") is False
assert is_clean("conglomerated") is False
| StarcoderdataPython |
16245 | # -*- coding: utf-8 -*-
# Copyright (c) 2021. Distributed under the terms of the MIT License.
from phonopy.interface.calculator import read_crystal_structure
from phonopy.structure.atoms import PhonopyAtoms
from vise.util.phonopy.phonopy_input import structure_to_phonopy_atoms
import numpy as np
def assert_same_phon... | StarcoderdataPython |
3348546 | # -*- coding: utf-8 -*-
import numpy as np
def eval_onevsall(distmat, q_pids, max_rank=50):
"""Evaluation with one vs all on query set."""
num_q = distmat.shape[0]
if num_q < max_rank:
max_rank = num_q
print('Note: number of gallery samples is quite small, got {}'.format(num_q))
indi... | StarcoderdataPython |
3350491 | from qtpy import QtWidgets
class LabelQListWidget(QtWidgets.QListWidget):
def __init__(self, *args, **kwargs):
super(LabelQListWidget, self).__init__(*args, **kwargs)
self.canvas = None
self.itemsToShapes = []
self.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
... | StarcoderdataPython |
111579 | from functools import reduce
n = int(input())
a = [int(m) for m in input().split()]
def gcd(a,b):
if b == 0:
return a
return gcd(b, a % b)
def gcd_list(numbers):
return reduce(gcd, numbers)
a.sort()
new = [a[0]]
for i in range(1, n):
new.append(a[i] % a[0])
new.sort()
k = gcd_list(new)
for i i... | StarcoderdataPython |
142414 | # coding=utf-8
# Copyright 2019-present, the HuggingFace Inc. team and Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | StarcoderdataPython |
4826614 | '''
Module to perform linear systems calculations
Uses polynomials form numpy:
http://docs.scipy.org/doc/numpy/reference/routines.polynomials.package.html
http://docs.scipy.org/doc/numpy/reference/routines.polynomials.classes.html
History:
12/04/2016 : First version
16/04/2016 : Add of linear frequency response. ... | StarcoderdataPython |
3376925 | import json
from jsonschema import ValidationError, exceptions
from jsonschema.validators import Draft3Validator
from functools import wraps
from flask import _request_ctx_stack, request, jsonify
def _validate(schema, data):
reqv = Draft3Validator(schema)
errors = []
for e in reqv.iter_errors(data):
... | StarcoderdataPython |
1711377 | # Copyright (c) 2019, VMRaid Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import vmraid
from vmraid import _
from functools import wraps
from vmraid.utils import add_to_date, cint, get_link_to_form
from vmraid.modules.import_file import import_file_by_pa... | StarcoderdataPython |
164588 | from openpyxl import load_workbook
xlsx_file = "E:\\hello-git-sourcetree\\R_GO\\Python_RPA\\"
xlsx = load_workbook(xlsx_file+"result.xlsx", read_only =True)
sheet=xlsx.active
print(sheet['A25'].value)
print(sheet['B1'].value)
row = sheet['1']
for data in row:
print(data.value)
xlsx=load_workbook(xlsx_file+"resu... | StarcoderdataPython |
3258185 | from human_services.organizations import models
from common.testhelpers.random_test_values import a_string, a_website_address, an_email_address
class OrganizationBuilder:
def __init__(self):
self.organization_id = a_string()
self.name = a_string()
self.description = a_string()
self.... | StarcoderdataPython |
123995 | # -*- coding: utf-8 -*-
"""
Copyright [2009-2019] EMBL-European Bioinformatics Institute
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... | StarcoderdataPython |
1768738 | <gh_stars>0
grau=int(input())
minuto=int(input())
segundo=int(input())
grausdecimais= grau+(minuto/60)+(segundo/3600)
print(f'graus = {grausdecimais:.4f}')
| StarcoderdataPython |
48898 | # Author : <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 to in writing, software
# d... | StarcoderdataPython |
97158 | # 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.
# Changes ... | StarcoderdataPython |
3234417 | from model import Model
from model import Player
import view as v
import controller as cont
def create_game(options = 'terminal'):
m = create_bare_game()
# Initial positions
pos = create_initial_positions()
m.set_placement(pos)
# Create view
view = create_view(options)
m.set_view(view)
... | StarcoderdataPython |
148936 | import requests
import json
import csv
import os
import LastRead
def api_call(payload):
auth = requests.post("https://api.mangadex.org/auth/login", json=payload)
token = auth.json()["token"]["session"]
bearer = {"Authorization": f"Bearer {token}"}
offset = 0
follow_list = []
initial = {"limit"... | StarcoderdataPython |
137763 | <reponame>jiskra/openmv
# ADC Internal Channels Example
#
# This example shows how to read internal ADC channels.
import time, pyb
adc = pyb.ADCAll(12)
print("VREF = %.1fv VREF = %.1fv Temp = %d" % (adc.read_core_vref(), adc.read_core_vbat(), adc.read_core_temp()))
| StarcoderdataPython |
130269 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def add_91_room_functional_names(apps, schema_editor):
map = {
'Hibiscus': 'Breakout 3',
'South Pacific 2': 'Meeting Room #6',
'South Pacific 1': 'Terminal Room',
... | StarcoderdataPython |
3292664 | <reponame>RichMooreNR/newrelic-lambda-cli
# -*- coding: utf-8 -*-
import click
from newrelic_lambda_cli import utils
from newrelic_lambda_cli.cli import functions, integrations, layers, subscriptions
@click.group()
@click.option("--verbose", "-v", help="Increase verbosity", is_flag=True)
@click.pass_context
def cli... | StarcoderdataPython |
4812775 | <gh_stars>1-10
celsius = float(input("Digite a temperatura em Celsius: \n"))
farenheit = ((1.8 * celsius) + 32)
print("{}ºC correspondem a {:.1f}ºF.".format(celsius, farenheit))
| StarcoderdataPython |
1771482 | <reponame>tosinolawore/py_everything
import sphinx
import python_docs_theme
project = 'py_everything'
copyright = '2021, PyBash'
author = 'PyBash'
release = '2.0.0'
extensions = ['sphinx.ext.autodoc', 'python_docs_theme']
templates_path = ['_templates']
exclude_patterns = []
html_theme = 'python_do... | StarcoderdataPython |
1745531 | <filename>src/LeucipPy/__tests6.py
import WilliamsDivergenceMaker as wdm
import BioPythonMaker as bpm
import GeometryMaker as dfm
import HtmlReportMaker as hrm
import DsspMaker as dm
strucs = bpm.loadPdbStructures([],'Data/',extension='ent',prefix='pdb',log=2)
geo = dfm.GeometryMaker(strucs,log=2)
data = geo.calculate... | StarcoderdataPython |
90420 | <filename>bage_utils/ssh_util.py
import traceback
import warnings
import paramiko
warnings.filterwarnings("ignore")
class SshUtil(object):
"""
- Connect remote by SSH and run specific command.
- See also `bage_util.SellUtil`
"""
def __init__(self, hostname, username=None, password=<PASSWORD>, p... | StarcoderdataPython |
163908 | <reponame>quantmind/lux<filename>lux/core/commands/clear_cache.py<gh_stars>10-100
from lux.core import LuxCommand, Setting
class Command(LuxCommand):
help = "Clear Cache"
option_list = (
Setting('prefix',
nargs='?',
desc=('Optional cache prefix. If omitted the default '... | StarcoderdataPython |
4800365 | <gh_stars>1-10
#!/usr/bin/env python
# coding: utf-8
__author__ = 'whoami'
"""
@version: 1.0
@author: whoami
@license: Apache Licence 2.0
@contact: <EMAIL>
@site: http://www.itweet.cn
@software: PyCharm Community Edition
@file: cpu.py
@time: 2015-11-28 下午1:51
"""
import time
def round_percentage(number,ndigits):
... | StarcoderdataPython |
1668649 | <gh_stars>1-10
from email.utils import formatdate
from datetime import datetime, timedelta
from time import mktime
from django.shortcuts import get_object_or_404
from django.http import HttpResponse, Http404
from molly.utils.views import BaseView
from molly.utils.breadcrumbs import NullBreadcrumb
from models import ... | StarcoderdataPython |
1642586 | import socket
import time
import threading
UDP_IP = "192.168.0.120"
UDP_PORT = 7191
spray_off_msg = b"0-Off"
spray_on_msg = b"1-On"
lighting_msg = "L="
thread_run = True
def listen_for_udp(sock):
global thread_run
sock.connect((UDP_IP, UDP_PORT))
sock.settimeout(2)
while thread_run:
try:
... | StarcoderdataPython |
68472 | <reponame>nouranHnouh/FormusWorkshop-<gh_stars>0
import models
members_data=[models.Member("Nancy",20),
models.Member("Narmdha",27),
models.Member("Mark",33),
models.Member("George",40)]
post_data=[models.Post("python","python is an interpreted high-level programming language",... | StarcoderdataPython |
1651687 | <gh_stars>10-100
# -*- coding: utf-8 -*-
import os
import shutil
import sys
import time
import optparse
import lib.config as config
import lib.vcrparser as vcrparser
# Dynamics load of the workload manager library depending on 'config.mode' value set in lib/config.py
if config.mode == "LSF":
import lib.sys_LSF as ... | StarcoderdataPython |
1616076 | <filename>src/secondaires/peche/commandes/appater/__init__.py<gh_stars>0
# -*-coding:Utf-8 -*
# Copyright (c) 2012 <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions o... | StarcoderdataPython |
68057 | from cart.services.inventory_services import InventoryService
class CartItem:
product_id: int
quantity: int
class ShoppingCart:
id: int
voucher: str
discount_ratio: float
@property
def items(self):
return tuple(self._items)
def __init__(self):
self._items = []
... | StarcoderdataPython |
3363790 | # Copyright 2020 <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 to in writing, softwa... | StarcoderdataPython |
4818096 | import random
class Solution:
def __init__(self, nums):
"""
:type nums: List[int]
"""
self.org = nums
self.aux = nums[:]
def reset(self):
"""
Resets the array to its original configuration and return it.
:rtype: List[int]
"""
re... | StarcoderdataPython |
3289220 | <filename>qiskit/pulse/pulse_lib/samplers/decorators.py
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree o... | StarcoderdataPython |
4806218 | '''
------------------------------------------------------------------------
This file sets parameters for the OG-USA model run.
This module calls the following other module(s):
demographics.py
income.py
txfunc.py
elliptical_u_est.py
This module defines the following function(s):
read_parameter_me... | StarcoderdataPython |
116895 | # coding: utf-8
"""
Consolidate Services
Description of all APIs # noqa: E501
The version of the OpenAPI document: version not set
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from argocd_client.configuration import Configuration
class V1alp... | StarcoderdataPython |
68598 | # -*- coding: utf-8 -*-
from os import popen
class UpdtPyLibs(object):
"""
升级所有第三方有更新的python库到最新版本
"""
@staticmethod
def exec_cmd(cmmd):
"""
执行命令
:param cmmd: str/命令内容
:return: tuple/(boolean, result)
"""
return popen(cmmd).read()
@staticmetho... | StarcoderdataPython |
3291927 | """
Repetition Code Encoder Classes
"""
from typing import Dict, List, Tuple, Optional, Type
from qiskit import QuantumRegister, QuantumCircuit, ClassicalRegister
from qiskit.circuit import Qubit
from qtcodes.circuits.base import (
_Stabilizer,
_TopologicalLattice,
TopologicalQubit,
)
TQubit = Tuple[floa... | StarcoderdataPython |
92546 | <gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import
import six
from .common import ObjectMeta
from ..base import Model
from ..fields import Field, ListField
class LabelSelectorRequirement(Model):
key = Field(six.text_type)
operator = Field(six.text_type)
values =... | StarcoderdataPython |
1683440 | import os
from . import constants
_basedir = os.path.abspath(os.path.dirname(__file__)) # Get this file's directory rather than pwd
for f in os.listdir("{}/scripts".format(_basedir)): # Loop through the scripts folder
filename, file_extension = os.path.splitext(f)
if file_extension and file_extension == ".js... | StarcoderdataPython |
3209377 | <filename>htag/runners/devapp.py
# -*- coding: utf-8 -*-
# #############################################################################
# Copyright (C) 2022 <NAME>[at]gmail(dot)com
#
# MIT licence
#
# https://github.com/manatlan/htag
# #############################################################################
from... | StarcoderdataPython |
1693427 | #import copy
#import re, sys
from collections import defaultdict
#from Queue import Queue
from data_structures import CanonicalDerivation, Edge, RuleInstance
class CanonicalParser(object):
def __init__(self,s):
"""
Takes a sentence and learns a canonical derivation according to the simple grammar... | StarcoderdataPython |
57551 | <reponame>apie/countries_visited
from flask_restless import ProcessingException
from flask import redirect, url_for, request
from flask_login import current_user
from flask_security import Security, auth_required
from visited import app, user_datastore, Visit
security = Security(app, user_datastore)
@security.unauthn... | StarcoderdataPython |
1771301 | <gh_stars>10-100
from __future__ import print_function, division, absolute_import
from pymel.core import curve, delete, revolve
from . import _build_util as util
@util.commonArgs
def build():
p = [ [0, -0.49, 0],
[-0.49, -0.49, 0.49],
[-0.49, 0.49, 0.49],
[0, 0.49, 0] ]
temp = cur... | StarcoderdataPython |
1753649 | from . import users
from .change_password import ChangePasswordForm
from .users import UserForm
from .balance import BalanceForm | StarcoderdataPython |
4801711 | <reponame>shubhamkanungoo007/competitive-programming-solutions<gh_stars>0
ls=[2,33,4,2,1,2]
ls1=[77,66,55,44]
s=ls+ls1
s.sort(reverse=True)
print(s) | StarcoderdataPython |
118087 | # THIS FILE IS AUTO-GENERATED. DO NOT EDIT
from verta._swagger.base_type import BaseType
class UacAction(BaseType):
def __init__(self, service=None, role_service_action=None, authz_service_action=None, modeldb_service_action=None):
required = {
"service": False,
"role_service_action": False,
"a... | StarcoderdataPython |
4822404 | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | StarcoderdataPython |
65840 | <reponame>jonasht/pythonEstudos
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
import sys
class Window(QWindow):
def __init__(self):
QWindow.__init__(self)
self.setTitle('janela')
self.resize(400,300)
app = QApplication(sys.argv)
tela = Window()
tela.sho... | StarcoderdataPython |
85231 | # Generated by Django 2.1.3 on 2018-11-21 01:37
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('product', '0002_auto_20181121_0740'),
]
operations = [
migrations.CreateModel(
name='Apistep',
... | StarcoderdataPython |
140085 | <gh_stars>0
# Copyright 2015 IBM 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 law... | StarcoderdataPython |
137251 | """Test cases for IR generation."""
import os.path
from mypy.test.config import test_temp_dir
from mypy.test.data import DataDrivenTestCase
from mypy.errors import CompileError
from mypyc.common import TOP_LEVEL_NAME
from mypyc.ir.func_ir import format_func
from mypyc.test.testutil import (
ICODE_GEN_BUILTINS, u... | StarcoderdataPython |
161782 | from . import db
from werkzeug.security import generate_password_hash,check_password_hash
from flask_login import UserMixin
from . import login_manager
from sqlalchemy.sql import func
@login_manager.user_loader
def load_user(user_id):
return User.query.get(int(user_id))
class User(UserMixin,db.Model):
__tabl... | StarcoderdataPython |
3290923 | from telas.atualizar import Atualizar
from tkinter import Tk
from tkinter import PhotoImage
from telas.design import Design
from telas.bug import Bug
from telas.splash import Splash
from time import sleep
import util.funcoes as funcoes
import tkinter.font as tkFont
from tkinter import Button
def atualizar():
mast... | StarcoderdataPython |
3351864 | """
wav_prints.py
~~~~~~~~~~
A common collection of print statements for
various file types
"""
import os
import datetime
import getpass
import re
#from reportlab.lib.enums import TA_JUSTIFY
#from reportlab.lib.pagesizes import letter
#from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Image, Ta... | StarcoderdataPython |
1666194 | # Import default libraries
import pandas as pd
import numpy as np
import os
import json
import logging
import argparse
# Import custom libraries
from modules.feature_extraction import *
from modules.feature_preprocessing import *
from modules.pipelines import *
# Set debugging level (default DEBUG)
logging.basicConfig... | StarcoderdataPython |
4804398 | # Copyright 2020 MERA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | StarcoderdataPython |
70533 | <gh_stars>10-100
#!/usr/bin/env python2.7
# Copyright 2016 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Script to check C and C++ file header guards.
This script accepts a list of file or directory arguments. If a gi... | StarcoderdataPython |
51677 | <reponame>canyon289/Theano-PyMC
import numpy as np
import theano
import theano.tensor as tt
import theano.typed_list
from tests.tensor.utils import rand_ranged
from theano import In
from theano.typed_list.basic import Append, Extend, Insert, Remove, Reverse
from theano.typed_list.type import TypedListType
class Test... | StarcoderdataPython |
48913 | <filename>pipy/tests/test_utils.py
import pandas as pd
from pipy.pipeline.utils import combine_series
def test_combine_series():
s1 = pd.Series(dict(zip("AB", (1, 2))))
s2 = pd.Series(dict(zip("BC", (20, 30))))
s3 = combine_series(s1, s2)
pd.testing.assert_series_equal(s3, pd.Series({"A": 1, "B": 20,... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.