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 |
|---|---|---|---|---|---|---|---|---|
"""Top-level package for Bactopia."""
__version__ = '2.1.0'
__all__ = [
'const',
'parse',
'summary'
]
from bactopia import *
| 11.666667 | 37 | 0.585714 | [
"MIT"
] | bactopia/bactopia-ap | bactopia/__init__.py | 140 | Python |
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 28 12:54:52 2016
@author: YPC
"""
import matplotlib.pyplot as plt
import json
import numpy
f=open('../petitions.json', 'r')
met=json.load(f)
f.close()
s=[]
s2=[]
""" this plots the signature distribution function"""
if False:
for i in range(len(m... | 27.888158 | 114 | 0.610757 | [
"MIT"
] | yukimasano/pet_forecast | network/get_sig_histogram.py | 4,239 | Python |
# model settings
model = dict(
type='RetinaNet',
pretrained='torchvision://resnet50',
backbone=dict(type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_gr... | 35.359375 | 75 | 0.53977 | [
"Apache-2.0"
] | jshilong/SEPC | sepc/exp/freeanchor/sepc_freeanchor.py | 4,526 | Python |
"""
PollingDelayConfig
"""
from typing import Any
class PollingDelayConfig(object):
"""
Summarized configuration for the polling_delay settings in the Gateway Application.
"""
DEFAULT_MIN_TRANSACTION_POLLING_DELAY_S = 0.0
DEFAULT_MAX_TRANSACTION_POLLING_DELAY_S = 60.0
DEFAULT_MIN_ATTEMPT_LIST... | 41.71875 | 115 | 0.762921 | [
"MIT"
] | NeolithEra/WavesGatewayFramework | waves_gateway/model/polling_delay_config.py | 2,670 | Python |
import time
from options.train_options import TrainOptions
from data import DataLoader
from models import create_model
from util.writer import Writer
from test import run_test
if __name__ == '__main__':
opt = TrainOptions().parse()
# opt.serial_batches = True # no shuffle
print('Creating DataLoader...')
... | 34.289157 | 83 | 0.576599 | [
"MIT"
] | blufzzz/MeshCNN | train.py | 2,846 | Python |
# Tests that are not required benchmark-operator pod
from benchmark_runner.common.oc.oc import OC
from tests.integration.benchmark_runner.test_environment_variables import *
import tempfile
import tarfile
import time
from benchmark_runner.common.prometheus.prometheus_snapshot import PrometheusSnapshot
def test_oc_g... | 26.060976 | 141 | 0.704024 | [
"Apache-2.0"
] | RobertKrawitz/benchmark-runner | tests/integration/benchmark_runner/common/oc/test_oc_without_operator.py | 4,274 | Python |
from openpyxl.workbook import Workbook
from scrapy import Selector
from selenium import webdriver
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager
import time
from csv import writer
driver_path = 'D:\\Application\\installers\\ChromeDriver\\chromedriver.exe'
def app... | 35.691667 | 111 | 0.676162 | [
"Apache-2.0"
] | sr-comp/Divar | selenium_test.py | 4,283 | Python |
# RUN: python %s | llvm-mc -filetype=obj -triple i686-pc-win32 - | llvm-readobj -h | FileCheck %s
from __future__ import print_function
# This test checks that the COFF object emitter can produce objects with
# more than 65279 sections.
# While we only generate 65277 sections, an implicit .text, .data and .bss will
... | 32.241379 | 97 | 0.656684 | [
"Apache-2.0"
] | 2henwei/llvm | test/MC/COFF/bigobj.py | 935 | Python |
# Calculation the Elastic Constants from given deformations
import os
import subprocess
from pymatgen import Structure, Lattice, Specie
from pymatgen.analysis.elasticity import DeformedStructureSet, Strain, Stress, ElasticTensor
from pmg_lammps import RelaxSet, LammpsLog, LammpsData, LammpsPotentials
supercell = (5... | 35.240964 | 101 | 0.709744 | [
"MIT"
] | costrouc/pymatgen-lammps | examples/elastic.py | 2,925 | Python |
# -*- coding: utf-8 -*-
from mootdx.quotes import Quotes
client = Quotes.factory(market='std') # 标准市场
# client = Quotes.factory(market='ext', multithread=True, heartbeat=True) # 扩展市场
quote = client.bars(symbol='600036', frequency=9, offset=10)
print(quote)
quote = client.index(symbol='000001', frequency=9)
print(qu... | 25.2 | 80 | 0.719577 | [
"MIT"
] | Pr-Chen/mootdx | sample/basic_quotes.py | 394 | Python |
import numpy as np
def generate_A(filename1, filename2, noise = 'gau'):
exp_T = 4000
big_y_true_gau = []
big_y_noise_gau = []
big_y_true_t2 = []
big_y_noise_t2 = []
for times in range(100):
y_true_gau = np.zeros((exp_T, 1, 1))
y_true_gau[0] = np.random.rand()
y_true_gau[1... | 41.186047 | 117 | 0.570299 | [
"Apache-2.0"
] | FengxiangHe/SpHAM | generate_exampleA.py | 1,771 | Python |
# pylint: disable=missing-docstring, line-too-long, invalid-name, arguments-differ, no-member, pointless-statement
from functools import partial
import torch
from e3nn import Kernel, rs
from e3nn.non_linearities.norm import Norm
from e3nn.non_linearities.rescaled_act import swish
from e3nn.point.operations import Co... | 31.214286 | 114 | 0.762777 | [
"MIT"
] | L-sky/e3nn | tests/readme_example_test.py | 1,311 | Python |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
from ckeditor.fields import RichTextField
from theJekyllProject.choices import BlogTemplates
class Contact(models.Model):
first_name = models.CharField(
max_length=200... | 22.471698 | 77 | 0.589253 | [
"MIT"
] | silvrwolfboy/theJekyllProject | djangoFiles/theJekyllProject/models.py | 5,955 | Python |
# Copyright 2011 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 applicable l... | 31.859223 | 79 | 0.534359 | [
"Apache-2.0"
] | bopopescu/nova-35 | nova/tests/utils.py | 6,563 | Python |
import os.path
from importlib import import_module
basedir = os.path.abspath(os.path.dirname(__file__))
env = os.getenv('ENVIRONMENT', 'local')
if not env in ['local', 'test']:
config_file = '/path/to/config/directory/' + env + '.py'
if not os.path.isfile(config_file):
env = 'local'
config_name = 'pat... | 27.764706 | 60 | 0.709746 | [
"Apache-2.0"
] | gotitinc/code-samples | misc/configuration/config.py | 472 | Python |
"""distutils.command.build
Implements the Distutils 'build' command."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: build.py 62197 2008-04-07 01:53:39Z mark.hammond $"
import sys, os
from distutils.core import Command
from distutils.errors import DistutilsOptionError
from distutils... | 35.207547 | 76 | 0.58771 | [
"Apache-2.0"
] | Alexisblues/sl4a | python/src/Lib/distutils/command/build.py | 5,598 | Python |
"""
This script:
- Train Sobolev Alignment.
- Save the two networks.
"""
import os, sys, getopt
import pandas as pd
import numpy as np
import re
from anndata import AnnData
import torch
from pickle import dump, load
from copy import deepcopy
import gc
from sobolev_alignment import SobolevAlignment
# Import params
fr... | 26.443396 | 119 | 0.727435 | [
"MIT"
] | saroudant/sobolev_alignment_manuscript | figure_3/model_III/sobolev_alignment/train_VAE.py | 2,803 | Python |
import json
from django.test.utils import override_settings
from tastypie.exceptions import NotFound
from basic.models import Note
from testcases import TestCaseWithFixture
from django.test.testcases import SimpleTestCase
@override_settings(ROOT_URLCONF='validation.api.urls')
class FilteringErrorsTestCase(TestCaseW... | 38.131707 | 120 | 0.567609 | [
"BSD-3-Clause"
] | 7Geese/django-tastypie | tests/validation/tests.py | 7,817 | Python |
# -*- coding: utf-8 -*-
# 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 "Lic... | 35.237716 | 128 | 0.618772 | [
"Apache-2.0"
] | pantuza/GloboNetworkAPI-WebUI | CadVlan/Pool/views.py | 53,071 | Python |
# Copyright 2020 The Magenta 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 or agreed to in ... | 33.594278 | 89 | 0.70384 | [
"Apache-2.0"
] | flyingleafe/magenta | magenta/models/score2perf/score2perf.py | 25,834 | Python |
# Copyright (c) Facebook, Inc. and its affiliates.
import os
import warnings
# import git
import torch
import yaml
from pythia.common.registry import registry
from pythia.utils.distributed_utils import is_main_process, synchronize
from pythia.utils.general import (ckpt_name_from_core_args,
... | 37.510121 | 120 | 0.586508 | [
"BSD-3-Clause"
] | likenneth/mmgnn_textvqa | pythia/utils/checkpoint.py | 9,265 | Python |
from pycronserver.server import get_pycronserver, execute_funct
from pycronserver.local import get_local_pycronserver, create_config_folder
| 46.666667 | 75 | 0.9 | [
"BSD-3-Clause"
] | pyscioffice/pycronserver | pycronserver/__init__.py | 140 | Python |
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pants.backend.codegen.wire.java.register import build_file_aliases as register_codegen
from pants.backend.jvm.targets.jar_library import JarLibrary
from pants.build_graph.register imp... | 41.563636 | 91 | 0.728346 | [
"Apache-2.0"
] | SergeKireev/pants | contrib/thrifty/tests/python/pants_test/pants/contrib/thrifty/test_thrifty_gen.py | 2,286 | Python |
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \
PermissionsMixin
from django.conf import settings
# Create your models here.
class UserManager(BaseUserManager):
def create_user(self, email, password=None, **extra_fields... | 28.786667 | 78 | 0.677165 | [
"MIT"
] | shadow-smoke/recipe-app-api | app/core/models.py | 2,159 | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Red Hat, Inc
# Written by Seth Vidal <skvidal at fedoraproject.org>
# Copyright: (c) 2014, Epic Games, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, p... | 39.533504 | 160 | 0.557216 | [
"Apache-2.0"
] | aburan28/ansible-devops-pipeline | venv/lib/python2.7/site-packages/ansible/modules/packaging/os/yum.py | 61,950 | Python |
# -*- coding: utf-8 -*-
import os
import sys
from click import (
argument,
command,
echo,
edit,
group,
Group,
option,
pass_context,
Option,
version_option,
BadParameter,
)
from click_completion import init as init_completion
from click_completion import get_code
from click_di... | 25.212766 | 116 | 0.60444 | [
"MIT"
] | mlhamel/pipenv | pipenv/cli.py | 27,287 | Python |
import sys
import pandas as pd
def pci_wld_eci(eci_file_path, pci_file_path, ymp, ymw, year):
pcis = pd.read_csv(pci_file_path, sep="\t", compression="bz2", converters={"hs_id": str})
pcis["year"] = int(year)
pcis["month"] = "00"
pcis = pcis.set_index(["year", "month", "hs_id"])
ecis = pd.... | 28.8 | 93 | 0.583333 | [
"MIT"
] | DataViva/dataviva-scripts | scripts/secex_monthly/_pci_wld_eci.py | 576 | Python |
import json
import os
import argparse
def main(split):
with open(args.data_path + '/' + split + '.json') as f:
data = json.load(f)
sparc = []
for i in range(len(data)):
d = data[i]
for j in range(len(d['interaction'])):
turn = d['interaction'][j]
sparc.appen... | 35.840909 | 94 | 0.492708 | [
"MIT"
] | WDZRMPCBIT/chase | DuoratChar/data/convert.py | 1,585 | Python |
#!/usr/bin/env python3
import sys
import math
import numpy as np
import sympy as sp
from selfdrive.locationd.models.constants import ObservationKind
from rednose.helpers.ekf_sym import EKF_sym, gen_code
i = 0
def _slice(n):
global i
s = slice(i, i + n)
i += n
return s
class States():
# Vehicle model p... | 27.494898 | 191 | 0.642234 | [
"MIT"
] | qiubit/openpilot | selfdrive/locationd/models/car_kf.py | 5,389 | Python |
import os
def iterate_files(directory):
for root, dirs, filenames in os.walk(directory):
for filename in filenames:
if _is_log_file(filename):
yield os.path.join(root, filename)
def _is_log_file(filename):
basename, extension = os.path.splitext(filename)
return ((exte... | 26.928571 | 73 | 0.660477 | [
"MIT"
] | mtlynch/chat_unifier | chat_unifier/file_iterators/trillian_xml.py | 377 | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests_cache
import datetime
import pandas as pd
from datetime import timedelta
import pandas as pd
from pandas.io.common import ZipFile
from pandas.compat import BytesIO, StringIO, PY2
def main():
expire_after = timedelta(days=1)
if PY2:
filenam... | 34.37931 | 182 | 0.622869 | [
"BSD-3-Clause"
] | femtotrader/pandas_datareaders | draft/truefx/truefx_tick.py | 1,994 | Python |
from rasa.core.events import ActionExecuted, SlotSet, UserUttered
from rasa.core.training import visualization
def test_style_transfer():
r = visualization._transfer_style({"class": "dashed great"}, {"class": "myclass"})
assert r["class"] == "myclass dashed"
def test_style_transfer_empty():
r = visualiz... | 28.754902 | 87 | 0.65837 | [
"Apache-2.0"
] | 1tupac/rasa | tests/core/test_visualization.py | 2,933 | Python |
# This file is part of QuTiP: Quantum Toolbox in Python.
#
# Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met... | 34.862205 | 90 | 0.658385 | [
"BSD-3-Clause"
] | trxw/qutip | qutip/graph.py | 8,855 | Python |
#!/usr/bin/env python
import sys
import json
import re
import logging
import os
import os.path
import codecs
import time
import conf
import logs
import kqueue
log = logging.getLogger(__name__)
# constant to select bind() for attaching the socket
BIND = 1
# constant to select connect() for attaching the socket
CONNE... | 30.018581 | 117 | 0.565978 | [
"MIT"
] | nwself/geocoding | twitter_countryGeo/twitter-geo/etool/queue.py | 17,771 | Python |
# -*- coding: utf-8 -*-
"""Base exchange class"""
# -----------------------------------------------------------------------------
__version__ = '1.18.575'
# -----------------------------------------------------------------------------
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import NetworkE... | 40.56631 | 299 | 0.595025 | [
"MIT"
] | newdime/ccxt | python/ccxt/base/exchange.py | 75,863 | Python |
"""
Utility for cloning ScrapyCloud jobs
Features tagging of cloned from/to jobs (both source and destination) and avoids to clone source jobs already cloned.
By default cloned jobs are scheduled in the same project as source job. If --project-id is given, target project
is overriden.
"""
import logging
from shub_workf... | 32.125 | 120 | 0.612124 | [
"BSD-3-Clause"
] | curita/shub-workflow | shub_workflow/clone_job.py | 4,883 | Python |
import os
from conans import tools, ConanFile, CMake
from conans.errors import ConanInvalidConfiguration, ConanException
class CMakeConan(ConanFile):
name = "cmake"
description = "Conan installer for CMake"
topics = ("conan", "cmake", "build", "installer")
url = "https://github.com/conan-io/conan-cent... | 39.848739 | 127 | 0.615141 | [
"MIT"
] | LunarWatcher/conan-center-index | recipes/cmake/3.x.x/conanfile.py | 4,742 | Python |
import os
import sys
filename = __file__[:-5] + '-input'
with open(filename) as f:
board = list(map(lambda s: list(map(int, list(s))), f.read().splitlines()))
max_row = len(board)
max_col = len(board[0])
def get_neighbors(row, col):
n = []
if(row > 0):
n.append((row-1,col))
if(row+1 < max_r... | 24.72549 | 145 | 0.610626 | [
"MIT"
] | lsangers/AdventOfCode | 2021/09-2.py | 1,261 | Python |
import logging
import os
import shutil
import tempfile
import uuid
import re
from typing import Tuple, List, Text, Set, Union, Optional, Iterable
from rasa.nlu.training_data import loading
from rasa.utils.io import DEFAULT_ENCODING
logger = logging.getLogger(__name__)
def get_core_directory(paths: Optional[Union[Tex... | 28.809302 | 91 | 0.658541 | [
"Apache-2.0"
] | Amirali-Shirkh/rasa-for-botfront | rasa/data.py | 6,194 | Python |
import requests
import sys
import json
requests.packages.urllib3.disable_warnings()
from requests.packages.urllib3.exceptions import InsecureRequestWarning
SDWAN_IP = "10.10.20.90"
SDWAN_USERNAME = "admin"
SDWAN_PASSWORD = "C1sco12345"
class rest_api_lib:
def __init__(self, vmanage_ip, username, password):
... | 32.226415 | 165 | 0.652225 | [
"MIT"
] | victornguyen98/luanvan2020 | app/Http/Controllers/Dashboard/Wan_edge_Health.py | 1,708 | Python |
"""
Run all TDDA tests
"""
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from tdda.referencetest import ReferenceTestCase
from tdda.constraints.testconstraints import *
from tdda.rexpy.testrexpy import *
from tdda.referencetest.tests.alltests import *
... | 19.842105 | 48 | 0.803714 | [
"MIT"
] | Daniel-Mietchen/tdda | tdda/testtdda.py | 377 | Python |
# pylint: disable=too-many-lines
# 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) AutoRe... | 44.411035 | 4,257 | 0.6624 | [
"MIT"
] | AikoBB/azure-sdk-for-python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py | 311,499 | Python |
steps = 0
c = {}
m = 1
def collatz(n):
global steps
if n in c:
steps += c[n]
return
if n == 1:
return
steps += 1
if n % 2 == 0:
collatz(n/2)
return
collatz(3 * n + 1)
def main(max):
global steps
global m
for i in range(1, max):... | 11.487179 | 27 | 0.419643 | [
"MIT"
] | Dinoosawruss/project-euler | Python/14 - Longest Collatz sequence/main.py | 448 | Python |
class Constants:
"""Storing all constants of the project."""
_author = "muhammad abdullah"
_email = "iamabdullahmughal@gmail.com"
_version = "0.0.4"
@property
def author(self):
return self._author
@property
def email(self):
return self._email
@property
def vers... | 20 | 47 | 0.622222 | [
"MIT"
] | iAbdullahMughal/espionage | espionage/constants.py | 360 | Python |
from __future__ import absolute_import
from django.conf.urls import *
from django.views.static import serve
from ajax import views
import django
import os
JAVASCRIPT_PATH = "%s/js" % os.path.dirname(__file__)
if django.VERSION < (1, 8):
urlpatterns = patterns('ajax.views',
(r'^(?P<application>\w+)/(?P<mod... | 44.692308 | 163 | 0.598967 | [
"BSD-3-Clause"
] | joestump/django-ajax | ajax/urls.py | 1,162 | Python |
import random
def ordenamiento_por_mezcla(lista):
if len(lista) > 1:
medio = len(lista) // 2
izquierda = lista[:medio]
derecha = lista[medio:]
# llamada recursiva en cada mitad
ordenamiento_por_mezcla(izquierda)
ordenamiento_por_mezcla(derecha)
# Iteradores para recorrer las dos sublista... | 20.098039 | 66 | 0.612683 | [
"MIT"
] | lmonsalve22/Learning-to-Code | python/poo_algoritmos/merge_sort.py | 1,027 | Python |
# -*- coding: ISO-8859-15 -*-
# =============================================================================
# Copyright (c) 2004, 2006 Sean C. Gillies
# Copyright (c) 2007 STFC <http://www.stfc.ac.uk>
#
# Authors :
# Dominic Lowe <d.lowe@rl.ac.uk>
#
# Contact email: d.lowe@rl.ac.uk
# ========================... | 43.446469 | 222 | 0.604677 | [
"BSD-3-Clause"
] | ferreteleco/OWSLib | owslib/coverage/wcs100.py | 19,073 | Python |
import json
import os
from flask_app.config import get_config
from flask_app.logging import get_logger
import boto3
class SQSEvents:
def __init__(self, logger=None, config=None):
# logger
self.logger = logger if logger is not None else get_logger()
# configurations
self.config = ... | 29.964539 | 103 | 0.550296 | [
"MIT"
] | andersoncontreira/aws-ecs-flask-skeleton-python | flask_app/events/aws/sqs.py | 4,225 | Python |
import requests
files = {
'username': (None, 'davidwalsh'),
'password': (None, 'something'),
}
response = requests.post('http://domain.tld/post-to-me.php', files=files)
| 19.888889 | 73 | 0.648045 | [
"MIT"
] | 7alva7/curlconverter | fixtures/python/post_form.py | 179 | Python |
from uuid import uuid4
from typing import Optional, Dict, Any, List
from appgate.openapi.types import OpenApiDict, AttribType, AttributesDict, \
IGNORED_EQ_ATTRIBUTES, OpenApiParserException, InstanceMakerConfig, UUID_REFERENCE_FIELD, K8S_LOADERS_FIELD_NAME
write_only_formats = {'PEM', 'password'}
class SimpleA... | 36.598425 | 116 | 0.596386 | [
"MIT"
] | appgate/sdp-operator | appgate/openapi/attribmaker.py | 4,648 | Python |
"""Exemplo de como virar[flip] imagems."""
from PIL import Image
# Abre a imagem
im = Image.open('beijo_menor.jpg')
# Flip
im.transpose(Image.FLIP_LEFT_RIGHT).show() # Invete na horizontal
im.transpose(Image.FLIP_TOP_BOTTOM).show() # Invete na vertical
# Transposição
im.transpose(Image.ROTATE_90).show()
im.transpo... | 27.117647 | 66 | 0.761388 | [
"MIT"
] | BrunoPontesLira/live-de-python | codigo/Live176/exemplos_dos_slides/exemplo_05.py | 463 | Python |
# coding: utf-8
"""
Deep Lynx
The construction of megaprojects has consistently demonstrated challenges for project managers in regard to meeting cost, schedule, and performance requirements. Megaproject construction challenges are common place within megaprojects with many active projects in the United State... | 58.1 | 1,455 | 0.790017 | [
"MIT"
] | idaholab/Deep-Lynx-Python-Package | test/test_get_import_data_response.py | 2,324 | Python |
#! /usr/bin/env python 3
import os
import sublime
import sublime_plugin
import random
import re
import sys
import math
__version__ = '0.1.0'
__authors__ = ['Ryan Grannell (@RyanGrannell)']
class BabelCommand (sublime_plugin.WindowCommand):
"""
babel loads a random file from your
currently open folders.
... | 11.885714 | 50 | 0.704327 | [
"MIT"
] | rgrannell1/sublime-exec | sublime_exec.py | 416 | Python |
# import pandas as pd
#
# csv_data = pd.read_csv('E:\\AI_Object_Detect\\Code\\TextRecognitionDataGenerator\\idcard_file.txt', sep=',', header=0, encoding='UTF-8')
# N = 5
# csv_batch_data = csv_data.tail(N)
# print(csv_batch_data.shape)
import csv
import os
idcard_file = 'E:\\AI_Object_Detect\\Code\\TextRecognitionDat... | 33.372881 | 160 | 0.630269 | [
"MIT"
] | yuliangzhang/TextRecognitionDataGenerator | TextRecognitionDataGenerator/idcard_file_parse.py | 2,097 | Python |
from typing import Tuple, Union
import numpy as np
import pandas as pd
import tensorflow as tf
from src.models.dnn_regressor_funcs import (
_compile_model,
_create_keras_model,
_fit_model,
_to_input_list,
)
def predict(model: tf.keras.Model, X_test: pd.DataFrame, cate_cols: list) -> np.array:
""... | 26.612245 | 112 | 0.662577 | [
"MIT"
] | onurerkin/prohack | src/models/dnn_regressor.py | 2,608 | Python |
from pathlib import Path
from napari import Viewer
from qtpy.QtCore import Qt
from qtpy.QtWidgets import (
QErrorMessage,
QFileDialog,
QPushButton,
QVBoxLayout,
QWidget,
)
from ..animation import Animation
from .animationslider_widget import AnimationSliderWidget
from .frame_widget import FrameWid... | 35.565022 | 89 | 0.668012 | [
"BSD-3-Clause"
] | tlambert-forks/napari-animation | napari_animation/_qt/animation_widget.py | 7,931 | Python |
from django.contrib import admin
from profiles_api import models
# Register your models here.
admin.site.register(models.UserProfile) # registers the model on the admin site
admin.site.register(models.ProfileFeedItem)
| 31.285714 | 79 | 0.826484 | [
"MIT"
] | yash-hash/Profiles-rest-api | profiles_api/admin.py | 219 | Python |
"""initial
Revision ID: 3741581c7fc4
Revises:
Create Date: 2017-10-02 09:13:51.619334
"""
# revision identifiers, used by Alembic.
revision = '3741581c7fc4'
down_revision = None
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by... | 48.955224 | 125 | 0.683232 | [
"BSD-3-Clause"
] | ShacharOch/anyway | alembic/versions/3741581c7fc4_initial.py | 9,840 | Python |
from pydantic import BaseModel, HttpUrl
from typing import List
class RegisterHostModel(BaseModel):
name: str
url: HttpUrl
ports: List[int]
| 19.25 | 39 | 0.74026 | [
"MIT"
] | xrzhev/abysswatcher-api | src/models/HostsModel.py | 154 | Python |
## this tool is the core function of cnv and snv analysis
## author: taozhou
## email: zhou.tao@genecast.com.cn
import matplotlib as mpl
mpl.use('Agg')
import warnings
warnings.filterwarnings("ignore")
import itertools
import seaborn as sns
import matplotlib.pylab as plt
import matplotlib.colors as mc
from genecast_pa... | 39.23431 | 156 | 0.630266 | [
"Apache-2.0"
] | 861934367/genecast | genecast_package/core.py | 9,377 | Python |
#--coding: utf8--
from django import forms
from invoices.models import Customer
class InvoiceForm(forms.Form):
FORMAT_CHOICES = (
('pdf', 'PDF'),
('docx', 'MS Word'),
('html', 'HTML'),
)
number = forms.CharField(label='Invoice #')
customer = forms.ModelChoiceField(queryset=Cu... | 24.368421 | 70 | 0.647948 | [
"MIT"
] | Barolina/templated-docs | example/invoices/forms.py | 463 | Python |
# Generated by Django 2.2.6 on 2019-10-29 15:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('data_driven_acquisition', '0004_acl'),
]
operations = [
migrations.AlterModelOptions(
name='file',
options={'get_lat... | 36.84375 | 257 | 0.616624 | [
"CC0-1.0"
] | adam-grandt-tts/data-driven-acquisition | data_driven_acquisition/migrations/0005_auto_20191029_1531.py | 1,179 | Python |
#!/usr/bin/env python3
from __future__ import annotations
import contextlib
import json
import os
import socket
import struct
import boldui.hotrefresh
from simplexp import Expr, var, Oplist
from typing import List
class Actions:
UPDATE_SCENE = 0
HANDLER_REPLY = 1
SET_VAR = 2
WATCH_ACK = 3
def strin... | 31.106164 | 124 | 0.526148 | [
"MIT"
] | Wazzaps/boldui | boldui/__init__.py | 9,083 | Python |
# Copyright 2015 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... | 31.145833 | 80 | 0.720401 | [
"Apache-2.0"
] | 18802459097/tensorflow | tensorflow/contrib/losses/__init__.py | 1,495 | Python |
from __future__ import print_function
from time import sleep
import matplotlib.pyplot as plt
import signal
def sigIntHandler(signal, frame):
raise KeyboardInterrupt
def publishPose(q, problem, t=0.0):
problem.getScene().Update(q, t)
problem.getScene().getSolver().publishFrames()
def publishTrajectory(... | 24.847458 | 64 | 0.595498 | [
"BSD-3-Clause"
] | LongfeiProjects/exotica | exotica_python/src/pyexotica/publish_trajectory.py | 1,466 | Python |
__author__ = 'atzorvas'
| 12 | 23 | 0.75 | [
"MIT"
] | atzorvas/droughtmeteo | views/stations/__init__.py | 24 | Python |
from Utilities.CSV import csv_data_line
from Utilities import date_formating
import logging
from datetime import date
import time
import datetime
from shared_types import DateDict
logging.basicConfig(filename='../../CrawlerLogs' + 'Crawlerlog-' +
date.today().strftime("%b-%Y") + '.log',
... | 29.09375 | 96 | 0.575188 | [
"MIT"
] | kivzcu/heatmap.zcu | modules/crawler/DatasetProcessing/OBSAZENIMISTNOSTI_processor.py | 1,862 | Python |
# (C) Datadog, Inc. 2021-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from datadog_checks.base.utils.models.fields import get_default_field_value
def shared_proxy(field, value):
return get_default_field_value(field, value)
def shared_service(field, value):
return... | 20.4 | 75 | 0.78483 | [
"BSD-3-Clause"
] | florusb/integrations-core | amazon_msk/datadog_checks/amazon_msk/config_models/defaults.py | 5,814 | Python |
# IDLE (Python 3.8.0)
# module_for_lists_of_terms
def termal_generator(lict):
length_of_termal_generator = 16
padding = length_of_termal_generator - len(lict)
count = padding
while count != 0:
lict.append([''])
count = count - 1
termal_lict = []
for first_inner in lict[0]:
... | 35.370536 | 124 | 0.47015 | [
"MIT"
] | ShawnJSavoie2/ToBeRedone | lists_of_terms/shodule_for_lists_of_terms.py | 7,923 | Python |
import logging
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.shortcuts import render
from django.utils import timezone
from django.utils.translation import ugettext as _
from rr.forms.contact import ContactForm
from rr.models.contact import Contact
from rr.u... | 33.301205 | 83 | 0.596599 | [
"MIT"
] | UniversityofHelsinki/sp-registry | rr/views/contact.py | 2,764 | Python |
'''
Test the cert_update plugin.
'''
# 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, Ve... | 41.412587 | 166 | 0.738433 | [
"Apache-2.0"
] | zds05/trafficserver | tests/gold_tests/pluginTest/cert_update/cert_update.test.py | 5,922 | Python |
# Question 9
# List all files in a directory.
from os import listdir
print(listdir('/home/elif/Desktop'))
| 11.1 | 36 | 0.711712 | [
"MIT"
] | CodedLadiesInnovateTech/-python-challenge-solutions | elif_bayindir/phase_1/python_basic_1/day_6/q9.py | 111 | Python |
from django.db import models
class alumno(models.Model):
alum_id = models.AutoField(primary_key=True)
alum_nom = models.CharField(max_length=100, help_text="Nombre del alumno", unique=True)
alum_ape = models.CharField(max_length=100, help_text="Apellido del alumno", unique=True)
def __str__(s... | 27.083333 | 93 | 0.659692 | [
"MIT"
] | GuidoTorres/codigo8 | Semana10/Dia5/alumnos/alumnos1/models.py | 1,625 | Python |
import sys
from PySide2.QtWidgets import QApplication,QWidget,QMenuBar,QPushButton,QVBoxLayout,QMainWindow
from MainWindow import MainWindow
def start():
app = QApplication(sys.argv)
app.setApplicationName("My Little ERP")
mainWindow = MainWindow(app)
mainWindow.show()
sys.exit(app.exec_())
| 26.166667 | 95 | 0.761146 | [
"MIT"
] | Steins7/MyLittleERP | src/GUI/GUI.py | 314 | Python |
# Copyright 2015 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... | 41.451095 | 95 | 0.650736 | [
"Apache-2.0"
] | DylanDmitri/tensorflow | tensorflow/python/keras/_impl/keras/applications/mobilenet.py | 28,394 | Python |
import pyowm
owm = pyowm.OWM('ce688b67bbf90c2a0236d4eb23d8c7bd') # You MUST provide a valid API key
# Will it be sunny tomorrow at this time in Milan (Italy) ?
#forecast = owm.daily_forecast('panama')
tomorrow = pyowm.timeutils.tomorrow()
#forecast.will_be_sunny_at(tomorrow) # Always True in Italy, right? ;-)
# S... | 29.568182 | 87 | 0.703305 | [
"MIT"
] | andrew962/Python | Apis/App/api.py | 1,302 | Python |
import os, sys, subprocess
def writetofile(args):
with open(args[0], 'w') as f:
f.write(' '.join(args[1:]))
def writeenvtofile(args):
with open(args[0], 'w') as f:
f.write(os.environ[args[1]])
def writesubprocessenvtofile(args):
with open(args[0], 'w') as f:
p = subprocess.Popen([sys.executable, "-... | 23.692308 | 74 | 0.627706 | [
"MIT"
] | JeremyMarshall/pymake | tests/pycmd.py | 924 | Python |
from django.contrib.auth.mixins import LoginRequiredMixin
from django.urls import reverse
from django.views.generic import DetailView, ListView, RedirectView, UpdateView
from tiveU.articles.models import Article
from .models import User
class UserDetailView(LoginRequiredMixin, DetailView):
model = User
# The... | 33.723404 | 80 | 0.705363 | [
"MIT"
] | rds0751/newtiveu | tiveU/users/views.py | 1,585 | Python |
import os
import cv2
import shutil
import argparse
import torch
import numpy as np
import pandas as pd
from PIL import Image
import matplotlib.pyplot as plt
import matplotlib
from .preprocess import DocScanner
import modules.detection as detection
import modules.ocr as ocr
import modules.retrieval as retrieval
import m... | 34.686411 | 87 | 0.571974 | [
"Apache-2.0"
] | kaylode/vietnamese-ocr-toolbox | modules/__init__.py | 9,955 | Python |
import json
import sys
from rsa import PrivateKey
with open(sys.argv[1], 'rb') as input:
key = PrivateKey.load_pkcs1(input.read())
d = {}
d['n'] = key.n
d['e'] = key.e
d['d'] = key.d
d['p'] = key.p
d['q'] = key.q
with open(sys.argv[2], 'w') as output:
output.write(json.dumps(d))... | 21.4 | 45 | 0.548287 | [
"MIT"
] | 425629/esp32-weather-google-sheets | scripts/extract_key.py | 321 | Python |
import os
class DefaultConfig:
""" Bot Configuration """
HOST = "0.0.0.0"
PORT = 3978
CONNECTION_NAME = os.environ.get("CONNECTION_NAME", "echo-bot")
APP_ID = os.environ.get("MICROSOFT_APP_ID", "")
APP_PASSWORD = os.environ.get("MICROSOFT_APP_PASSWORD", "")
LUIS_APP_ID = os.environ.get(... | 35.178571 | 95 | 0.694416 | [
"MIT"
] | kwahome/delivery-bot | config.py | 985 | Python |
# Copyright (C) 2005-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | 35.614458 | 75 | 0.624154 | [
"Apache-2.0"
] | 10088/hue | desktop/core/ext-py/dnspython-1.15.0/dns/rdtypes/ANY/TLSA.py | 2,956 | Python |
#!/usr/bin/python3 -u
import json
import time
import os
import hashlib
import redis
from typing import NamedTuple
import requests
import psycopg2
USER=os.environ['EXODUS_USER']
PASS=os.environ['EXODUS_PASS']
RETRY_COUNT=int(os.environ['EXODUS_RETRY_COUNT'])
PSQL_DB_NAME=os.environ['EXODUS_PSQL_DB_NAME']
REDIS_HOST=o... | 29.884892 | 93 | 0.613866 | [
"Apache-2.0"
] | UAMS-DBMI/PosdaTools | exodus/exodus.py | 4,154 | Python |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__copyright__ = "Copyright (C) 2021 Luciano Fiandesio"
__license__ = "GNU GPLv2"
import argparse
import os
import sys
import glob
import yaml
from config import *
from arg_parser import *
def main():
args = eval_args('Move bank csv file to processing folder')
... | 27.479167 | 126 | 0.648976 | [
"BSD-2-Clause"
] | StefanD986/beanborg | beanborg/bb_mover.py | 1,319 | Python |
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('', include('frontend.urls')),
path('admin/', admin.site.urls),
]
| 20.875 | 39 | 0.688623 | [
"MIT"
] | AveraqeDev/django-react | app/app/urls.py | 167 | Python |
"""Pretraining on GPUs."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import math
import json
import time
import numpy as np
from absl import flags
import absl.logging as _logging # pylint: disable=unused-import
import tensorflow as tf... | 32.851064 | 81 | 0.70383 | [
"Apache-2.0"
] | 365andreas/xlnet | train_gpu.py | 10,808 | Python |
import os
import utils
import pytest
from utils import argo_utils
def compile_and_run_pipeline(
client,
experiment_id,
pipeline_definition,
input_params,
output_file_dir,
pipeline_name,
):
pipeline_path = os.path.join(output_file_dir, pipeline_name)
utils.run_command(
f"dsl-co... | 26.493151 | 93 | 0.701138 | [
"Apache-2.0"
] | Hydrospheredata/pipelines | components/aws/sagemaker/tests/integration_tests/utils/kfp_client_utils.py | 1,934 | Python |
import time
def bubblesort_Alg(arr, drawData, timeSpeed):
for i in range(len(arr)-1):
for j in range(len(arr)-1):
if(arr[j] > arr[j+1]):
arr[j], arr[j+1] = arr[j+1], arr[j]
# To draw the bars
drawData(arr, ['red' if x == j or x == j +
... | 32.4 | 71 | 0.475309 | [
"CC0-1.0"
] | HarshOza36/hacktoberfest2021 | Python/Sort_Visualizer/bubbleSort.py | 486 | Python |
# coding:utf-8
__author__ = "gaunt"
import enum
# layui页面框架的表格成功标识
layui_table_code = 0
class BaseEnum(enum.Enum):
pass
class ResultEnum(BaseEnum):
success = {"code": 200, "msg": "操作成功"}
error = {"code": 500, "msg": "操作失败"}
error400 = {"code": 400, "msg": "400 - 请求参数错误"}
error401 = {"code": 4... | 22.428571 | 60 | 0.585987 | [
"Apache-2.0"
] | chenghao/haoAdmin | enums.py | 1,376 | Python |
from autoflow.workflow.components.regression_base import AutoFlowRegressionAlgorithm
__all__ = ["DecisionTreeRegressor"]
class DecisionTreeRegressor(AutoFlowRegressionAlgorithm):
module__ = "sklearn.tree"
class__ = "DecisionTreeRegressor"
| 27.777778 | 84 | 0.824 | [
"BSD-3-Clause"
] | auto-flow/auto-flow | autoflow/workflow/components/regression/decision_tree.py | 250 | Python |
"""Implements an async kernel client"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from traitlets import Type # type: ignore
from jupyter_client.channels import HBChannel
from jupyter_client.channels import ZMQSocketChannel
from jupyter_client.client import Ke... | 36.875 | 80 | 0.7 | [
"MIT"
] | 12mabold/AR-VR-CW1 | venv/lib/python3.8/site-packages/jupyter_client/asynchronous/client.py | 2,360 | Python |
#!/usr/bin/env python
"""
Benchmark a single Dense layer with no host/device data transfers.
The Items/sec reported at the end of the benchmark is based on wall time.
Run with -h or --help for options.
"""
import inspect
import os
import sys
import tensorflow as tf
from tensorflow.python.ipu import utils
def dense(... | 33.109091 | 87 | 0.635365 | [
"MIT"
] | Splendon/examples | code_examples/tensorflow/kernel_benchmarks/dense.py | 3,642 | Python |
# Copyright 2021 Sony Group Corporation.
#
# 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 ... | 29.634783 | 83 | 0.601232 | [
"Apache-2.0"
] | Pandinosaurus/nnabla | python/benchmark/function/test_cumprod.py | 3,408 | Python |
# Copyright 2021 Hewlett Packard Enterprise Development LP
#
# 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, including without limitation
# the rights to use, copy, modif... | 47.62963 | 76 | 0.773717 | [
"MIT"
] | Cray-HPE/bos | src/bos/operators/utils/clients/bos/__init__.py | 1,286 | Python |
from sujson.Csv2json import Csv2json
import unittest
import filecmp
class ConvertCsvToJson(unittest.TestCase):
def setUp(self):
self.csv_to_json = Csv2json()
def test_conversion(self):
self.csv_to_json.load("files/Netflix.csv", delimiter=";")
self.csv_to_json.convert("files/Netflix_jte... | 27.411765 | 86 | 0.712446 | [
"MIT"
] | PotasnikM/translator-to-suJSON | tests/test_tidy_csv_to_sureal_json.py | 466 | Python |
#!/usr/bin/env python3
# Copyright (c) 2015-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test transaction signing using the signrawtransaction RPC."""
from test_framework.test_framework impor... | 42.171429 | 118 | 0.676603 | [
"MIT"
] | anandsinha095/JDCION | test/functional/rpc_signrawtransaction.py | 4,428 | Python |
from accomodation_website.secrets import DB_PWD
docker_compose = """---
version: '3'
services:
web:
build: .
publish:
- 80
links:
... | 31.5 | 60 | 0.349206 | [
"MIT"
] | Xogiga/CPOA_INEC_SAVIGNY_VALADE | cannes_accomodation/gen_docker_compose.py | 630 | Python |
"""Tests for Lib/fractions.py."""
from decimal import Decimal
from test.support import requires_IEEE_754
import math
import numbers
import operator
import fractions
import sys
import unittest
import warnings
from copy import copy, deepcopy
from pickle import dumps, loads
F = fractions.Fraction
gcd = fractions.gcd
cla... | 41.737421 | 78 | 0.573102 | [
"Apache-2.0"
] | 4nkitd/pyAutomation | Mark_attandance_py_selenium/py/App/Python/Lib/test/test_fractions.py | 26,545 | Python |
# Copyright 2019-2020 Xanadu Quantum Technologies 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
# Unless required by applicable law or... | 33.235955 | 97 | 0.694388 | [
"Apache-2.0"
] | PennyLaneAI/pennylane-cirq | pennylane_cirq/cirq_operation.py | 2,958 | Python |
import traceback
import discord
import asyncio
from discord.ext import commands, flags
from helpers import exceptions, log, utilityfunctions as util
from data import database as db
logger = log.get_logger(__name__)
command_logger = log.get_logger("commands")
class Events(commands.Cog):
def __init__(self, bot):
... | 37.929825 | 113 | 0.598289 | [
"MIT"
] | ZackHart2400/miso-bot | cogs/errorhandler.py | 4,327 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.