id stringlengths 2 8 | text stringlengths 16 264k | dataset_id stringclasses 1
value |
|---|---|---|
382508 | <reponame>x-web/social-network-user-influence-analysis
#!/usr/bin/python
# coding: utf-8
# nlp process of twitter data using nltk package
__author__ = "x-web"
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
from nltk.stem.lancaster import LancasterStemmer
import re
inputf = open('tweets.txt... | StarcoderdataPython |
12836350 | from . import submodule # noqa: F401
| StarcoderdataPython |
9796121 | a=[]
n=int(input("size ??"))
for i in range(n):
data=int(input("enter the data..."))
a.append(data)
print(a)
a.sort()
print("after sorting..",a)
| StarcoderdataPython |
6413273 | """
03: Fitting Algorithm
=====================
A step-by-step overview of the algorithm for parameterizing neural power spectra.
"""
###################################################################################################
# Algorithmic Description
# -----------------------
#
# In this tutorial we will ste... | StarcoderdataPython |
1801679 | import sys
import pygame
import random
from settings import Settings
from game_stats import GameStats
from wizard import Wizard
from info import Info
from item import Item
from inventory import Inventory
from inventory_window import InventoryWindow
class WizardsBroth:
"""Overal class to manage game assist and beh... | StarcoderdataPython |
8145419 | from bs4 import BeautifulSoup
import requests
from selenium import webdriver
import time
import json
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
import os
import urllib.request
from tqdm import tqdm
import datetime
caps = DesiredCapabilities.CHROME
caps['goog:loggingPrefs'] = {'perfo... | StarcoderdataPython |
5082175 |
from calculo import Mathik
import pytest
class Test_Bhaskara:
@pytest.fixture
def mat(self):
return Mathik()
# dados parametrizados
testdata = [( 1, -2, 1, 1, 1, ''),
( 1, -5, 6, 2, 3, 2),
(10, 10, 10, 0,'', ''),
(10, 20, 10, 1, ... | StarcoderdataPython |
9680364 | import os
import numpy as np
from rho_factor.gen_rho import generate_rho_values as g
gg = g.generate()
gg.azi = np.linspace(0, 180, 13)
gg.sza = np.linspace(0, 80, 21)
gg.vza = np.linspace(0, 80, 17)
gg.execute()
| StarcoderdataPython |
1893832 | import json, os
PATH_ABS = os.path.abspath('.')
if os.environ.get('CONF_PATH') is None:
CONF_PATH = "../../config"
else:
CONF_PATH = os.environ.get('CONF_PATH')
PATH_CONF = os.path.join(PATH_ABS , CONF_PATH)
with open(os.path.join(PATH_CONF, "abi.json")) as file:
ABIS = json.load(file)
with open(os.pat... | StarcoderdataPython |
3262480 | <filename>lifted_hgp.py
import numpy as np
import ldpc.protograph as pt
from bposd.css import css_code
from bposd.stab import stab_code
def I(n):
return pt.identity(n)
class lifted_hgp(css_code):
def __init__(self,lift_parameter,a,b=None):
'''
Generates the lifted hypergraph product of the p... | StarcoderdataPython |
1926971 | from typing import List, Tuple
from sqlalchemy import desc, asc
class TrainingDataManager(object):
def __init__(self, table_type):
self._table_type = table_type
self._session = None
def new_training_data(self) -> List[Tuple[bytes]]:
return self._session.query(self._table_type.text).fi... | StarcoderdataPython |
6581078 | <filename>module/monsters.py<gh_stars>1-10
import json
import random
from module import db
import copy
with open('../assets/monsters.json', encoding='utf-8') as f:
monsters = json.load(f)
def init():
global monsters
if all(i.isdecimal() for i in monsters.keys()):
return
for m_key in monsters[... | StarcoderdataPython |
11200952 | <filename>tests/wrap/test_simple_soil_elements.py<gh_stars>10-100
import numpy as np
import o3seespy.extensions
import o3seespy as o3
import pytest
def test_2d_site_period():
osi = o3.OpenSeesInstance(ndm=2, ndf=2, state=3)
# Establish nodes
node_depths = np.arange(0, 10, 1)
n_node_rows = len(node_dep... | StarcoderdataPython |
4947837 | <filename>novice/02-02/latihan/tes_sum2.py
def test_sum():
assert sum([1, 2, 3]) == 6, 'should be 6'
def test_sum_tuple():
assert sum((1, 2, 2)) == 5, 'should be 6'
if __name__=='__main__':
test_sum()
test_sum_tuple()
print('everyting passed') | StarcoderdataPython |
9738190 | <reponame>liubaishuo-github/peening-post-processor
import datetime
dt = datetime.datetime.now()
print(type(dt))
print(dt)
time_str = dt.strftime('%b-%d-%Y %H:%M:%S')
print(time_str)
| StarcoderdataPython |
11296133 | <reponame>swederik/structurefunction
from nipype.interfaces.base import (BaseInterface, traits,
File, TraitedSpec, InputMultiPath,
isdefined)
from nipype.utils.filemanip import split_filename
import os.path as op
import numpy as np
import nibabel a... | StarcoderdataPython |
3529768 | <filename>Python3-Learn/spongebob.py
from turtle import *
def go_to(x, y):
up()
goto(x, y)
down()
def head():
go_to(-200, 180)
fillcolor('yellow')
begin_fill()
seth(-30)
for i in range(6):
circle(36, 60)
circle(-36, 60)
seth(-125)
for i in range(... | StarcoderdataPython |
5001973 | from typing import Dict, List
import numpy as np
from numpy.testing import assert_equal
import pandas as pd
from pandas.testing import assert_frame_equal
import pytest
import altair_transform
@pytest.fixture
def data() -> pd.DataFrame:
return pd.DataFrame(
{
"x": [[1, 2, 3], [4, 5, 6, 7], [8... | StarcoderdataPython |
4963467 | <filename>lollylib/test.py
import unittest
import os
import sys
import ntpath
def run(test_name='all'):
loader = unittest.TestLoader()
head, tail = ntpath.split(os.path.realpath(__file__))
sys.path.append(head)
start_dir = head + '/tests'
if test_name == 'all':
suite = loader.discover(star... | StarcoderdataPython |
1728089 | <filename>tmp/utils/thread.py
import threading
class MyThread(threading.Thread):
def __init__(self, func, *args, **kwargs): # 改变线程的使用方式,可以直接传递函数方法和函数参数
super(MyThread, self).__init__()
self.func = func
self.args = args
self.kwargs = kwargs
self.result = None
def run(s... | StarcoderdataPython |
8018850 | <gh_stars>1-10
def flatten(*args):
return helper(args, [])
def helper(args, res):
for i in args:
if isinstance(i, list):
helper(i, res)
else:
res.append(i)
return res | StarcoderdataPython |
1789544 | <reponame>ATMackay/bsv-x509<gh_stars>0
# This programme contains functions and classes for secp256k1 elliptic curve cryptography
import numpy as np
import hashlib
import random
from getpass import getpass
#Hard coded varaibles
# secp256k1 parameters
secp_G = [int("79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F281... | StarcoderdataPython |
5153741 | <reponame>Tamlyn78/geo
from django.apps import AppConfig
class JobConfig(AppConfig):
name = 'job'
| StarcoderdataPython |
329378 | import logging
import time
from datetime import datetime as dt
import pytz
from colorfield.fields import ColorField
from django.contrib.auth.models import Group
from django.contrib.gis.db import models
from django.core.validators import MinValueValidator, MaxValueValidator
from django.urls import reverse
from django.u... | StarcoderdataPython |
8001396 | <gh_stars>0
from time import time
import torch
import numpy as np
from abc import ABC, abstractmethod
# tensorboard stuff
from torch.utils.tensorboard import SummaryWriter
# my libraries
from .util import utilities as util_
from . import losses as ls
from . import cluster
BACKGROUND_LABEL = 0
TABLE_LABEL = 1
OBJECT... | StarcoderdataPython |
339675 | # Copyright (c) 2021 Graphcore Ltd. All rights reserved.
"""Auto diff transformation."""
from enum import Enum
from typing import Iterable, List, Mapping, Optional, Tuple
import popart._internal.ir as _ir
from popart.ir.graph import Graph
from popart.ir.tensor import Tensor
from popart.ir.ops.call import CallInfo
__a... | StarcoderdataPython |
4968413 | import re
class EncodedStringFilter:
def __init__(self, \
min_encoded_string_length_inclusive=1, \
max_encoded_string_length_exclusive=1000, \
encoded_string_ignore_filter_regex="^$"):
if min_encoded_string_length_inclusive < 0:
raise ValueError("""min_encoded_string_... | StarcoderdataPython |
252089 | <reponame>Zazmuz/random_programs
import time
# God---------------------------------------------------------------------------------------
#
# try_out = ["In the beginning", "God created the heavens and the earth"]
# timed_try = 0
# holy_number = 3-0.333-0.333-0.333-0.333-0.333
# repeat = 0... | StarcoderdataPython |
5124819 | # -*- encoding: utf-8 -*-
#
# Copyright 2014 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | StarcoderdataPython |
1784678 | import base64
import hmac
import hashlib
import time
import requests
import urllib
class azureiot:
API_VERSION = '2016-02-03'
TOKEN_VALID_SECS = 10
TOKEN_FORMAT = 'SharedAccessSignature sig=%s&se=%s&sr=%s'
def __init__(self, connectionString=None):
if connectionString !=... | StarcoderdataPython |
115737 | <gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import gym
gym.register(
id='GridWorld-v1',
entry_point='simple_grid:MyGridWorld1',
max_episode_steps=200,
reward_threshold=100.0
)
from skinner import FiniteSet
from objects import Robot, NeuralRobot
class MyRobot(Robot):
"""there... | StarcoderdataPython |
5095984 | import ply.yacc as yacc
import ply.lex as lex
from etcdb import PARSER_LOCK
from etcdb.sqlparser import etcdb_lexer
from etcdb.sqlparser.sql_tree import SQLTree
# noinspection PyUnresolvedReferences
from etcdb_lexer import tokens
precedence = (
('left', 'AND', 'OR'),
('right', 'UNOT'),
)
def p_statement(p)... | StarcoderdataPython |
5090843 | <reponame>al-arz/the-tale<gh_stars>10-100
from aiohttp import web
from tt_web import log
from tt_web import postgresql
from . import operations
async def on_startup(app):
await postgresql.initialize(app['config']['database'])
await operations.initialize_timestamps_cache()
async def on_cleanup(app):
... | StarcoderdataPython |
3496489 | import types
import synapse.common as s_common
from synapse.eventbus import EventBus
class Task(EventBus):
'''
A cancelable Task abstraction which operates much like a Future
but with some additional features.
'''
def __init__(self, iden=None):
EventBus.__init__(self)
if iden is ... | StarcoderdataPython |
5085040 | from parsy import generate, match_item, test_item
class Command:
def __init__(self, parameter):
self.parameter = parameter
def __repr__(self):
return "{0}({1})".format(self.__class__.__name__, self.parameter)
class Forward(Command):
pass
class Backward(Command):
pass
class Right... | StarcoderdataPython |
219803 | <filename>src/alembic/versions/15ea3c2cf83d_pr_comment_editing.py
"""Adding column to store edited_by and edited_on a PR comment
Revision ID: 15ea3c2cf83d
Revises: <PASSWORD>
Create Date: 2015-11-09 16:18:47.192088
"""
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<PASSWORD>'
from ale... | StarcoderdataPython |
4918774 | from dataclasses import dataclass, field
from enum import Enum
from typing import Optional
from xsdata.models.datatype import XmlPeriod
__NAMESPACE__ = "NISTSchema-SV-IV-union-gMonthDay-gYearMonth-enumeration-5-NS"
class NistschemaSvIvUnionGMonthDayGYearMonthEnumeration5Type(Enum):
VALUE_05_07 = XmlPeriod("--05-... | StarcoderdataPython |
3468804 | <gh_stars>0
# Generated by Django 3.1.1 on 2020-12-15 10:20
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django_countries.fields
import stdimage.models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operati... | StarcoderdataPython |
3584627 | import psycopg2, multiprocessing
from dbconfig import chitanka_dbname, chitanka_dbuser, chitanka_dbpassword
import os
import re, nltk
from pathlib import Path
import requests, os,re
import glob
def importData(start, end):
my_dirs = glob.glob("../books/*")
my_dirs.sort()
try:
connection = psycopg2.... | StarcoderdataPython |
3585218 | #!/usr/bin/env python
#
# Copyright 2019 <NAME>, S.A.
#
# 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 |
9641542 | <reponame>RadarSun/SUSTech-EC2021-A3<filename>main2.py
import numpy as np
from cec2013.cec2013 import *
from modules2 import *
import argparse
import time
def run(func_id):
f = CEC2013(func_id)
D = f.get_dimension()
pop_size = 16 * D
archive = np.empty((0, D))
evaluation_remaind_cnt = f.get_maxfes(... | StarcoderdataPython |
9662683 | <reponame>ajstewart/tkp
import logging
import tkp.db
import tkp.db.quality as dbquality
from tkp.quality.restoringbeam import beam_invalid
from tkp.quality.rms import rms_invalid, rms_with_clipped_subregion
from tkp.telescope.lofar.noise import noise_level
from tkp.utility import nice_format
logger = logging.getLogger... | StarcoderdataPython |
4816463 | #!/usr/bin/env python
#pylint: skip-file
from __future__ import print_function
import itertools
import pytest
import types
from .util import RandomComplexString, RandomIP
class Test_PreferenceFlags(object):
def test_DecodeFlags(self):
print()
from pyirobot import CarpetBoost, CleaningPasses, Fin... | StarcoderdataPython |
12841231 | <reponame>easyCZ/UoE-Projects
#!/usr/bin/python
# aggregate-combiner.py
import sys
answers = []
last_user_id = None
MEM_THRESHOLD = 1024 * 1024 * 1024 # 1 GB
def write(user, entries):
if len(entries) > 0:
print('{0}\t{1}'.format(user, ','.join(entries)))
for line in sys.stdin:
user_id, answer_id = l... | StarcoderdataPython |
4979746 | <gh_stars>0
import logging
import os
from galaxy.model.orm import and_
from tool_shed.util import hg_util
from tool_shed.util import shed_util_common as suc
log = logging.getLogger( __name__ )
class ToolVersionManager( object ):
def __init__( self, app ):
self.app = app
def get_tool_version( self... | StarcoderdataPython |
9680546 | # -*- coding: utf-8 -*-
"""
Unit tests for dim transforms
"""
from __future__ import division
import numpy as np
from holoviews.core.data import Dataset
from holoviews.element.comparison import ComparisonTestCase
from holoviews.util.transform import dim
class TestDimTransforms(ComparisonTestCase):
def setUp(se... | StarcoderdataPython |
5130046 | <filename>django_photo_gallery/app/migrations/0008_auto_20180820_2032.py<gh_stars>0
# Generated by Django 2.0.4 on 2018-08-20 20:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0007_auto_20180817_1423'),
]
operations = [
migra... | StarcoderdataPython |
6656619 | # -*- coding: utf-8 -*-
from util import Log
def remove(absFilePath, realPath = ''):
with open(absFilePath, "rb") as tmpFile:
content = tmpFile.read()
if len(content) < 3:
return 0
if content[0:3] == b'\xef\xbb\xbf':
content = content[3:]
with open(absF... | StarcoderdataPython |
1687427 | import os
from collections import defaultdict
"""
Run from actual_data directory to get the average runtimes for each actual data test
"""
files_for_avg = 3
valid_strs = ["data{0}.acp".format(i) for i in range(1, files_for_avg + 1)]
def is_file_path_valid_str(path):
for valid_str in valid_strs:
try:
... | StarcoderdataPython |
6480061 | <filename>unit.py
import database as d
import jobs as j
import incubator as inc
import bigData as big
import staff
import copy
import math
#Not all units, but all units you can create (no house, church)
def all_units():
unit_list = [Farm, Mill, Brewery, Bakery, Lumberyard, Joinery]
return unit_list
#units us... | StarcoderdataPython |
3278789 | from PySide.QtCore import *
from PySide.QtGui import * # importo todas las funciones de pyside
class MatrixDialog(QDialog):
def __init__(self, ValoresIniciales, parent=None):
super(MatrixDialog, self).__init__(parent)
self.setGeometry(QRect(100, 100, 600, 200))
Matrix = QTableWidget(len(V... | StarcoderdataPython |
4826717 | <gh_stars>1-10
from abc import abstractmethod
from pathlib import Path
from titlecase import titlecase
from modules.ImageMaker import ImageMaker
class CardType(ImageMaker):
"""
This class describes an abstract card type. A CardType is a subclass of
ImageMaker, because all CardTypes are designed to create... | StarcoderdataPython |
227642 | <filename>setup.py<gh_stars>0
from setuptools import setup
setup (name = 'python_slack_client',
packages = ['python_slack_client'],
version = '0.0.1',
author = '<NAME>',
author_email = '<EMAIL>',
url = 'https://github.com/Geam/python_slack_client',
description = 'Slack client for terminal write... | StarcoderdataPython |
1628503 | from flask import session
from collections import UserDict
class SessionCredentialStore(UserDict):
def __init__(self):
super().__init__()
self.session = session
def __setitem__(self, key, value):
self.session[key] = value
def __getitem__(self, key):
return self.session[ke... | StarcoderdataPython |
239103 |
import sqlite3
import os
import time
import logging
import datetime
from sys import argv
from sl_signature import SL_Signature
'''
@author:jzf
@date: 2019-11-20
@desc: 仓库模块
'''
LOG_FORMAT = "%(asctime)s - %(levelname)s - %(message)s"
#logging.basicConfig(filename='Storage.log', level=logging.DEBUG, format=LOG_FORMAT)... | StarcoderdataPython |
3258475 | <filename>tick/survival/sccs/__init__.py
# License: BSD 3 clause
import tick.base
from .batch_convolutional_sccs import BatchConvSCCS
from .stream_convolutional_sccs import StreamConvSCCS
__all__ = [
"BatchConvSCCS", "StreamConvSCCS"
]
| StarcoderdataPython |
6475959 | <filename>sgr_analysis/sapt/helpers.py<gh_stars>0
"""helpers.py: Functions for parsing data from SAPT0 and ALMO output
files."""
import os.path
import re
import numpy as np
import pandas as pd
from pandas.util.testing import assert_frame_equal
import scipy.stats as sps
from sgr_analysis.analysis_utils import make_f... | StarcoderdataPython |
37760 | from rest_framework import serializers
class ProductSerializer(serializers.Serializer):
product = serializers.ListField(
child=serializers.CharField(max_length=200))
| StarcoderdataPython |
5157532 | # script for running parameter scans of agent based simulation
import os.path, sys
sys.path.append('../lib/')
import numpy as np
from evolimmune import (from_tau, mus_from_str, cup_from_str,
agentbasedsim_evol, zstogrowthrate)
import cevolimmune
from misc import *
# general model parameters
la... | StarcoderdataPython |
5141225 | <reponame>skaben/server_core
from alert.serializers import AlertStateSerializer
from core.models import AlertCounter, AlertState
from django.contrib.auth import get_user_model
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
API_URL = reverse('api:alertstate... | StarcoderdataPython |
11247728 | <reponame>DLC01/elvis
"""
Created By <NAME>
September 2020
@parzuko
"""
import discord
from discord.ext import commands
import mysql.connector
import random
# This is not an ideal example and would ideally be a database hosted on a server
mydb = mysql.connector.connect(
host = "localhost",
user = "root",
... | StarcoderdataPython |
8152272 | <gh_stars>0
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# Mixed membership stochastic block model (Godoy-Lorite et al. 2016)
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#----------------------------------------------------------------------
# PURPOSE:
# This method a... | StarcoderdataPython |
5087146 | # pylint: disable=I0011,W0613,W0201,W0212,E1101,E1103
from .. import qtutil
from ...external.qt import QtGui
from ...external.qt.QtCore import Qt
from mock import MagicMock, patch
from ..qtutil import GlueDataDialog
from ..qtutil import pretty_number, GlueComboBox
from glue.config import data_factory
from glue.core im... | StarcoderdataPython |
5002850 | from setuptools import setup
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name="rwafaker",
version='2.0.6',
url="https://github.com/know... | StarcoderdataPython |
3379416 | """Desenvolva um programa que pergunte a distância de uma viagem em Km.
Calcule o preço da passagem, cobrando R$0,50 por Km para viagens de até 200Km e R$0,45 parta viagens mais longas."""
distancia = float(input('Qual a distância da viagem? Km'))
if distancia <= 200:
print('O preço da passagem será de: R${:.... | StarcoderdataPython |
11335384 | from albumentations import Compose, PadIfNeeded, LongestMaxSize
class InferenceTransformation:
def __init__(self, width, height):
self.aug = Compose([
LongestMaxSize(max_size=width if width > height else height),
PadIfNeeded(min_height=height, min_width=width, border_mode=cv2.BORDE... | StarcoderdataPython |
35532 | <gh_stars>0
import numpy as np
import pickle
import tqdm
import os
import torch
from prompts.prompt_material import DETS_LIST, CONTENT_STRUCTS_PREFIX_LIST, CONTENT_STRUCTS_MIDDLE_LIST, CONTENT_STRUCTS_SUFFIX_LIST, TRANSFORMATIONS, LOGICAL_PREFIXES_LIST, LOGICAL_STRUCTS_LW_LIST
######################################... | StarcoderdataPython |
8078361 | #
# Open Source SAM-BA Programmer
# Copyright (C) <NAME>, 2016.
#
# dean [at] fourwalledcubicle [dot] com
# www.fourwalledcubicle.com
#
#
# Released under a MIT license, see LICENCE.txt.
from . import Transport
import logging
class Serial(Transport.TransportBase):
"""Serial transport for SAM-BA d... | StarcoderdataPython |
3536967 | <filename>build_databases/build_global_power_plant_database.py
# This Python file uses the following encoding: utf-8
"""
Global Power Plant Database
build_global_power_plant_database.py
Builds the Global Power Plant Database from various data sources.
- Log build to DATABASE_BUILD_LOG_FILE
- Use country and fuel inform... | StarcoderdataPython |
3353603 | <reponame>namanh11611/FlaskCrypto
import logging
import os
import platform
import socket
import sys
import tempfile
import time
import zipfile
from http import HTTPStatus
from urllib.request import urlopen
import yaml
from pyngrok.exception import PyngrokNgrokInstallError, PyngrokSecurityError, PyngrokError
__author... | StarcoderdataPython |
1846324 | import numpy as np
import torch
import os
import sys
from matplotlib import pyplot as plt
import torch.nn as nn
from xplain.attr import LayerIntegratedGradients, LayerGradientXActivation
import skimage.io
import torchvision
import pickle
import pandas as pd
import scipy.interpolate as interpolate
from torch.utils.data ... | StarcoderdataPython |
343849 | #
# Copyright (c) 2013, Prometheus Research, LLC
# Released under MIT license, see `LICENSE` for details.
#
import itertools
import types
class registry:
# Stores registered test types and respective record types.
case_types = []
input_types = []
output_types = []
class FieldSpec(object):
# R... | StarcoderdataPython |
11216372 | <reponame>curenamo/ssmhub
"""this preset uses a url-type string to implement 12-factor configuration with fewer environment variables.
DATABASE_URL = '<engine>://<user>:<password>@<host>:<port>/<database>'
<engine> can be one of: 'postgresql', 'postgis', 'mysql', 'sqlite'
(default: sqlite3 database file)... | StarcoderdataPython |
4895359 | """
Run the KGTK-Browser Flask server
Open a browser window with the kgtk-browser location
Optional params:
- hostname (--host)
- port number (-p, --port)
- kgtk browser config file (-c, --config)
- kgtk browser flask app file (-a, --app)
Example usage:
kgtk browser --host 0.0.0.0 --port 1234 --ap... | StarcoderdataPython |
208020 | from typing import Tuple
import pytest
from core.emulator.data import IpPrefixes, LinkOptions
from core.emulator.session import Session
from core.errors import CoreError
from core.nodes.base import CoreNode
from core.nodes.network import SwitchNode
INVALID_ID: int = 100
LINK_OPTIONS: LinkOptions = LinkOptions(
d... | StarcoderdataPython |
3408675 | <reponame>UniversitaDellaCalabria/datiFontiSparse<gh_stars>0
from django.contrib import admin
from template.admin import AbstractCreatedModifiedBy
from .admin_inline import *
from .models import *
@admin.register(Visiting)
class VisitingAdmin(AbstractCreatedModifiedBy):
list_display = ('visitor', 'from_structur... | StarcoderdataPython |
372416 | <filename>chp8/trajectory_sampling.py
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 4 10:44:13 2021
@author: leyuan
"""
import time
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
from tqdm import tqdm
# 2 actions
ACTIONS = [0, 1]
# each transition has a probability t... | StarcoderdataPython |
3533284 | # Generated by Django 3.2 on 2021-04-13 15:36
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('chat_bots', '0008_alter_bottype_id'),
('chat_bots', '0009_auto_20210413_1823'),
]
operations = [
]
| StarcoderdataPython |
8136499 | from rest_framework import viewsets, mixins
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from problem.models import Response, Problem
from problem.serializers import ResponseSerializer, ProblemSerializer
class BaseProblemAttrViewSet(viewsets.Ge... | StarcoderdataPython |
12857068 | <reponame>LordGhostX/ECXBotsMastery
import requests
from bs4 import BeautifulSoup
def find_word_meaning(word):
r = requests.get(f"https://www.dictionary.com/browse/{word}")
if r.status_code == 200:
page = BeautifulSoup(r.text, "html.parser")
luna_pos = page.find("span", {"class": "luna-pos"}).... | StarcoderdataPython |
3391897 | # -*- coding: utf-8 -*-
"""
File Name: largest-perimeter-triangle.py
Author : jynnezhang
Date: 2020/11/29 12:55 下午
Description:
https://leetcode-cn.com/problems/largest-perimeter-triangle/
"""
class Solution:
def largestPerimeter(self, A=[]) -> int:
if not A or len(A) < 3:
retu... | StarcoderdataPython |
8091134 | # Copyright 2017-2019 typed_python Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | StarcoderdataPython |
1711788 | from time import sleep
from typing import List, Union, Dict
from privex.loghelper import LogHelper
from tests.base import PrivexBaseCase
from privex.helpers import thread as modthread, LockConflict, random_str, OrderedDictObject
from privex.helpers.thread import BetterEvent, event_multi_wait_all, event_multi_wait_any... | StarcoderdataPython |
3542289 | import sys
class Solution:
def findClosestElements(self, arr, k, x):
"""
:type arr: List[int]
:type k: int
:type x: int
:rtype: List[int]
"""
left = 0
right = len(arr) - 1
pos = 0
if x < arr[0]:
return arr[0... | StarcoderdataPython |
6445868 | # Copyright 2021 <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, softw... | StarcoderdataPython |
394392 | <filename>aircraftdata.py<gh_stars>10-100
# Using the api.joshdouch.me calls to get data from ICAO hex
import requests
def regis(hex):
"""
Gets registration from hex
"""
if hex == None:
return None
regis = requests.get(f"https://api.joshdouch.me/hex-reg.php?hex... | StarcoderdataPython |
132132 | import telebot
from telebot import types
chave = "<KEY>"
bot = telebot.TeleBot(chave)
@bot.message_handler(commands=["badalo"])
def responder(mensagem):
bot.reply_to(mensagem,"badalado em você")
@bot.message_handler(commands=["redes"])
def responder(mensagem):
bot.reply_to(mensagem,"Jownao se encontra atual... | StarcoderdataPython |
1841599 | <filename>weeconsume.py
# consume notifications from redis
import sys
import json
import subprocess
import redis
import time
def growl(message):
# args = ['growlnotify', '-m', message]
args = ['notify-send', 'IRC', message]
subprocess.check_call(args)
def highlight_decision(event):
if event['hilig... | StarcoderdataPython |
9751896 | <filename>Competitive Programming/Binary Search Trees/Given n appointments, find all conflicting appointments.py
'''https: // www.geeksforgeeks.org/given-n-appointments-find-conflicting-appointments/
Given n appointments, find all conflicting appointments.
Examples:
Input: appointments[] = {{1, 5} {3, 7}, {2, 6}, {1... | StarcoderdataPython |
1763738 | <reponame>hwikene/steam-wishlist
from homeassistant import config_entries, core
from .const import DOMAIN
async def async_setup_entry(
hass: core.HomeAssistant,
config_entry: config_entries.ConfigEntry,
async_add_entities,
):
"""Defer sensor setup to the sensor manager."""
await hass.data[DOMAIN]... | StarcoderdataPython |
4816273 | <reponame>banteg/woofy-snapshot
import math
from collections import Counter
from fractions import Fraction
from brownie import Contract
from brownie.convert import EthAddress
from eth_abi.exceptions import InsufficientDataBytes
from scripts.snapshot import UNISWAP_V3_FACTORY
from camera_shy.common import (
NFT_PO... | StarcoderdataPython |
3367573 | <reponame>UnixJunkie/selfies<gh_stars>1-10
"""This script is specifically for testing the large eMolecules dataset,
which upon downloading, should have the file name version.smi.gz.
This test will automatically create a checkpoint file, so that the test
can be paused and resumed easily. Please note that there are some... | StarcoderdataPython |
3537536 | #!/usr/bin/python3
# -*- encoding: utf-8 -*-
# Tweet retrieval script
#
# Written by <NAME>
# April 2018
# dependencies
import datetime
import json
from newsSourcesENTT import english_sources_twitter
import sys
from twitterApiHandle import api
# English news
def news(screen_names = english_sources_twitter, date = dat... | StarcoderdataPython |
1409 | import sklearn.linear_model
from autosklearn.pipeline.components.classification.passive_aggressive import \
PassiveAggressive
from .test_base import BaseClassificationComponentTest
class PassiveAggressiveComponentTest(BaseClassificationComponentTest):
__test__ = True
res = dict()
res["default_iris... | StarcoderdataPython |
375582 | ################################################################################
## Copyright (c) 2019, <NAME> & <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:
##
## 1. Redistribut... | StarcoderdataPython |
1934949 | <filename>snapshottest/parse_env.py<gh_stars>0
import os
def _env_bool(val):
return val.lower() in ["1", "yes", "true", "t", "y"]
def env_snapshot_update():
return _env_bool(os.environ.get("SNAPSHOT_UPDATE", "false"))
| StarcoderdataPython |
140513 | # Generated by Django 3.2.3 on 2021-05-17 02:18
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Floor',
fields=[
... | StarcoderdataPython |
1984606 | from backend.common_tile import CommonTile
import math
class Farm(CommonTile):
def __init__(self):
super().__init__()
self.food = 1
self.production = 0
self.gold = 0
self.housing = .5
self.acceptable_terrain = [
'grassland',
'plains',
... | StarcoderdataPython |
5195261 | """
Objective
In this challenge, we will use loops to do some math. Check out the Tutorial tab to learn more.
Task
Given an integer, , print its first multiples. Each multiple (where ) should be printed on a new line in the form: n x i = result.
Example
The printout should look like this:
3 x 1 = 3
3 x 2 = 6
3 x ... | StarcoderdataPython |
1607835 | <gh_stars>0
from dataclasses import dataclass
from bindings.csw.derived_crstype_type import DerivedCrstypeType
__NAMESPACE__ = "http://www.opengis.net/gml"
@dataclass
class DerivedCrstype(DerivedCrstypeType):
class Meta:
name = "derivedCRSType"
namespace = "http://www.opengis.net/gml"
| StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.