content stringlengths 7 928k | avg_line_length float64 3.5 33.8k | max_line_length int64 6 139k | alphanum_fraction float64 0.08 0.96 | licenses list | repository_name stringlengths 7 104 | path stringlengths 4 230 | size int64 7 928k | lang stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|
import logging
logger = logging.getLogger('spacel.provision.app.alarm.endpoint.factory')
class AlarmEndpointFactory(object):
def __init__(self, factories):
self._factories = factories
def add_endpoints(self, template, endpoints):
endpoint_resources = {}
logger.debug('Injecting %d en... | 33.767442 | 77 | 0.587466 | [
"MIT"
] | mycloudandme/spacel-provision | src/spacel/provision/app/alarm/endpoint/factory.py | 1,452 | Python |
# encoding: utf-8
"""
The *pathspec* package provides pattern matching for file paths. So far
this only includes Git's wildmatch pattern matching (the style used for
".gitignore" files).
The following classes are imported and made available from the root of
the `pathspec` package:
- :class:`pathspec.pathspec.PathSpec... | 24.659091 | 72 | 0.784332 | [
"MIT"
] | AlexxyQQ/From-Moon-to-Earth | venv/Lib/site-packages/pathspec/__init__.py | 1,085 | Python |
import pytest
from django.core import mail
from app.mail.owl import TemplOwl # type: ignore
pytestmark = [pytest.mark.django_db]
@pytest.fixture(autouse=True)
def _enable_email(settings):
settings.EMAIL_ENABLED = True
@pytest.fixture
def owl():
return TemplOwl(
to='f@f213.in',
template_id... | 19.295455 | 80 | 0.699647 | [
"MIT"
] | Abdujabbar/education-backend | src/app/tests/owl/tests_owl_functional.py | 849 | Python |
#!/usr/bin/python3
# *****************************************************************************
#
# 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 ... | 38.657143 | 91 | 0.612343 | [
"Apache-2.0"
] | pjfanning/incubator-datalab | infrastructure-provisioning/src/general/scripts/os/common_clean_instance.py | 8,118 | Python |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 27 17:18:43 2020
@author: admangli
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import math
dataset = pd.read_csv('Ads_CTR_Optimisation.csv').values
#%%
slot_machines = 10
#%% Random ad selection reward
import rand... | 31 | 104 | 0.691504 | [
"MIT"
] | adityamanglik/Algorithm-Implementations | Machine Learning/Sklearn Implementations/Reinforcement Learning/Upper_Confidence_Bound.py | 2,201 | Python |
_base_ = [
'../_base_/models/icnet_r50-d8.py', '../_base_/datasets/cityscapes.py',
'../_base_/default_runtime.py', '../_base_/schedules/schedule_160k.py'
]
model = dict(
backbone=dict(
resnet_cfg=dict(
init_cfg=dict(
type='Pretrained', checkpoint='open-mmlab://resnet50_v... | 29.818182 | 77 | 0.615854 | [
"Apache-2.0"
] | Junjun2016/ICNet | configs/icnet/icnet_r50-d8-pretrained_512x1024_160k_cityscapes.py | 328 | Python |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from .base import Loss
class AdaCos(Loss):
"""PyTorch implementation of AdaCos. See Ref[1] for paper
This implementation is different from the most open-source implementations in following ways:
1) expects raw logits of size ... | 41.014085 | 123 | 0.655563 | [
"MIT"
] | YevheniiSemendiak/pytorch-tools | pytorch_tools/losses/angular.py | 2,914 | Python |
"""
IGN Instituto Geográfico Nacional Sismología Feed.
Fetches GeoRSS feed from IGN Instituto Geográfico Nacional Sismología.
"""
from datetime import datetime
from typing import Optional
import dateparser as dateparser
from georss_client import FeedEntry, GeoRssFeed
from georss_client.consts import CUSTOM_ATTRIBUTE
... | 33.035714 | 85 | 0.65773 | [
"Apache-2.0"
] | exxamalte/python-georss-ign-sismologia-client | georss_ign_sismologia_client/__init__.py | 4,639 | Python |
lista = [1,2,3,4,5]
for i in range(0,5):
print(lista[i])
| 16.25 | 20 | 0.523077 | [
"MIT"
] | jwellington58/Wellingtonlp220172vacation | Wellington_python/exemplo_listas.py | 65 | Python |
''' convenience functions for ANOVA type analysis with OLS
Note: statistical results of ANOVA are not checked, OLS is
checked but not whether the reported results are the ones used
in ANOVA
includes form2design for creating dummy variables
TODO:
* ...
*
'''
import numpy as np
#from scipy import stats
import sta... | 31.774306 | 101 | 0.605289 | [
"BSD-3-Clause"
] | AnaMP/statsmodels | statsmodels/sandbox/regression/try_ols_anova.py | 9,151 | Python |
from lxml import objectify
from kloppy.domain import Period, PitchDimensions, Dimension
from kloppy.infra.utils import Readable
from .models import *
def noop(x):
return x
def _load_provider_parameters(parent_elm, value_mapper=None) -> Dict:
if parent_elm is None:
return {}
if not value_mappe... | 32.140244 | 104 | 0.667046 | [
"BSD-3-Clause"
] | dmallory42/kloppy | kloppy/infra/serializers/tracking/epts/meta_data.py | 5,271 | Python |
# Copyright 2020 Konstruktor, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 26.864865 | 74 | 0.72334 | [
"ECL-2.0",
"Apache-2.0"
] | tethys-platform/tethys | tethys/bin/cli.py | 994 | Python |
"""
This code was taken from https://github.com/ActiveState/appdirs and modified
to suite our purposes.
"""
import os
import sys
from pip._vendor import six
def user_cache_dir(appname):
r"""
Return full path to the user-specific cache dir for this application.
"appname" is the name of application.
... | 31.136691 | 78 | 0.647874 | [
"MIT"
] | chadrik/pip | pip/appdirs.py | 4,328 | Python |
import os
AWS_ACCESS_KEY_ID_PERF = os.environ['AWS_ACCESS_KEY_ID_PERF']
AWS_SECRET_ACCESS_KEY_PERF = os.environ['AWS_SECRET_ACCESS_KEY_PERF']
AWS_ACCESS_KEY_ID_DELETE_PERF = os.environ['AWS_ACCESS_KEY_ID_DELETE_PERF']
AWS_SECRET_ACCESS_KEY_DELETE_PERF = os.environ['AWS_SECRET_ACCESS_KEY_DELETE_PERF']
BUCKET_PERF = os... | 59.92 | 413 | 0.789052 | [
"Apache-2.0"
] | athiruma/cloud-governance | jenkins/tagging/tagging.py | 1,498 | Python |
from movies.settings import *
| 15 | 29 | 0.8 | [
"MIT"
] | Wonqu/rz_movies | app/movies/settings/settings_dev.py | 30 | Python |
# https://github.com/theeko74/pdfc
# modified by brio50 on 2022/01/23, working with gs version 9.54.0
"""
Simple python wrapper script to use ghoscript function to compress PDF files.
Compression levels:
0: default
1: prepress
2: printer
3: ebook
4: screen
Dependency: Ghostscript.
On MacOSX insta... | 35.598837 | 100 | 0.600033 | [
"MIT"
] | brio50/groups-io | gs_compress.py | 6,123 | Python |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 44.469891 | 211 | 0.612524 | [
"Apache-2.0"
] | googleapis/googleapis-gen | google/cloud/recommendationengine/v1beta1/recommendationengine-v1beta1-py/google/cloud/recommendationengine_v1beta1/services/user_event_service/client.py | 45,048 | Python |
# -*- coding: utf-8 -*-
import os
import re
from math import radians, degrees
import numpy as np
import pandas as pd
import cv2
from pdftabextract import imgproc
from pdftabextract.geom import pt
from pdftabextract.common import read_xml, parse_pages, save_page_grids
from pdftabextract.textboxes import rotate_textbo... | 46.610592 | 180 | 0.679054 | [
"Apache-2.0"
] | SagarRoy1996/TabularDataExtraction | examples/eg1/eg1.py | 14,963 | Python |
# coding=utf-8
import sys
import argparse
import os
from tensorflow.python.platform import gfile
import numpy as np
import tensorflow as tf
from tensorflow.python.layers.core import Dense
from utils.data_manager import load_data, load_data_one
from collections import defaultdict
from argparse import ArgumentParser
fro... | 33.683432 | 133 | 0.623188 | [
"MIT"
] | VV123/NLIDB_gradient | main.py | 11,385 | Python |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.utils import timezone
class Migration(migrations.Migration):
dependencies = [
('nationalparks', '0009_auto_20150831_1721'),
]
operations = [
migrations.AddField(
... | 27.75 | 78 | 0.606982 | [
"CC0-1.0"
] | 18F/ekip-api | ekip/nationalparks/migrations/0010_auto_20150902_1902.py | 888 | Python |
# Copyright 2015 Internap.
#
# 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, so... | 35.037594 | 142 | 0.666953 | [
"Apache-2.0"
] | idjaw/fake-switches | fake_switches/command_processing/base_command_processor.py | 4,660 | Python |
from __future__ import division
import sys
class Inf(float):
__name__ = __name__
__file__ = __file__
@staticmethod
def div(p, q):
"""
``p / q`` returning the correct infinity instead of
raising ZeroDivisionError.
"""
from math import copysign
if q !=... | 22.939394 | 64 | 0.535007 | [
"MIT"
] | sensiblecodeio/inf | inf.py | 757 | Python |
import os
import numpy as np
from shapely.geometry import box, Polygon
import geopandas as gpd
from ..utils.core import _check_gdf_load, _check_crs
from ..utils.tile import save_empty_geojson
from ..utils.geo import gdf_get_projection_unit, split_multi_geometries
from ..utils.geo import reproject_geometry
from tqdm imp... | 44.080745 | 83 | 0.594688 | [
"Apache-2.0"
] | CosmiQ/SpaceNet_SAR_Buildings_Solutions | 3-SatShipAI/solaris/tile/vector_tile.py | 14,194 | Python |
import os
import argparse
import gym
from gym import envs
import numpy as np
from skimage import transform
from stable_baselines.common.atari_wrappers import WarpFrame
from stable_baselines.common.vec_env import VecVideoRecorder, VecFrameStack, VecNormalize
from .utils import ALGOS, create_test_env, get_saved_hyper... | 36.803419 | 109 | 0.640734 | [
"MIT"
] | SilviaZirino/rl-baselines-zoo | utils/record_video.py | 4,306 | Python |
from __future__ import absolute_import
from __future__ import unicode_literals
#
# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
#
from builtins import next
from builtins import chr
from builtins import str
from builtins import range
from builtins import object
import copy
import os
import gevent
fro... | 42.319405 | 100 | 0.542985 | [
"Apache-2.0"
] | atsgen/tf-controller | src/config/common/cfgm_common/vnc_cassandra.py | 73,932 | Python |
import django
import six
from django.http import HttpResponseRedirect
if django.VERSION[0] < 2:
from django.core.urlresolvers import reverse
else:
from django.urls import reverse
from django.db import transaction
from django.utils import timezone
import logging
from processlib.assignment import inherit
from ... | 31.793407 | 93 | 0.635144 | [
"BSD-3-Clause"
] | RaphaelKimmig/processlib | processlib/activity.py | 14,466 | Python |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
import os
import sys
def update_allure_feature_name(results_dir: str, prefix: str):
"""Make Allure JSON results unique by pre-pending a prefix to: name, historyId & uuid.
Use it when not all of the test results show up in the Allure report.
This ... | 38.941176 | 101 | 0.638218 | [
"Apache-2.0"
] | tomaszwozniak/behave-docker-parallel | update_results.py | 1,324 | Python |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('forms', '0016_auto_20150330_1413'),
]
operations = [
migrations.AlterField(
model_name='radiosheet',
... | 59.62963 | 532 | 0.560248 | [
"Apache-2.0"
] | Code4SA/gmmp | forms/migrations/0017_auto_20150331_1815.py | 1,610 | Python |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... | 43.659091 | 297 | 0.669755 | [
"Apache-2.0"
] | polivbr/pulumi-azure-native | sdk/python/pulumi_azure_native/datafactory/private_endpoint_connection.py | 9,605 | Python |
# By @HYPER-MOD
from PIL import Image, ImageEnhance, ImageDraw
import numpy as np
import os
import cv2
import shutil
async def circle_with_bg(client, message):
try:
userid = str(message.chat.id)
if not os.path.isdir(f"./DOWNLOADS/{userid}"):
os.makedirs(f"./DOWNLOADS/{userid}")
... | 37.626566 | 86 | 0.550057 | [
"MIT"
] | HYPER-MODZ/image-editor-bot | image/edit_2.py | 15,013 | Python |
#!/usr/bin/env python
# coding: utf-8
# # WORKFLOW PROCEDURE
# In[ ]:
# import utilities
from ds_utils import *
# to plot results
get_ipython().run_line_magic('matplotlib', 'inline')
# ## How to use this code:
#
# ### Step 1
#
# From a list of train and test datasets run the baseline_generator function and ch... | 35.111732 | 436 | 0.694829 | [
"Apache-2.0"
] | kennethriva/Machine-Learning-for-drugs-cytokines | workflow_procedure_example.py | 6,285 | Python |
import logging
from logging import basicConfig, getLogger
from lib import do_something
def main():
log_fmt = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
basicConfig(format=log_fmt,
level="DEBUG")
logger = getLogger(__name__)
for i in range(3):
logger.info("--------... | 28.296296 | 71 | 0.602094 | [
"MIT"
] | terasakisatoshi/pythonCodes | loggingExer/moduleExer/start.py | 764 | Python |
# pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
# pylint:disable=protected-access
import json
import re
import urllib.parse
from collections import namedtuple
from pathlib import Path
from random import randint
from typing import Callable, List
from uuid import u... | 33.733624 | 127 | 0.71767 | [
"MIT"
] | GitHK/osparc-simcore-forked | services/director-v2/tests/unit/test_modules_director_v0.py | 7,725 | Python |
#!/usr/bin/env python3
# Copyright (c) 2015-2018 The Dash Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.blocktools import get_masternode_payment, create_coinbase, create_block
from test_framewo... | 39.00885 | 125 | 0.628176 | [
"MIT"
] | cryptowithacause/cryptocause-coin | qa/rpc-tests/llmq-is-cl-conflicts.py | 13,224 | Python |
#!/usr/bin/env python
#
# @file test_signals.py
#
# @author Matt Gigli <mjgigli@gmail.com>
#
# @section LICENSE
#
# The MIT License (MIT)
# Copyright (c) 2016 Matt Gigli
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"... | 33.005556 | 79 | 0.666723 | [
"MIT"
] | mjgigli/active-object | test/test_signals.py | 5,941 | Python |
import asyncio
import sys
import click
from pydantic import SecretStr
from server.application.auth.commands import ChangePassword
from server.config.di import bootstrap, resolve
from server.domain.auth.entities import User
from server.domain.auth.repositories import UserRepository
from server.seedwork.application.mes... | 22.510204 | 74 | 0.710789 | [
"MIT"
] | multi-coop/catalogage-donnees | tools/changepassword.py | 1,103 | Python |
"""Various functions that interact with Slack, e.g. posting messages."""
import asyncio
import logging
import socket
from pathlib import Path
from typing import Union, Optional
from slack_sdk.errors import SlackApiError
from lsw_slackbot.plots import plot_resource_use
from lsw_slackbot.resources import current_memory... | 41.444444 | 120 | 0.690864 | [
"BSD-3-Clause"
] | emilyhunt/lsw-slackbot | lsw_slackbot/slack.py | 4,849 | Python |
from contextlib import contextmanager
import platform
import shlex
from subprocess import PIPE, Popen
from shutil import which
class ShellCommandResult(tuple):
"""
The result of a :func:`coalib.misc.run_shell_command` call.
It is based on a ``(stdout, stderr)`` string tuple like it is returned
form `... | 35.42515 | 79 | 0.615619 | [
"MIT"
] | prashant0598/CoffeeApp | venv/lib/python3.5/site-packages/coalib/misc/Shell.py | 5,916 | Python |
#!/usr/bin/env python
import numpy as np
def initialize_hyper_parameters(layer_acts, learning_rate):
"""
Initialize parameters for different levels of the network
Arguments:
layer_acts -- python array (list) containing the activation functions of each layer in the network
learning_rate -- float ... | 32.861386 | 103 | 0.647484 | [
"Apache-2.0"
] | giuseppefutia/word2vec | utils/init_parameters.py | 3,319 | Python |
"""
Code for particle tracking, designed for ROMS output. This new version
makes extensive use of nearest-neighbor KDTree algorithms for interpolation.
This results is significantly (36x) faster runtimes compared with old version.
PERFORMANCE: about 3 minutes per day for a 3D cas6 experiment with 10k particles.
NOTE... | 35.465201 | 97 | 0.673001 | [
"MIT"
] | PuffyPuffin/LO_user | tracker/tracker/user_tracker.py | 9,682 | Python |
"""
Custom Decorators
"""
# Django
from django.shortcuts import redirect, reverse
from django.http import JsonResponse
from django.utils.translation import gettext as _
from django.http import Http404
# local Django
from app.modules.util.helpers import Helpers
from app.modules.core.response import Response
from app.m... | 37.943182 | 155 | 0.668763 | [
"Apache-2.0"
] | Clivern/Kraven | app/modules/core/decorators.py | 3,339 | Python |
from datetime import datetime, timedelta
from django.test import TestCase
from mock import patch
from corehq.apps.domain.models import Domain
from corehq.apps.hqcase.utils import update_case
from corehq.apps.sms.mixin import PhoneNumberInUseException
from corehq.apps.sms.models import (
PhoneNumber,
SQLMobil... | 41.17485 | 111 | 0.666647 | [
"BSD-3-Clause"
] | AliRizvi1/commcare-hq | corehq/apps/sms/tests/test_phone_numbers.py | 34,381 | Python |
from hash_map_base_class import *
class ProbeHashMap(HashMapBase):
"""Hash map implemented with linear probing for collision resolution."""
_AVAIL = object() # sentinal marks locations of previous deletions
def _is_available(self,j):
"""Return True if the index j is available in the table."""
... | 40.481481 | 83 | 0.558097 | [
"MIT"
] | ahammadshawki8/DSA-Implementations-in-Python | CHAPTER 10 (maps, hash tables and skip lists)/probe_hash_map_class.py | 2,186 | Python |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('filer', '0009_auto_20171220_1635'),
]
operations = [
migrations.AlterField(
model_name='image',
name... | 25.95 | 168 | 0.653179 | [
"BSD-3-Clause"
] | ip-dolganov/django-filer2.0 | filer/migrations/0010_auto_20180414_2058.py | 519 | Python |
import numpy as np
from plotly.subplots import make_subplots
import plotly.graph_objects as go
class BrownianStockSimulator:
plot_title = "Simulated White noise, Brownian Motion and Stock Price"
plotly_template = "plotly_white"
plot_width = 1500
plot_height = 1000
def __init__(self, time_horizon,... | 33.408451 | 88 | 0.63027 | [
"MIT"
] | coinflip112/stoch_models_for_finance | brownian_stock_simulator.py | 2,372 | Python |
"""Tests for solver module
"""
# from mathgrid import solver
from mathgrid import solver
def test_calculator_01():
assert solver.calculator('=((1+3)*2)/(6-4)') == 4
assert solver.calculator('((1+3)*2)/(6-4)') == '((1+3)*2)/(6-4)'
assert solver.calculator('=hola') == 'hola'
| 24.083333 | 68 | 0.619377 | [
"BSD-2-Clause"
] | logiflo/mathgrid | tests/test_solver.py | 289 | Python |
"""
Tests for various datasette helper functions.
"""
from datasette.app import Datasette
from datasette import utils
from datasette.utils.asgi import Request
from datasette.utils.sqlite import sqlite3
import json
import os
import pathlib
import pytest
import tempfile
from unittest.mock import patch
@pytest.mark.para... | 31.74732 | 176 | 0.556268 | [
"Apache-2.0"
] | chriswedgwood/datasette | tests/test_utils.py | 20,731 | Python |
import pgzero
import pgzrun
import random
from pgzero.actor import Actor
__all__ = ["pgzrun", "pgzero"]
from pgzero.clock import clock
from pgzero.keyboard import keyboard
from pgzero.loaders import sounds
clouds = [Actor('cloud1', (200, 200)),
Actor('cloud2', (400, 300)),
Actor('cloud3', (600, ... | 24.791822 | 97 | 0.562453 | [
"MIT"
] | bartlomiej-kedziora/games | dino/main.py | 6,669 | Python |
"""
A pure python (slow) implementation of rijndael with a decent interface
To include -
from rijndael import rijndael
To do a key setup -
r = rijndael(key, block_size = 16)
key must be a string of length 16, 24, or 32
blocksize must be 16, 24, or 32. Default is 16
To use -
ciphertext = r.encrypt(plaintext)
plai... | 28.871728 | 117 | 0.430683 | [
"Apache-2.0"
] | codeclimate-testing/falcon | benchmarks/crypto.py | 11,029 | Python |
# (c) 2019, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit tests for Ansible module: na_ontap_rest_cli'''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import pytest
from ansible.module_utils impo... | 37.262032 | 112 | 0.644087 | [
"MIT"
] | elixir-no-nels/usegalaxy | venv/lib/python3.6/site-packages/ansible_collections/netapp/ontap/tests/unit/plugins/modules/test_na_ontap_rest_cli.py | 6,968 | Python |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.992519 | 89 | 0.701933 | [
"Apache-2.0"
] | Najah-lshanableh/tensorflow | tensorflow/contrib/learn/python/learn/basic_session_run_hooks.py | 14,433 | Python |
import unittest
from my_lambdata.assignment1 import WrangledFrame
class TestWrangledFrame(unittest.TestCase):
def test_add_state_names(self):
wf = WrangledFrame({"abbrev": ["CA", "CO", "CT", "DC", "TX"]})
breakpoint()
wf.add_state_names()
# ensure there is a "name" column
... | 27.086957 | 70 | 0.627608 | [
"MIT"
] | zack-murray/lambdata-zmurray | tests/wrangled_test.py | 623 | Python |
# -*- coding:utf-8 -*-
"""
博客系统。
"""
import pymysql
pymysql.install_as_MySQLdb()
| 12.142857 | 28 | 0.611765 | [
"Apache-2.0"
] | nebula-2020/202103 | end/nebulablogs/__init__.py | 95 | Python |
# -*- coding: utf-8 -*-
import pytest
import tempfile
from jsonschema import ValidationError
from rasa.nlu import training_data
from rasa.nlu.convert import convert_training_data
from rasa.nlu.extractors.mitie_entity_extractor import MitieEntityExtractor
from rasa.nlu.tokenizers.whitespace_tokenizer import Whitespace... | 30.249578 | 88 | 0.606088 | [
"Apache-2.0"
] | AppliedSoul/rasa | tests/nlu/base/test_training_data.py | 17,950 | Python |
# 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 ... | 43.175439 | 94 | 0.650549 | [
"MIT"
] | mccoyp/azure-keyvault-7.3-preview | sdk/keyvault/azure-keyvault/azure/keyvault/v7_3_preview/models/sas_definition_create_parameters.py | 2,461 | Python |
import ocdskingfisherprocess.cli.commands.base
import ocdskingfisherprocess.database
from ocdskingfisherprocess.transform import TRANSFORM_TYPE_UPGRADE_1_0_TO_1_1
class NewTransformUpgrade10To11CLICommand(ocdskingfisherprocess.cli.commands.base.CLICommand):
command = 'new-transform-upgrade-1-0-to-1-1'
def co... | 43.459459 | 112 | 0.636816 | [
"BSD-3-Clause"
] | matiasSanabria/kingfisher-process | ocdskingfisherprocess/cli/commands/new_transform_upgrade_1_0_to_1_1.py | 1,608 | Python |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from iris.test_case import *
class Test(BaseTest):
def __init__(self, app):
BaseTest.__init__(self, app)... | 30.774194 | 77 | 0.677149 | [
"MPL-2.0"
] | davehunt/iris | iris/tests/experiments/private_browsing_mode.py | 954 | Python |
from flask import Flask, request, abort
from linebot import (
LineBotApi, WebhookHandler
)
from linebot.exceptions import (
InvalidSignatureError
)
from linebot.models import *
app = Flask(__name__)
# LINE BOT info
line_bot_api = LineBotApi('QCynFfsDk7My1YN72sVQyvk6ArYkD2TUQW/pUxUQqllnGFNcqjZ8tKC+qMcVa2u4Lg1W... | 30.725 | 201 | 0.746949 | [
"MIT"
] | tingyo123/IoT_Project | Final_Project/hx711py/lineBotTest.py | 1,229 | Python |
#!/usr/bin/env python3
# still in development
#
import asyncio
import websockets
import json
import requests
eventsAPIPath = '/api/v1/events'
localServerIP = '0.0.0.0'
localServerAPIPort = '8000'
localServerWSPort = '8000'
localServerPath = '/sealog-server'
localToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI... | 31.347222 | 251 | 0.692955 | [
"MIT"
] | OceanDataTools/sealog-server | misc/sealog_repeater_receive.py | 2,257 | Python |
PAYLOAD_BITS_120 = '111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111'
KEY_BITS_192 = '010101010101010101010101011110100000010111101010101010101000010101110101010101010101010101010101010101010101010100001011111010101010101010101010101010101010101101... | 129 | 209 | 0.955426 | [
"MIT"
] | bejohi/StegoSources | cp1_code/test_constants.py | 516 | Python |
"""
https://leetcode.com/problems/powerful-integers/
Given two positive integers x and y, an integer is powerful if it is equal to x^i + y^j for some integers i >= 0 and j >= 0.
Return a list of all powerful integers that have value less than or equal to bound.
You may return the answer in any order. In your answer,... | 22.7 | 124 | 0.557709 | [
"Apache-2.0"
] | Davidxswang/leetcode | easy/970-Powerful Integers.py | 1,135 | Python |
class RenderNodeAction(Enum,IComparable,IFormattable,IConvertible):
"""
Enumerated actions for processing a render node during custom export.
enum RenderNodeAction,values: Proceed (0),Skip (1)
"""
def __eq__(self,*args):
""" x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx.__eq__(y) <==> x==y """
pass
... | 28.470588 | 215 | 0.667355 | [
"MIT"
] | denfromufa/ironpython-stubs | stubs.min/Autodesk/Revit/DB/__init___parts/RenderNodeAction.py | 968 | Python |
import numpy as np
import torch
from dataclasses import dataclass
from typing import List
from jiant.tasks.core import (
BaseExample,
BaseTokenizedExample,
BaseDataRow,
BatchMixin,
GlueMixin,
Task,
TaskTypes,
)
from jiant.tasks.lib.templates.shared import double_sentence_featurize, labels_t... | 26.688679 | 89 | 0.655002 | [
"MIT"
] | HonoMi/jiant | jiant/tasks/lib/wnli.py | 2,829 | Python |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 33.253923 | 80 | 0.658616 | [
"Apache-2.0"
] | ehiller/CourseBuilderV19-TeacherDashboard | modules/balancer/balancer.py | 23,311 | Python |
"""
CLI tests
"""
from tso.tsocli import __main__ as tsocli
import pytest
from unittest.mock import patch, MagicMock, mock_open
mock_configurqation = "{}"
class TestCli:
def test_cli_should_exit_with_no_args(self):
with pytest.raises(SystemExit) as pytest_wrapped_e:
tsocli.main([])
... | 30.787879 | 95 | 0.683071 | [
"MIT"
] | elijah-ward/TSO | src/tso/tsocli/tests/test_cli.py | 2,032 | Python |
#
# 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 file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 40.171875 | 105 | 0.710618 | [
"Apache-2.0"
] | 0411tony/airflow | tests/providers/microsoft/azure/transfers/test_local_to_wasb.py | 2,571 | Python |
import sys
sys.path.append("./stqft")
sys.path.append("./qcnn")
import os
#Activate the cuda env
os.environ["LD_LIBRARY_PATH"] = "$LD_LIBRARY_PATH:/usr/local/cuda/lib64/:/usr/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda-11.2/lib64:/usr/local/cuda/targets/x86_64-linux/lib/"
import time
import multiprocess... | 42.595588 | 268 | 0.669256 | [
"MIT"
] | stroblme/hqsp-main | train.py | 5,793 | Python |
# coding: utf-8
"""
ThingsBoard REST API
ThingsBoard Professional Edition IoT platform REST API documentation. # noqa: E501
OpenAPI spec version: 3.3.3PAAS-RC1
Contact: info@thingsboard.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_impo... | 56.113752 | 911 | 0.670978 | [
"Apache-2.0"
] | D34DPlayer/thingsboard-python-rest-client | tb_rest_client/api/api_pe/entity_group_controller_api.py | 132,204 | Python |
from distutils.core import setup
setup(
name='filekit',
version='0.1',
packages=['filekit'],
license='MIT',
long_description=open('README.md').read(),
long_description_content_type='md'
)
| 19.363636 | 46 | 0.661972 | [
"MIT"
] | foundling/filekit | setup.py | 213 | Python |
#==========================================================
#
# This prepare the hdf5 datasets of the DRIVE database
#
#============================================================
import os
import h5py
import numpy as np
from PIL import Image
#content/add2/E2/DRIVE_datasets_training_testing
def write_hdf5(arr,outf... | 44.462366 | 139 | 0.662636 | [
"MIT"
] | Hacker-007/E2 | prepare_datasets_DRIVE.py | 4,135 | Python |
import unittest
from niedoida_test_case import NiedoidaTestCase
class NiedoidaSmokeCaseMethodsRhf(NiedoidaTestCase):
@classmethod
def setUpClass(cls):
cls.data = cls.run_calculations("smoke-methods-rhf")
def test_energy(self):
self.assertAlmostEqual(self.data.scfenergies[0], -2056.7986203... | 25.066667 | 77 | 0.739362 | [
"MPL-2.0"
] | grzegorzmazur/niedoida | tests/niedoida/smoke-methods-rhf.py | 376 | Python |
import cv2
cap = cv2.VideoCapture(1)
cap.set(3, 640) #WIDTH
cap.set(4, 480) #HEIGHT
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
while True:
# while True:
# ret, frame = cap.read()
#
# # Our operations on the frame come here
# gray = cv2.cvtColor(frame, ... | 26.468085 | 75 | 0.578778 | [
"MIT"
] | clevtech/Zhuldyz-Upper-RPI | faces.py | 1,244 | Python |
#!/usr/bin/env python
# Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree.
from __future__ import print_function
from clang.cindex import Cursor, CursorKind, TokenKind
from utils i... | 31.035714 | 92 | 0.621116 | [
"Unlicense"
] | kevingatera/kgatewebapp | node_modules/nuclide/pkg/nuclide-clang-rpc/python/outline.py | 6,952 | Python |
# -*- coding: utf-8 -*-
"""
@date Created on Fri May 22 2020
@author martin_g for Eomys
"""
# Third party imports
import numpy as np
from scipy import signal
# Local application imports
from mosqito.sq_metrics.loudness.loudness_zwtv._square_and_smooth import (
_square_and_smooth,
)
def _third_octave_levels(sig,... | 33.388112 | 82 | 0.428003 | [
"Apache-2.0"
] | Igarciac117/MoSQITo | mosqito/sq_metrics/loudness/loudness_zwtv/_third_octave_levels.py | 9,549 | Python |
# -*- coding: utf-8 -*-
import uuid
import pytz
from faker import Faker
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.gis.db.models import PointField
from django.contrib.postgres.indexes import BrinIndex
from django.contrib.postgres.fields import JSONField
from djan... | 28.223022 | 103 | 0.638542 | [
"BSD-3-Clause"
] | mikaponics/mikaponics-back | mikaponics/foundation/models/problem_data_sheet.py | 3,923 | Python |
# Copyright (c) 2015 - present Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
import logging
from . ... | 34.297619 | 77 | 0.609511 | [
"BSD-3-Clause"
] | stefb965/infer | infer/lib/python/inferlib/capture/ant.py | 2,881 | Python |
#!/usr/bin/env python
# --coding:utf-8--
# Copyright (c) 2020 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License,
# attached with Common Clause Condition 1.0, found in the LICENSES directory.
import logging
from nebula2.common.ttypes import ErrorCode
from nebula2.Exception im... | 29.071429 | 117 | 0.782555 | [
"Apache-2.0"
] | knwng/nebula-python | nebula2/gclient/net/__init__.py | 814 | Python |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
"""
A family of functions used by CurvefittingAssessor
"""
import numpy as np
all_models = {}
model_para = {}
model_para_num = {}
curve_combination_models = ['vap', 'pow3', 'linear', 'logx_linear', 'dr_hill_zero_background', 'log_power', 'pow4... | 18.644689 | 122 | 0.532417 | [
"MIT"
] | Ascarshen/nni | src/sdk/pynni/nni/curvefitting_assessor/curvefunctions.py | 5,090 | Python |
from ourstylePy import data
def our_colours(colours=[]):
'''
Extract hexcodes for our colours
If passed a sting, returns the matching hexcode.
If passed a list, returns a list of hexcodes.
Method from https://drsimonj.svbtle.com/creating-corporate-colour-palettes-for-ggplot2.
- colours, list of... | 27.9 | 91 | 0.665472 | [
"MIT"
] | PeterGrahamJersey/ourstylePy | ourstylePy/our_colours.py | 837 | Python |
from bayesianABTest import sampleSuccessRateForBinomial
from numpy import mean
def bestOfFive(A,B,C,D,E,F):
return mean( (A > B) & (A > C) & (A > D) & (A > E) & (A > F))
############# Example: Binomial Distribution #############
# Actual data for all cases
installs = [986,1013,959,968,1029,1014]
returns = [340,2... | 38.714286 | 72 | 0.720295 | [
"Apache-2.0"
] | hugopibernat/BayesianABTestAnalysis | code/examples/example_mikhail.py | 1,355 | Python |
__version__ = "2.2.3"
# Work around to update TensorFlow's absl.logging threshold which alters the
# default Python logging output behavior when present.
# see: https://github.com/abseil/abseil-py/issues/99
# and: https://github.com/tensorflow/tensorflow/issues/26691#issuecomment-500369493
try:
import absl.logging... | 59.990385 | 128 | 0.677432 | [
"Apache-2.0"
] | seongwookchun/transformers | transformers/__init__.py | 12,478 | Python |
from ..http import dump_header
from ..http import parse_set_header
from ..utils import environ_property
from ..utils import header_property
class CORSRequestMixin(object):
"""A mixin for :class:`~werkzeug.wrappers.BaseRequest` subclasses
that adds descriptors for Cross Origin Resource Sharing (CORS)
heade... | 34.097087 | 88 | 0.669989 | [
"MIT"
] | 997Yi/Flask-web | venv/Lib/site-packages/werkzeug/wrappers/cors.py | 3,512 | Python |
import os
import RPi.GPIO as gpio
import time
import random
from mesafe import distance
motorhizi = 2.5
hiz = 100
aci2 = aci3 = aci4 = 6
aci = 5.5
in4 = 26
in3 = 4
in2 = 12
in1 = 8
solled = 9
sagled = 11
gpio.setwarnings(False)
def init():
gpio.setwarnings(False)
gpio.setmode(gpio.BCM)
gpio.setup(22,g... | 20.848943 | 115 | 0.501522 | [
"Apache-2.0"
] | ahmetakif/Voice-Controlled-Raspberry-Pi-Robot | Robotics/src/otonomgorev.py | 6,901 | Python |
def gimme(x):
print("It was a %s indeed" % x)
| 10.4 | 35 | 0.538462 | [
"Apache-2.0"
] | DavidLeoni/iep | jup-and-py-example/local.py | 52 | Python |
import argparse
parser = argparse.ArgumentParser(description="PyTorch implementation of action recognition models")
parser.add_argument('--dataset', type=str, choices=['somethingv1','somethingv2','diving48'],
default = 'somethingv1')
parser.add_argument('--root_path', type = str, default = '../',
... | 62.773333 | 140 | 0.594095 | [
"MIT"
] | yucornetto/CAKES | opts.py | 4,708 | Python |
from typing import List, Tuple, Optional
import aiosqlite
from spare.types.blockchain_format.sized_bytes import bytes32
from spare.util.db_wrapper import DBWrapper
class WalletInterestedStore:
"""
Stores coin ids that we are interested in receiving
"""
db_connection: aiosqlite.Connection
db_wra... | 38.313725 | 115 | 0.651228 | [
"Apache-2.0"
] | Spare-Network/spare-blockchain | spare/wallet/wallet_interested_store.py | 3,908 | Python |
"""
Client for Yandex.Disk.
"""
__version__ = '0.0.1'
| 10.8 | 23 | 0.611111 | [
"MIT"
] | comalex/ProjectBacup | project_backup/__init__.py | 54 | Python |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... | 44.391691 | 670 | 0.654412 | [
"Apache-2.0"
] | polivbr/pulumi-azure-native | sdk/python/pulumi_azure_native/operationalinsights/storage_insight_config.py | 14,960 | Python |
# This file will consist of some wrapper for using MySQL
# It is mainly used for preparing and calling mysql cli
import logging
from mysql_autoxtrabackup.general_conf import path_config
from mysql_autoxtrabackup.general_conf.generalops import GeneralClass
from mysql_autoxtrabackup.process_runner.process_runner import ... | 40.409091 | 79 | 0.669291 | [
"MIT"
] | Big-Ele/MySQL-AutoXtraBackup | mysql_autoxtrabackup/utils/mysql_cli.py | 1,778 | Python |
# Copyright 2018 The Cirq Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 30.917526 | 74 | 0.532844 | [
"Apache-2.0"
] | jaywha/Cirq | cirq/contrib/paulistring/optimize_test.py | 3,619 | Python |
# coding=utf-8
# Copyright 2019 The Google Research 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 applicab... | 39.346939 | 79 | 0.713174 | [
"MIT"
] | AaltoVision/automodulator | pioneer/robust_loss_pytorch/cubic_spline.py | 3,856 | Python |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 32.14 | 85 | 0.764779 | [
"Apache-2.0"
] | TheMichaelHu/python-aiplatform | samples/generated_samples/aiplatform_v1_generated_pipeline_service_delete_training_pipeline_sync.py | 1,607 | Python |
'''
file.readline() 사용해서 csv 파일 열기
'''
#
# def my_csv_reader(fn:str, header=True) -> list:
# '''
# csv 파일의 데이터 2차원 행렬 형태로 리턴
#
#
# :param fn: 읽을 파일 이름(예: data\\exam.csv)
# :param header: csv파일의 헤더 존재 여부
# :return: csv 파일에서 헤더는 제외한 데이터로 이루어진 2차원 리스트
# '''
#
#
# if __name__ == '__main__':
#
# ... | 19.18 | 64 | 0.542231 | [
"MIT"
] | SOOIN-KIM/lab-python | lec07_file/file07.py | 1,259 | Python |
from urllib.parse import urlparse
from django.conf import settings
from django.db import models
from django_extensions.db.fields import UUIDField
from pyrabbit.http import HTTPError
from django.contrib.sites.models import Site
from apps.queues import rabbit
class Queue(models.Model):
name = models.CharField(max... | 29.32 | 105 | 0.656207 | [
"Apache-2.0"
] | OhMaley/codalab-competitions | codalab/apps/queues/models.py | 1,466 | Python |
#
# This example is again a graph coloring problem. In this case, however,
# a stronger object oriented approach is adopted to show how Coopy is
# indeed compatible with such practices.
#
import coopy
import random
class Node:
def __init__(self):
self._color = coopy.symbolic_int('c')
self._neighb... | 28.109375 | 74 | 0.617009 | [
"MIT"
] | abarreal/coopy | examples/example-5.py | 1,799 | Python |
# -*- coding: utf-8 -*-
#
# Electrum - lightweight Dogecoin client
# Copyright (C) 2018 The Electrum developers
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# includ... | 27.890995 | 81 | 0.683772 | [
"MIT"
] | 0xAyanami/electrum | electrum/constants.py | 5,885 | Python |
# Copyright 2015 ETH Zurich
#
# 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, sof... | 31.066298 | 82 | 0.577983 | [
"Apache-2.0"
] | TpmKranz/netsec-scion | python/lib/socket.py | 11,246 | Python |
#!/bin/python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
Auth, Mail, PluginManager and various utilities
------------------------------------------------
"""
import ... | 40.736364 | 178 | 0.531913 | [
"BSD-3-Clause"
] | kvk3008/project | gluon/tools.py | 250,936 | Python |
"""
WSGI config for car_selling_parts project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJ... | 24.176471 | 78 | 0.79562 | [
"MIT"
] | vis7/car_parts_selling | car_selling_parts/wsgi.py | 411 | Python |
'''
UnrealCV
========
Provides functions to interact with games built using Unreal Engine.
>>> import unrealcv
>>> (HOST, PORT) = ('localhost', 9000)
>>> client = unrealcv.Client((HOST, PORT))
'''
import sys, ctypes, struct, threading, socket, re, time, logging
try:
from Queue import Queue
except:
from queue i... | 38.478006 | 149 | 0.604146 | [
"MIT"
] | AI-cecream/unrealcv | client/python/unrealcv/__init__.py | 13,121 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.