id stringlengths 1 265 | text stringlengths 6 5.19M | dataset_id stringclasses 7
values |
|---|---|---|
1743156 | from django.apps import AppConfig
from django.conf import settings
class ReaderConfig(AppConfig):
name = 'reader' | StarcoderdataPython |
91522 | import h5py
import numpy as np
from tensorflow.keras.utils import to_categorical
import os
# to test generator, values = next(generator) in code
def ensureDir(filePath):
''' This function checks if the folder at filePath exists.
If not, it creates it. '''
if not os.path.exists(filePath):
os.makedirs(filePath... | StarcoderdataPython |
146987 | <filename>2020-03-01_cuda10/predict_redis.py<gh_stars>0
from datetime import datetime
import io
import numpy as np
from PIL import Image
import traceback
import mmcv
import pycocotools.mask as maskUtils
from mmdet.apis import init_detector, inference_detector
from wai.annotations.image_utils import image_to_numpyarray... | StarcoderdataPython |
182444 | import json
from uuid import uuid4
import datetime
from whylogs.core.datasetprofile import DatasetProfile, array_profile, dataframe_profile
from whylogs.core.annotation_profiling import TrackBB, BB_ATTRIBUTES
import os
TEST_DATA_PATH = os.path.abspath(os.path.join(os.path.realpath(
os.path.dirname(__file__)), os... | StarcoderdataPython |
1733434 | # -*- coding: utf-8 -*-
import os
from selene import browser
from selene import config
from selene.browsers import BrowserName
from selene.conditions import texts, exact_text
from selene.support.conditions import have
from selene.support.jquery_style_selectors import s, ss
start_page = 'file://' + os.path.abspath(os.... | StarcoderdataPython |
1704566 | import redis
from flask import Flask, session, escape, request
app = Flask(__name__)
app.secret_key = "Choose very long secret key"
#please copy redis elasticache instance primary end point url
store = redis.from_url('redis://sessionstore.bxgo7b.0001.use1.cache.amazonaws.com:6379')
#mapping route application path
@... | StarcoderdataPython |
3361643 | # Generated by Django 2.0.4 on 2019-04-22 03:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pybb', '0008_auto_20180807_0329'),
]
operations = [
migrations.AlterField(
model_name='attachment',
name='file',
... | StarcoderdataPython |
166070 | <gh_stars>1-10
from torch.nn import Module
from allennlp.common.registrable import Registrable
from abc import abstractmethod, abstractclassmethod, ABCMeta
from typing import Any, T, Type
class BaseEncoder(Module, Registrable, metaclass=ABCMeta):
def __init__(self):
super(BaseEncoder, self).__init__()
... | StarcoderdataPython |
86391 | <gh_stars>0
UCI_VERSION = '5964e2fc6156c5f720eed7faecf609c3c6245e3d'
| StarcoderdataPython |
76636 | r"""
The Elliptic Curve Factorization Method
The elliptic curve factorization method (ECM) is the fastest way to
factor a **known composite** integer if one of the factors is
relatively small (up to approximately 80 bits / 25 decimal digits). To
factor an arbitrary integer it must be combined with a primality
test. Th... | StarcoderdataPython |
3294466 | <filename>test/e2e/tests/aws/test_autoscaling.py
# Copyright 2022 Cortex Labs, 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
#
# Unle... | StarcoderdataPython |
44209 | import matplotlib.pyplot as plt
import numpy as np
def plot_convolution(f, g):
fig, (ax1, ax2, ax3) = plt.subplots(3, 1)
ax1.set_yticklabels([])
ax1.set_xticklabels([])
ax1.plot(f, color='blue', label='f')
ax1.legend()
ax2.set_yticklabels([])
ax2.set_xticklabels([])
ax2.plot(g, color=... | StarcoderdataPython |
165078 | """
All the things I commonly use to help solve LeetCode problems
"""
import array
import bisect
import collections
import copy
import functools
import heapq
import itertools
import math
import os
from pprint import pprint as pp
import queue
import re
import random
import string
import time
import typing
from typing ... | StarcoderdataPython |
1739756 | <reponame>byarmis/AdventOfCode
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from functools import lru_cache
class Solution:
def __init__(self, f):
self.tree = self.generate_tree(f)
self.a = 'YOU'
self.b = 'SAN'
def generate_tree(self, links):
tree = {}
for link in li... | StarcoderdataPython |
1751953 | <gh_stars>1-10
"""
Factories for features and geometries
"""
from typing import Mapping, Union
import keytree.compat
from keytree.model import GEOM_TYPES, NSMAP, Feature, Geometry
def feature(element, kmlns: Union[str, Mapping] = NSMAP) -> Feature:
kid = element.attrib.get("id")
name = element.findtext("kml... | StarcoderdataPython |
1611124 | <filename>src/mapstp/cli/logging.py<gh_stars>0
"""Intercept log messages from the used libraries and pass them to `loguru`.
See https://github.com/Delgan/loguru
"""
import logging
from loguru import logger
# class PropagateHandler(logging.Handler):
# """Send events from loguru to standard logging"""
# def e... | StarcoderdataPython |
3398463 | import string
import sys
import names
# See supplementary information in reference:
# Cell. 2012 Jun 22;149(7):1607-21. doi: 10.1016/j.cell.2012.04.012. Epub 2012 May 10.
sc = ["CB", "SG", "OD1", "OE1", "CZ", "CA", "CE1", "CD1", "NZ", "CD1", "CE",
"OD1", "CG", "OE1", "NH1", "OG", "OG1", "CG1", "CH2", "OH"]
... | StarcoderdataPython |
144065 | from fireo.fields import TextField, NumberField
from fireo.models import Model
class City(Model):
name = TextField()
population = NumberField()
def test_issue_126():
city = City.collection.create(name='NYC', population=500000, no_return=True)
assert city == None | StarcoderdataPython |
114526 | class A:
def __init__(self, var=0):
self.var = var
def __str__(self):
return "This is class A"
a = A()
print(a)
"""
All classes are inherited from object class.
> class MyClass:
> pass
>
> print(MyClass.__class__.__bases__)
(<class 'object'>,)
"... | StarcoderdataPython |
158266 | import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-1, 1, 50)
y = np.cos(np.linspace(0, 0.5 * np.pi))
plt.title("curve")
plt.grid()
plt.xlim(-1, 1)
plt.ylim(-1.05, +1.05)
plt.plot(x, y)
plt.show()
| StarcoderdataPython |
4840047 | # Software License Agreement (BSD License)
#
# copyright (c) 2014-2015 roslint contributors
# 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 of source code must retain the a... | StarcoderdataPython |
3227944 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from .pkg.constant import Constant
except:
from crawlib.pkg.constant import Constant
class Status(Constant):
class S0_ToDo(Constant):
id = 0
description = "刚获得Primary Key, 还未尝试过抓取"
class S1_UrlError(Constant):
id = 1
... | StarcoderdataPython |
1725584 | #Create your views here.
from django.shortcuts import render
from django.urls import reverse_lazy
from django.views.generic.edit import CreateView, DeleteView, UpdateView
from django.views.generic import ListView, DetailView
from findysport_app.models import Usuario, Actividad, Local, Encargado, Apuntado, Grupo
fro... | StarcoderdataPython |
58940 | <filename>{{cookiecutter.project_slug}}/tests/unit/{{cookiecutter.project_slug}}/utils/test_sentry.py
from unittest.mock import Mock, patch
import pytest
from tartiflette import TartifletteError
from {{cookiecutter.project_slug}}.utils import configure_sentry, sentry, sentry_error_coercer
def test_configure_sentry... | StarcoderdataPython |
1796137 | <gh_stars>0
import asyncio
from typing import Optional
from main import os
from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
from aiogram.utils import exceptions, executor
from models import User
import database
from loguru import logger as log
from celery import Celery
celery_app = Celery('tasks'... | StarcoderdataPython |
3365050 | <gh_stars>0
#!/usr/bin/env python
"""
setup.py for tracpy -- python wrappers around TRACMASS
"""
import shutil
from setuptools import setup # to support "develop" mode
from numpy.distutils.core import setup, Extension
# ## total kludge:
# ## this copies extension built with makefile to package
# ## better to have se... | StarcoderdataPython |
122094 | <reponame>bio-hpc/sibila
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
LIMEHTMLBuilder.py:
Build a single HTML file with all the LIME plots.
"""
__author__ = "<NAME>"
__version__ = "1.0"
__maintainer__ = "Antonio"
__email__ = "<EMAIL>"
__status__ = "Production"
import bs4
import html
class LIMEHTMLBuilder... | StarcoderdataPython |
3263352 | import numpy as np
import matplotlib.pyplot as plt
# read data from file
xdata, ydata = np.loadtxt('wavePulseData.txt', unpack=True)
# create x and y arrays for theory
x = np.linspace(-10., 10., 200)
y = np.sin(x) * np.exp(-(x/5.0)**2)
# create plot
plt.figure(1, figsize = (6,4) )
plt.plot(x, y, 'b-', label='theory'... | StarcoderdataPython |
3390695 | # coding: utf-8
# # Pipeline processing using Dask
#
# This notebook demonstrates the continuum imaging and ICAL pipelines.
# In[ ]:
import os
import sys
sys.path.append(os.path.join('..', '..'))
from data_models.parameters import arl_path
results_dir = arl_path('test_results')
from matplotlib import pylab
py... | StarcoderdataPython |
3363904 | <filename>pyiron_atomistics/atomistics/structure/has_structure.py<gh_stars>0
# coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
from abc import ABC, abstractmethod, abstra... | StarcoderdataPython |
177438 | <gh_stars>10-100
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2018-05-14 09:45
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('trr', '0003_add_tables_actionresponse_charge_subjectweapon_trrstatus_weapon... | StarcoderdataPython |
1780000 | from dqnAgent import Agent
from collections import deque
import matplotlib.pyplot as plt
import numpy as np
import torch
from carla_agent_pytorch import CarEnv
import torchvision
import gym
env = gym.make('Breakout-v4', render_mode='human')
agent = Agent(state_size=(3,210,160),action_size=4,seed=0)
#env = CarEnv()
#p... | StarcoderdataPython |
3294274 | <reponame>cy4ok/my-region
# Generated by Django 3.1.6 on 2021-02-22 12:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('authapp', '0007_auto_20210222_1556'),
('travelapp', '0017_auto_20210222_1249'),
('ordersapp', '0006_auto_20210222_1... | StarcoderdataPython |
1629369 | <gh_stars>1-10
# Copyright (c) 2019 zfit
import functools
from typing import Any
from tensorflow.compat.v1 import DType
import tensorflow as tf
from .tools import _auto_upcast
from . import zextension
from ..settings import ztypes
def log(x, name=None):
x = _auto_upcast(x)
return _auto_upcast(tf.math.lo... | StarcoderdataPython |
3214077 | <filename>havarti/storage/s3storage.py
# Copyright 2012-2013 <NAME> and Contributors
#
# 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
#
# ... | StarcoderdataPython |
3285049 | #!/usr/bin/env python
import os
import ssl
import argparse
from dsvpwa.server import VulnHTTPServer
from dsvpwa.handlers import VulnHTTPRequestHandler
BUILD_VER = os.getenv('BUILD_VER') or '0.0.1'
BUILD_REV = os.getenv('BUILD_REV') or 'dev'
def main():
parser = argparse.ArgumentParser(prog='DSVPWA',
de... | StarcoderdataPython |
4805034 | <gh_stars>0
"""
Debian package info status file parser.
"""
import collections
def parse_file_sections(status_file_path):
section = ''
with open(status_file_path) as status_file:
for line in status_file:
if line.startswith('#'):
continue
if not line.rstrip():
... | StarcoderdataPython |
153914 | from napari_plugin_engine import napari_hook_implementation
from typing import List, Tuple, Dict, Any
from imlib.IO.cells import save_cells
from imlib.cells.cells import Cell
from .utils import convert_layer_to_cells
@napari_hook_implementation(specname="napari_get_writer")
def cellfinder_write_multiple_xml(path: s... | StarcoderdataPython |
38685 | <gh_stars>1-10
import argparse
import cv2
class DSample:
SUPPORTED_FORMATS = (
".bmp",
".dib",
".jpeg",
".jpg",
".jpe",
".jp2",
".png",
".pbm",
".pgm",
".ppm",
".sr",
".ras",
".tif",
".tiff",
)
... | StarcoderdataPython |
3300513 | <reponame>ribeirompl/144_Blocks
"""
144 Blocks - Focused time planner
Inspiration from: Tim Urban's (https://waitbutwhy.com/2016/10/100-blocks-day.html)
144blocks.com
Author: <NAME>
Date: June 2019
MIT License
Copyright (c) 2019 <NAME>
"""
import os
import subprocess
import random
import tkinte... | StarcoderdataPython |
1794288 | from yunionclient.common import base
class Subscriber(base.ResourceBase):
pass
class SubscriberManager(base.StandaloneManager):
resource_class = Subscriber
keyword = 'subscriber'
keyword_plural = 'subscribers'
_columns = ["Id", "Name", "Topic_Id", "Type", "Resource_Scope", "Role_Scope", "Receiver... | StarcoderdataPython |
22 | import setuptools #enables develop
setuptools.setup(
name='pysvm',
version='0.1',
description='PySVM : A NumPy implementation of SVM based on SMO algorithm',
author_email="<EMAIL>",
packages=['pysvm'],
license='MIT License',
long_description=open('README.md', encoding='utf-8').read(),
... | StarcoderdataPython |
107829 | <reponame>emscripten-forge/recipes
from pyodide_build.testing import run_in_pyodide
@run_in_pyodide(packages=["sqlalchemy"])
def test_sqlalchemy():
from sqlalchemy import create_engine, text
engine = create_engine("sqlite+pysqlite:///:memory:", future=True)
with engine.connect() as conn:
result =... | StarcoderdataPython |
3203808 | """ All UCI documentation here: http://wbec-ridderkerk.nl/html/UCIProtocol.html """
import subprocess
from typing import Dict, List, Optional, Union
class Stockfish:
""" Integrates the Stockfish chess engine with Python. """
def __init__(
self, path: str = None, depth: int = 2, param: Dict[str, Unio... | StarcoderdataPython |
1645217 | <reponame>fernando-figueredo/STTWebApp
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField
from wtforms.validators import DataRequired
class loginForm(FlaskForm):
username = StringField('username', validators=[DataRequired()])
password = PasswordField('password', valid... | StarcoderdataPython |
92241 | import json
from adsimulator.templates.default_values import DEFAULT_VALUES
def print_all_parameters(parameters):
print("")
print("New Settings:")
print(json.dumps(parameters, indent=4, sort_keys=True))
def get_perc_param_value(node, key, parameters):
try:
if 0 <= parameters[node][key] <= 10... | StarcoderdataPython |
3388645 | <reponame>xksteven/ethics_amti<gh_stars>0
import numpy as np
import pandas as pd
v = 2
df = pd.read_csv("saved_data{}.tsv".format(v), sep="\t", header=None)
print(df.shape)
def levenshteinDistance(s1, s2):
if len(s1) > len(s2):
s1, s2 = s2, s1
distances = range(len(s1) + 1)
for i2, c2 in enumera... | StarcoderdataPython |
4831285 | #!/usr/bin/env python
"""
Normalise count file by RPM
"""
__author__ = "<NAME>"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
import sys
htseq = open(sys.argv[1], "r")
htseq_readlines = htseq.readlines()
htseq.close()
total_reads = float(sys.argv[2])
scaling_factor = float(total_reads/1000000)
raw_and_rpm_ou... | StarcoderdataPython |
40283 | <gh_stars>10-100
# Generated by the Protocol Buffers compiler. DO NOT EDIT!
# source: umbra.proto
# plugin: grpclib.plugin.main
import abc
import typing
import grpclib.const
import grpclib.client
if typing.TYPE_CHECKING:
import grpclib.server
import google.protobuf.struct_pb2
import google.protobuf.timestamp_pb2
... | StarcoderdataPython |
4804839 | <reponame>Next-Gen-UI/Code-Dynamics
class Solution:
def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode:
stack1 = []
stack2 = []
while l1:
stack1.append(l1)
l1 = l1.next
while l2:
stack2.append(l2)
l2 = l2.next
head = None
carry = 0
while carry or st... | StarcoderdataPython |
92275 | <gh_stars>100-1000
import settings
from .. import handlers
def test_send_welcome_email(mocker, ses_client):
ses_send_email = mocker.patch.object(ses_client, 'send_email', autospec=True)
mocker.patch('emails.sender.get_ses_client', return_value=ses_client)
event = {'to': '<EMAIL>', 'name': '<NAME>', 'type... | StarcoderdataPython |
1668754 | from collections import Counter
from collections import defaultdict
from dataclasses import dataclass
from itertools import product
from math import ceil
from math import exp
from math import floor
from math import isclose
from math import log2
from math import sqrt
from typing import List
from typing import Tuple
imp... | StarcoderdataPython |
3200370 | from dl.optimizer.Optim import Optim
class LRDecayScheduler:
def __init__(self,
optimizer: Optim,
decay_mode="min",
factor=1e-1,
tolerance_round=10,
verbose=False,
cooldown=0,
min_lr=0,
... | StarcoderdataPython |
1610955 | <reponame>ShantamShorewala/aizynthfinder
import pytest
from aizynthfinder.utils.loading import load_dynamic_class
class MyException(Exception):
pass
def test_simple():
cls = load_dynamic_class("aizynthfinder.reactiontree.ReactionTree")
assert cls.__name__ == "ReactionTree"
def test_default_module():... | StarcoderdataPython |
3357299 | <filename>profiles_api/models.py
from django.db import models
from core import settings
# Create your models here.
from django.db import models
from django.contrib.auth.models import AbstractBaseUser
from django.contrib.auth.models import BaseUserManager
from django.contrib.auth.models import PermissionsMixin
class ... | StarcoderdataPython |
169326 | <reponame>ptbrown1729/exact_diag
"""
Tools for describing geometries of small clusters and clusters arranged on regular lattices
"""
import numpy as np
import os
# TODO: need to modify get reciprocal vectors for case when matrix inverse fails
class Geometry():
_round_decimals = 14
def __init__(sel... | StarcoderdataPython |
3297173 | # -*- coding: utf-8 -*-
import urllib.request as urllib2
import sys
from bs4 import BeautifulSoup
import json
import re
class ITpro:
def get_new_article():
html = urllib2.urlopen("http://itpro.nikkeibp.co.jp/index-smart.html")
soup = BeautifulSoup(html,"lxml")
index_cs = soup.find_all('ul... | StarcoderdataPython |
3369130 | from biicode.common.utils.serializer import Serializer, Deserializer, SetDeserializer
from abc import ABCMeta, abstractmethod
from biicode.common.model.deps_props import DependenciesProperties
class Declaration(object):
__metaclass__ = ABCMeta
SERIAL_DATA_KEY = 'd'
SERIAL_EXCLUDE_KEY = 'ex'
SERIAL_PRO... | StarcoderdataPython |
3395960 | <gh_stars>0
from django.contrib import admin
from django.urls import path
from django.contrib.auth import views as auth_views
from django.urls import reverse_lazy
from . import views
app_name = "players"
urlpatterns = [
path('', views.home, name = 'home'),
path('users/', views.users_list, name = 'users'),
p... | StarcoderdataPython |
38337 | #!/usr/bin/env python3
#
# Fix ToUnicode CMap in PDF
# https://github.com/trueroad/pdf-fix-tuc
#
# build_bfrange2.py:
# Build bfrange2 PDF.
#
# Copyright (C) 2021 <NAME>.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the foll... | StarcoderdataPython |
3208717 | # open and list a file
f = open("demo\\flags.txt","rt")
try:
content = f.read()
print(type(content))
print(content)
finally:
f.close()
## reopen file and print lines
f = open("demo/flags.txt","rt")
for text_line in f:
print(text_line,end="")
f.close() | StarcoderdataPython |
79093 | # Generated by Django 3.1.6 on 2021-02-19 14:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('CyberUser', '0006_auto_20210219_2041'),
]
operations = [
migrations.AlterField(
model_name='news',
name='published_d... | StarcoderdataPython |
184886 | <filename>tests/test_single_client.py
import unittest
from fpssh.clients.native.single import SSHClient
class SSHClientTest(unittest.TestCase):
def setUp(self):
self.fake_cmd = "echo foo"
self.fake_res = "foo\n"
self.host = "127.0.0.1"
self.port = 2222
self.user = "foo"
... | StarcoderdataPython |
1641081 | """
Displays an 100GB zarr file of lattice light sheet data
"""
import dask.array as da
import napari
file_name = 's3://sofroniewn/image-data/LLSM/AOLLSM_m4_560nm.zarr'
data = da.from_zarr(file_name)
with napari.gui_qt(startup_logo=True):
# create an empty viewer
viewer = napari.Viewer(title='remote', axis_l... | StarcoderdataPython |
22863 |
global loaded_model
| StarcoderdataPython |
3345011 | <reponame>HypnosXC/mmaction2
import argparse
import multiprocessing
import os
import os.path as osp
import numpy as np
import scipy.interpolate
from mmcv import dump, load
args = None
def parse_args():
parser = argparse.ArgumentParser(description='ANet Feature Prepare')
parser.add_argument('--rgb', default=... | StarcoderdataPython |
3219977 | import os, sys, requests, socket
# check back soon!
| StarcoderdataPython |
3249258 | <filename>csv_to_table.py
#!/usr/bin/env python
import argparse
from typeguesser import TypeGuesser
def main():
argParser = argparse.ArgumentParser()
argParser.add_argument(
"file", type=str, help="The name (and path) of the target CSV file")
argParser.add_argument(
"--header", help="In... | StarcoderdataPython |
4823812 | <reponame>ngocjr7/stavia<filename>evaluation/evaluate_cbs.py
import sys, codecs
sys.path.append('..')
from sklearn.linear_model import LogisticRegression
from sklearn.externals import joblib
from stavia.feature_extraction import extract_features
from stavia.data_processing import load_data
from stavia.utils.parameter... | StarcoderdataPython |
1707414 | <filename>examples/geo_states.py
from underleague_generator.geography import (
StatesGenerator,
BigStatesGenerator,
SmallStatesGenerator
)
def main():
print("\n\nDemo of the underleague generator geography submodule\n\n")
demo("usa", "USA")
demo("mex", "Mexico")
demo("can", "Canada")
... | StarcoderdataPython |
1668108 | <reponame>luanfs/iModel<filename>pyscripts/plot_evol.py
#! /usr/bin/env python3
#---------------------------------
# Plots errors of experiments
# obtained from iModel output
# <NAME> (<EMAIL>)
# Novembre 2018
#----------------------------------
import sys
import os
import re
import string
import numpy as ... | StarcoderdataPython |
1708681 | LOG_FILE = 'log.txt'
# Connection parameters
ACCESS_KEY_ID = None
SECRET_ACCESS_KEY = None
ATHENA_GARBAGE_PATH = '<ATHENA_OUTPUT_LOCATION>'
WORKGROUP = '<WORKGROUP>'
REGION = '<REGION>'
DATABASE = '<DATABASE>'
# Database Parameters
DATABASE_BUCKET = '<DATABASE_BUCKET>'
DATABASE_ROOT_KEY = 'dedupe/'
BUFFERSIZE = 10000... | StarcoderdataPython |
145908 | <reponame>Oniwa/100daysofcode-with-python-course
import requests
import urllib3
URL = 'http://www.channelfireball.com/feed/'
opener = urllib3.PoolManager()
if __name__ == "__main__":
r = opener.request('GET', URL)
with open('channelfireball.xml', 'wb') as f:
f.write(r.data)
| StarcoderdataPython |
1636945 | <gh_stars>0
from pathlib import Path
import warnings
import geopandas as gp
import pygeos as pg
import numpy as np
from pyogrio import read_dataframe, write_dataframe
from analysis.constants import STATES, SARP_STATES, CRS, GEO_CRS, REGION_STATES
warnings.filterwarnings("ignore", message=".*initial implementation o... | StarcoderdataPython |
4835047 | <reponame>DavideAltomare/rego
"""
**Automatic Time Series Forecasting and Missing Value Imputation.**
rego is intended for predicting and imputing time series. Its algorithm can automatically set all the parameters needed, thus in the minimal configuration it only requires the target variable and the regressors if pr... | StarcoderdataPython |
1752018 | <filename>netapp/santricity/models/symbol/pending_host.py
# coding: utf-8
"""
PendingHost.py
The Clear BSD License
Copyright (c) – 2016, NetApp, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer b... | StarcoderdataPython |
1727071 | class CSS:
menu_root = '.nav-tab-menu' # Class Selector
check_loaded = '.nav-title'
sdate = 'input.date:nth-child(1)'
edate = 'input.date:nth-child(2)'
clear_date = '.datepicker-days > table:nth-child(1) > tfoot:nth-child(3) > tr:nth-child(2) > th:nth-child(1)'
select_year = '#se1_sele'
sel... | StarcoderdataPython |
1682415 | <gh_stars>1-10
from mycloud.statistics.change_tracker import track_changes
from mycloud.statistics.size import calculate_size
from mycloud.statistics.summarizer import summarize
from mycloud.statistics.usage import print_usage
| StarcoderdataPython |
3370715 | import math
def mean(l):
return sum(l) / len(l)
def stdDeviation(l):
n = len(l)
mean_ = mean(l)
var = 0
for i in range(n):
var += (mean_ - l[i]) ** 2
var /= n
return math.sqrt(var)
def cov(X, Y):
xMean = mean(X)
yMean = mean(Y)
n = len(X)
covar = 0
for i i... | StarcoderdataPython |
101780 | <filename>scripts/crTestCaseGen.py
#!/usr/bin/env python
import re
import math
import crTemplate
def csvBooleanExpand(csvLineData):
"""Each line which contains 'X' is duplicated and the X replace with 0,1. Only one expansion per line is processed"""
ExpandOccurred = 0
newCsvLineData = []
for line in c... | StarcoderdataPython |
141428 | # https://adventofcode.com/2020/day/3
from functools import reduce
with open(file=r'd3input.txt') as file:
inputs = file.readlines()
inputs = [line.strip('\n') for line in inputs]
print('Starting Map:')
for line in inputs:
print(line)
slopes = [
{'x': 1, 'y': 1},
{'x': 3, 'y': 1},
{'x': 5, 'y': 1... | StarcoderdataPython |
29822 | from ..utils.reporter import report
class RegressorDevice():
tape = []
regressor = None
@staticmethod
def init(regressor):
RegressorDevice.tape = []
RegressorDevice.regressor = regressor
@staticmethod
def reset():
RegressorDevice.tape = []
@staticmethod
def a... | StarcoderdataPython |
179152 | # Copyright (c) 2012-2022, <NAME> <<EMAIL>>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
from . import AWSObject, AWSProperty, PropsDictType
from .validators import boolean, integer
from .validators.wafregional import validate_waf_action_type
c... | StarcoderdataPython |
3293924 | from random import randint
import random
from Levenshtein import distance
from os import listdir
import json
from threading import Thread
from time import sleep
import time
from datetime import datetime
import re
# Import interface for basic convo file
from .utils import convo_reader
from .utils import story_reader
fro... | StarcoderdataPython |
1673822 | <filename>pyro/distributions/transforms/__init__.py
from __future__ import absolute_import
from pyro.distributions.transforms.batch_norm import BatchNormTransform
from pyro.distributions.transforms.householder import HouseholderFlow
from pyro.distributions.transforms.iaf import InverseAutoregressiveFlow, InverseAutore... | StarcoderdataPython |
79994 | <filename>DIGDriver/region_model/perturbations_confidance/confidance_perturbations_estimate.py
import os
import sys
import json
import copy
import h5py
import numpy as np
import torch
from types import SimpleNamespace
from torch import nn
from sklearn.metrics import r2_score
#from nets.nets import *
#from nets.trainer... | StarcoderdataPython |
4825938 | <reponame>wbadart/language-python
def g(x):
print("x = %d" % x)
def h(f):
print("called on %s" % f.__name__)
return f
return h
@g(3)
def f():
pass
f()
| StarcoderdataPython |
4833521 | import os
import numpy as np
import pandas as pd
#print("Hello from tb_lite")
# https://github.com/tensorflow/tensorboard/
# blob/master/tensorboard/backend/event_processing/event_file_loader.py
import tensorboard.backend.event_processing.event_file_loader as event_file_loader
def pytorch_summary(model):
si... | StarcoderdataPython |
1681304 | <gh_stars>1-10
# -*- coding: utf-8 -*-
# @Author: ander
# @Date: 2020-12-22 16:17:53
# @Last Modified by: ander
# @Last Modified time: 2020-12-22 16:18:34
from openpyxl import Workbook, load_workbook
import csv
class ExcelBot(object):
"""docstring for ExcelBot"""
def __init__(self):
self.workbook = Workbook(... | StarcoderdataPython |
124586 | <filename>scripts/outcomes/site_gains/get_p_values.py<gh_stars>0
"""
Calculates P-values from the permutation test.
"""
import feather
import functools as ft
import numpy as np
import pandas as pd
import tqdm
from click import *
from logging import *
from statsmodels.sandbox.stats.multicomp import multipletests
def... | StarcoderdataPython |
4834870 | """
The optimisations submodule contains all the optimisations offered in Pythran.
This file is just for convenience and turns the import from
import optimisations.xxxxx.xxxxx
into
import optimisations.xxxxx
"""
from .constant_folding import ConstantFolding, PartialConstantFolding
from .dead_code_elimination impor... | StarcoderdataPython |
4814166 | # Copyright (c) 2013, Libermatic and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from gwi_customization.microfinance.api.loan import (
get_undisbursed_principal,
get_outstanding_principal,
get_recovered_principal... | StarcoderdataPython |
4842299 | <reponame>davidmnoll/gltrader
from kivy.app import App
from kivy.uix.button import Button
from kivy.properties import ObjectProperty
from ..notification import *
class ViewButton(Button):
"""
Goes to single market screen from row on trader screen
"""
market=ObjectProperty()
def __init__(self, ma... | StarcoderdataPython |
1748079 | <filename>tests/sentry/web/frontend/test_organization_auth_settings.py
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from django.db import models
from mock import patch
from sentry.models import (
AuditLogEntry, AuditLogEntryEvent, AuthIdentity, AuthProvider,
Organization... | StarcoderdataPython |
158578 | <filename>homeassistant/components/tractive/diagnostics.py
"""Diagnostics support for Tractive."""
from __future__ import annotations
from homeassistant.components.diagnostics import async_redact_data
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
from ho... | StarcoderdataPython |
1648232 | <filename>code/models/__init__.py
from .decomp_attn import *
from .simple_graph import *
from .graph_n_text import *
from .match_lstm import *
from .deiste import *
from .hbmp import *
| StarcoderdataPython |
70304 | <reponame>Ahmfrkyvz/Traditional-Symmetric-Key-Ciphers
__author__ = 'Ahmfrkyvz'
def vigerene_cipher(plainText, key):
i = 0
encryptedText = ""
key = key.lower()
plainText = plainText.replace('İ', 'i')
plainText = plainText.lower()
while i < len(plainText):
char = ord(plainText[i])
... | StarcoderdataPython |
45406 | from inspect import currentframe
__all__ = ["add_props_to_ns", "add_classprops_to_ns", "classproperty", "props_as_dict"]
def prop_getsetdel(property_name, prefix="_", read_only=False, deletable=False):
internal_attr = prefix + property_name
def prop_getter(internal_attr):
def getter_func(self):
... | StarcoderdataPython |
4804236 | """
Usage: phs.obs.production.isdc.worker [options]
Options:
--java_path=PATH [default: /home/guest/relleums/java8/jdk1.8.0_111]
--fact_tools_jar_path=PATH [default: /home/guest/relleums/fact_photon_stream/fact-tools/target/fact-tools-0.18.1.jar]
--fact_tools_xml_path=PATH [default: /home/gues... | StarcoderdataPython |
11056 | <gh_stars>0
"""Extract body part annotations."""
import re
import spacy
from traiter.const import COMMA
from traiter.patterns.matcher_patterns import MatcherPatterns
from anoplura.pylib.const import COMMON_PATTERNS
from anoplura.pylib.const import CONJ
from anoplura.pylib.const import MISSING
from anoplura.pylib.cons... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.