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 |
|---|---|---|---|---|---|---|---|---|
# Generated by Django 3.1.7 on 2021-03-10 03:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Admins', '0036_auto_20210310_0337'),
]
operations = [
migrations.AlterField(
model_name='createpractioner',
name='id... | 24.157895 | 118 | 0.631808 | [
"MIT"
] | sd2001/Rethink-Backend | Admins/migrations/0037_auto_20210310_0337.py | 459 | Python |
import random
def HiringProblem(score, n):
sample_size = int(round(n / e))
print(f"\nRejecting first {sample_size} candidates as sample")
#finding best candidate in the sample set for benchmark
best_candidate = 0;
for i in range(1, sample_size):
if (score[i] > score[bes... | 29.390244 | 102 | 0.591701 | [
"Apache-2.0"
] | STreK7/MSc.-CS | Semester I/Design and Analysis of Algorithm/Practical 04- Hiring Problem/HiringProblem.py | 1,205 | Python |
#
# The Template-Python distribution is Copyright (C) Sean McAfee 2007-2008,
# derived from the Perl Template Toolkit Copyright (C) 1996-2007 Andy
# Wardley. All Rights Reserved.
#
# The file "LICENSE" at the top level of this source distribution describes
# the terms under which this file may be distributed.
#
... | 32.818182 | 101 | 0.58583 | [
"Artistic-2.0"
] | lmr/Template-Toolkit-Python | template/parser.py | 35,017 | Python |
#!/usr/bin/env python2
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import hashlib
import sys
import os
from random import SystemRandom
import base64
import hmac
if len(s... | 26.547619 | 79 | 0.728251 | [
"MIT"
] | jazetjaz/monalisa | share/rpcuser/rpcuser.py | 1,115 | Python |
# Local Django
from .messagevalidator import MessageValidator
| 20.666667 | 46 | 0.854839 | [
"MIT"
] | fga-eps-mds/2017.2-Receita-Mais | medical_prescription/chat/validators/__init__.py | 62 | Python |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import os
import cv2
import tensorflow as tf
# In[2]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
# In[3]:
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow import keras
from ten... | 20.082569 | 118 | 0.649612 | [
"MIT"
] | njamalova/whale_tail_identifier | train_valid_split.py | 2,189 | Python |
# -*- coding: utf-8 -*-
from odoo import fields
from odoo.tests.common import Form, SavepointCase
from odoo.tests import tagged
from contextlib import contextmanager
from unittest.mock import patch
import datetime
@tagged('post_install', '-at_install')
class AccountTestInvoicingCommon(SavepointCase):
@classmet... | 44.178484 | 136 | 0.532293 | [
"MIT"
] | LucasBorges-Santos/docker-odoo | odoo/base-addons/account/tests/account_test_savepoint.py | 18,071 | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#############
## Imports ##
#############
import os
import sys ; sys.path.append("/home/developer/workspace/rklearn-lib")
import tensorflow as tf
from rklearn.tfoo_v1 import BaseModel
#################
## CIFAR10CNN ##
#################
class CIFAR10CNN(BaseModel):
... | 47.652542 | 138 | 0.538858 | [
"MIT"
] | rejux/rklearn-lib | rklearn/tests/it/cifar10_cnn.py | 5,623 | Python |
from os import environ, unsetenv
TESTING_DB_FLAG = 'tethys-testing_'
def set_testing_environment(val):
if val:
environ['TETHYS_TESTING_IN_PROGRESS'] = 'true'
else:
environ['TETHYS_TESTING_IN_PROGRESS'] = ''
del environ['TETHYS_TESTING_IN_PROGRESS']
unsetenv('TETHYS_TESTING_IN_... | 24.115385 | 66 | 0.712919 | [
"BSD-2-Clause"
] | quyendong/tethys | tethys_apps/base/testing/environment.py | 627 | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2017/7/25 0025 上午 10:14
# @Author : Exchris Tsai
# @Site :
# @File : example52.py
# @Software: PyCharm
"""
题目:学习使用按位或 | 。
程序分析:0|0=0; 0|1=1; 1|0=1; 1|1=1
"""
__author__ = 'Exchris Tsai'
if __name__ == '__main__':
a = 0o77
b = a | 3
print(... | 17.904762 | 36 | 0.513298 | [
"MIT"
] | exchris/Pythonlearn | Old/exercise/example52.py | 412 | Python |
#!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2015 Riverbank Computing Limited.
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
##
## This file is part of the examples of PyQt.
##
## $QT_BEGIN_LICENS... | 35.522727 | 145 | 0.603967 | [
"MIT"
] | ArjandeV/iracing-overlay | PyQt5_gpl-5.8/examples/opengl/grabber.py | 14,067 | Python |
"""
Data processing routines
Deepak Baby, UGent, June 2018
deepak.baby@ugent.be
"""
import numpy as np
def reconstruct_wav(wavmat, stride_factor=0.5):
"""
Reconstructs the audiofile from sliced matrix wavmat
"""
window_length = wavmat.shape[1]
window_stride = int(stride_factor * window_length)
wav_length ... | 29.075758 | 68 | 0.642522 | [
"MIT"
] | deepakbaby/isegan | data_ops.py | 1,919 | Python |
errno_map = {
"1": {
"comment": "Operation not permitted",
"name": "EPERM"
},
"2": {
"comment": "No such file or directory",
"name": "ENOENT"
},
"3": {
"comment": "No such process",
"name": "ESRCH"
},
"4": {
"comment": "Interrupte... | 23.11583 | 70 | 0.431769 | [
"MIT"
] | Robotonics/simba | make/simbaerrno.py | 11,974 | Python |
from django.urls import include, path
from django.contrib import admin
from django.views.generic import RedirectView
urlpatterns = [
path('polls/', include('polls.urls')),
path('admin/', admin.site.urls),
]
urlpatterns += [
path('', RedirectView.as_view(url='/polls/')),
] | 23.833333 | 50 | 0.695804 | [
"MIT"
] | feraco/shifting-morals | mysite/urls.py | 286 | Python |
from django.views.generic import TemplateView, CreateView, UpdateView
from django.urls import reverse_lazy
from home_app import forms
from django.contrib.auth.mixins import LoginRequiredMixin
from account_app.models import CustomUser
# Create your views here.
class IndexView(TemplateView):
template_name = 'home_... | 27.090909 | 69 | 0.787472 | [
"MIT"
] | xjati46/agoraschool | home_app/views.py | 894 | Python |
from collections import Iterable
from torch import nn
from torch import optim
from torchero import meters
from functools import partial
INVALID_MODE_INFERENCE_MESSAGE = (
"Could not infer mode from meter {meter}"
)
def get_default_mode(meter):
if hasattr(meter.__class__, 'DEFAULT_MODE'):
return geta... | 33.641176 | 121 | 0.600979 | [
"MIT"
] | juancruzsosa/torchero | torchero/utils/defaults.py | 5,719 | Python |
# Generated by Django 3.2 on 2021-09-07 12:46
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('payment', '0002_alter_invoice_address'),
('item', '0002_alter_item_upc'),
('accounts', '00... | 51.222222 | 187 | 0.606652 | [
"MIT"
] | jamedadi/yummy | cart/migrations/0001_initial.py | 2,766 | Python |
#!/usr/bin/env python
from __future__ import print_function, absolute_import
import re
import subprocess
import os
import time
import argparse
import sys
class SmartDevice(object):
smartcmdfmt = ['sudo', 'smartctl', '-f', 'brief', '-A', '/dev/{dev}']
def __init__(self, dev):
self.dev = dev
s... | 35.76699 | 85 | 0.540717 | [
"MIT"
] | nlm/collectd-smartmon | collectd-smartmon.py | 3,684 | Python |
# -*- coding: utf-8 -*-
from unittest import mock
from vispy.scene.visuals import Image
from vispy.testing import (requires_application, TestingCanvas,
run_tests_if_main)
from vispy.testing.image_tester import assert_image_approved, downsample
import numpy as np
import pytest
@requires_ap... | 36.744444 | 107 | 0.633958 | [
"BSD-3-Clause"
] | 3DAlgoLab/vispy | vispy/visuals/tests/test_image.py | 6,614 | Python |
# -*- coding: utf-8 -*-
#
# Copyright 2017 Ricequant, 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 ... | 35.285124 | 120 | 0.641293 | [
"Apache-2.0"
] | HackReborn/rqalpha | rqalpha/mod/rqalpha_mod_sys_accounts/position_model/future_position.py | 17,514 | Python |
import asyncio
import functools
import logging
from types import FunctionType, ModuleType
from typing import Type
from prometheus_client import Histogram, Counter
logger = logging.getLogger(__name__)
H = Histogram(f"management_layer_call_duration_seconds", "API call duration (s)",
["call"])
def _prom... | 38.241379 | 97 | 0.656673 | [
"BSD-3-Clause"
] | girleffect/core-management-layer | management_layer/metrics.py | 4,436 | Python |
from typing import Callable
import numpy as np
from manimlib.utils.bezier import bezier
def linear(t: float) -> float:
return t
def smooth(t: float) -> float:
# Zero first and second derivatives at t=0 and t=1.
# Equivalent to bezier([0, 0, 0, 1, 1, 1])
s = 1 - t
return (t**3) * (10 * s * s + ... | 24.287129 | 78 | 0.593967 | [
"MIT"
] | ListeningPost1379/manim | manimlib/utils/rate_functions.py | 2,453 | Python |
from typing import Tuple, FrozenSet
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
import pysmt.typing as types
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... | 26.885417 | 77 | 0.573809 | [
"MIT"
] | EnricoMagnago/F3 | benchmarks/software_nontermination/f3_hints/C_Integer/Stroeder_15/Urban-WST2013-Fig1_false-termination.py | 2,581 | Python |
"""
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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, modify, merg... | 36.239823 | 179 | 0.613306 | [
"MIT"
] | NQN-Discord/discord.py | discord/message.py | 73,893 | Python |
# -*- coding: utf-8 -*-
"""Utilities for calculation job resources."""
__all__ = (
'get_default_options',
'seconds_to_timelimit',
)
def get_default_options(max_num_machines: int = 1, max_wallclock_seconds: int = 1800, with_mpi: bool = False) -> dict:
"""Return an instance of the options dictionary with t... | 31.355556 | 118 | 0.653437 | [
"MIT"
] | azadoks/aiida-abinit | aiida_abinit/utils/resources.py | 1,411 | Python |
"""On-premise Gitlab clients
"""
# from .v4 import *
| 13.25 | 28 | 0.641509 | [
"BSD-3-Clause"
] | shwetagopaul92/tapis-cli-ng | tapis_cli/clients/services/gitlab/__init__.py | 53 | Python |
import json
import re
class FieldValidationException(Exception):
pass
class Field(object):
"""
This is the base class that should be used to create field validators. Sub-class this and override to_python if you
need custom validation.
"""
DATA_TYPE_STRING = 'string'
DATA_TYPE_NUMBER = '... | 28.426637 | 120 | 0.58334 | [
"Apache-2.0"
] | kamaljitsingh76/eventgen | splunk_eventgen/splunk_app/lib/mod_input/fields.py | 12,593 | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 Homer Strong, Radim Rehurek
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""This module implements the "hashing trick" [1]_ -- a mapping between words and their integer ids
using a fixed and static mapping.
Notes
-----... | 37.673352 | 120 | 0.604198 | [
"MIT"
] | Abas-Khan/thesis | gensim/gensim/corpora/hashdictionary.py | 13,162 | Python |
from smartva.rules import fires_child as fires
from smartva.data.constants import *
VA = Child
def test_pass():
row = {
VA.BURN: YES,
VA.INJURY_DAYS: 0,
}
assert fires.logic_rule(row) is True
def test_fail_fires():
row = {
VA.BURN: NO,
VA.INJURY_DAYS: 0,
}
... | 15.157895 | 46 | 0.604167 | [
"MIT"
] | ihmeuw/SmartVA-Analyze | test/rules/test_fires_child.py | 576 | Python |
import configparser
import logging
def dict_url(conf):
"""Add all url from file url.ini with
key = name of the parking end value is
the url.
:returns: dictionnary with all parking and url
:rtype: dict
"""
url = configparser.ConfigParser()
logging.debug("initializing the variable url")... | 27.846154 | 63 | 0.632597 | [
"Unlicense"
] | Mancid/data_parking_montpellier | backend/function_park/dict_url.py | 724 | Python |
from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
from indra.sources.tas.api import _load_data, process_csv
def test_load_data():
data = _load_data()
assert len(data) > 100, len(data)
def test_processor():
tp = process_csv(affinity_class_limit=10)
... | 29.761905 | 72 | 0.7296 | [
"BSD-2-Clause"
] | PritiShaw/indra | indra/tests/test_tas.py | 625 | Python |
from typing import Callable, Iterable, Sequence
import numpy as np
from dpipe.im.axes import AxesLike, AxesParams
from dpipe.itertools import lmap, squeeze_first
from dpipe.im import pad_to_shape
def pad_batch_equal(batch, padding_values: AxesParams = 0, ratio: AxesParams = 0.5):
"""
Pad each element of ``b... | 28.757143 | 115 | 0.60929 | [
"MIT"
] | neuro-ml/deep_pipe | dpipe/batch_iter/utils.py | 4,026 | Python |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 42.0181 | 120 | 0.643011 | [
"BSD-2-Clause"
] | DanielMarchand/aiida_core | aiida/cmdline/params/types/plugin.py | 9,286 | Python |
from BoundingBox import *
from eval_utils import *
class BoundingBoxes:
def __init__(self):
self._boundingBoxes = []
def addBoundingBox(self, bb):
self._boundingBoxes.append(bb)
def removeBoundingBox(self, _boundingBox):
for d in self._boundingBoxes:
if BoundingBox.co... | 34.012821 | 81 | 0.614776 | [
"Apache-2.0"
] | videetparekh/model-zoo-models | ssd_mobilenetv2/BoundingBoxes.py | 2,653 | Python |
#!/usr/bin/env python
#============================================================================
# Copyright (C) Microsoft Corporation, All rights reserved.
#============================================================================
import os
import imp
import re
import codecs
protocol = imp.load_source('protoco... | 39.476667 | 172 | 0.606772 | [
"MIT"
] | MicrosoftDocs/PowerShell-DSC-for-Linux | Providers/Scripts/2.4x-2.5x/Scripts/nxOMSPerfCounter.py | 11,843 | Python |
"""Parses the arguments passed to the bash script and returns them back to the bash script."""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import re
import sys
# Technique for printing custom error and help
# Source: https://sta... | 36.905512 | 94 | 0.703008 | [
"Apache-2.0"
] | 2733284198/cloud-builders-community | binauthz-attestation/parse_arguments.py | 4,687 | Python |
from stack import Stack as s
class Queue:
def __init__(self, iter=[]):
self.stack_one = s()
self.stack_two = s()
self._len = 0
for item in iter:
self.enqueue(item)
def enqueue(self, value):
if value:
self.stack_one.push(value)
self.... | 25.866667 | 57 | 0.501289 | [
"MIT"
] | bhold6160/data-structures-and-algorithms | queue-with-stacks/queue_with_stacks.py | 776 | Python |
number = 5
number2 = 'five'
print(number)
breakpoint()
print(str(number) + " " + number2)
| 10.333333 | 34 | 0.645161 | [
"MIT"
] | PacktPublishing/Applied-Computational-Thinking-with-Python | Chapter07/ch7_debugger3.py | 93 | Python |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2016-present MagicStack Inc. and the EdgeDB 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... | 32.696347 | 77 | 0.601215 | [
"Apache-2.0"
] | edgedb/edgedb-python | edgedb/transaction.py | 14,321 | Python |
import os
import datetime
import logging
import sqlite3
import pytest
from utils import setup_mdb_dir, all_book_info, load_db_from_sql_file, TESTS_DIR
from manga_db.manga_db import MangaDB
from manga_db.manga import Book
from manga_db.ext_info import ExternalInfo
from manga_db.constants import LANG_IDS
@pytest.mark.p... | 36.960938 | 97 | 0.61023 | [
"MIT"
] | nilfoer/mangadb | tests/test_book.py | 23,697 | Python |
from datetime import timedelta
import json
from os import listdir
from os.path import isfile, join
import pr0gramm
import logging
__author__ = "Peter Wolf"
__mail__ = "pwolf2310@gmail.com"
__date__ = "2016-12-26"
LOG = logging.getLogger(__name__)
class DataSources:
IMAGE, THUMBNAIL, FULL_SIZE = range(3)
class... | 33.208333 | 90 | 0.601317 | [
"MIT"
] | BigPeet/pr0tagger | src/data_collection/data_collector.py | 6,376 | Python |
#!/usr/bin/env python3
# Copyright (c) 2014-2019 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 the REST API."""
import binascii
from decimal import Decimal
from enum import Enum
from io import... | 44.650746 | 153 | 0.663993 | [
"MIT"
] | 100milliondollars/NeuQ | test/functional/interface_rest.py | 14,958 | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
MAPPING = {
"dynamic": False,
"properties": {
"classification_type": {"type": "keyword"},
"date": {"type": "date", "format": "strict_date_optional_time||epoch_millis"},
"global_metrics": {
"dynamic": False,
"propertie... | 45.368794 | 90 | 0.239487 | [
"MIT"
] | leonardbinet/pandagg | tests/testing_samples/mapping_example.py | 6,699 | Python |
from tensorflow.keras.layers import Dense, Flatten
from tensorflow.keras.models import Model
from tensorflow.keras.applications.vgg19 import VGG19
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.callbacks import ModelCheckpoint
from datetime import datetime
import numpy as np
i... | 42.945652 | 160 | 0.552645 | [
"MIT"
] | aasir22/tools_classification | training.py | 7,902 | Python |
#
# example from CHiLL manual page 14
#
# permute 3 loops
#
from chill import *
source('permute123456.c')
destination('permute1modified.c')
procedure('mm')
loop(0)
known('ambn > 0')
known('an > 0')
known('bm > 0')
permute([3,1,2])
| 9.88 | 36 | 0.631579 | [
"MIT"
] | CompOpt4Apps/Artifact-DataDepSimplify | chill/examples/chill/testcases/permute1.script.py | 247 | Python |
import re
from scripts.features.feature_extractor import FeatureExtractor
from bs4 import BeautifulSoup
class ItemizationCountExtractor(FeatureExtractor):
def extract(self, post, extracted=None):
soup = BeautifulSoup(post.rendered_body, "html.parser")
count = len(soup.find_all("ul"))
ret... | 27.242857 | 71 | 0.668589 | [
"Apache-2.0"
] | chakki-works/elephant-sense | scripts/features/structure_extractor.py | 1,913 | Python |
# -------------------------------------------------------------------------------
# Copyright IBM Corp. 2017
#
# 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/licens... | 31.26601 | 169 | 0.540728 | [
"Apache-2.0"
] | elgalu/pixiedust | pixiedust/display/chart/renderers/commonOptions.py | 6,347 | Python |
import asyncio
import io
from PIL import Image
from PIL import ImageDraw
from discord import Colour
import datetime
import urllib
import urllib.request
import aiohttp
import re
from datetime import datetime, date, timedelta
from calendar import timegm
import time
from utils.database import userDataba... | 43.123762 | 225 | 0.536678 | [
"Apache-2.0"
] | LadyKeladry/Guardian-Bot | NabBot-master/utils/tibia.py | 43,555 | Python |
#!/usr/bin/env python
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
ext_modules = [Extension("freenect", ["freenect.pyx"],
libraries=['usb-1.0', 'freenect', 'freenect_sync'],
runtime_library_dirs=['/us... | 44.526316 | 98 | 0.471631 | [
"MIT"
] | HoEmpire/slambook2 | 3rdparty/meshlab-master/src/external/openkinect/wrappers/python/setup.py | 846 | Python |
from __future__ import division
import argparse
import os
import torch
from mmcv import Config
from mmdet import __version__
from mmdet.apis import (get_root_logger, init_dist, set_random_seed,
train_detector)
from mmdet.datasets import build_dataset
from mmdet.models import build_detector
d... | 31.570093 | 77 | 0.657194 | [
"Apache-2.0"
] | GioPais/ttfnet | tools/train.py | 3,378 | Python |
"""An example of jinja2 templating"""
from bareasgi import Application, HttpRequest, HttpResponse
import jinja2
import pkg_resources
import uvicorn
from bareasgi_jinja2 import Jinja2TemplateProvider, add_jinja2
async def http_request_handler(request: HttpRequest) -> HttpResponse:
"""Handle the request"""
r... | 26.111111 | 70 | 0.689362 | [
"Apache-2.0"
] | rob-blackbourn/bareASGI-jinja2 | examples/example1.py | 1,175 | Python |
from __future__ import print_function
import pprint
import os
import time
import msgpackrpc
import math
import msgpackrpc #install as admin: pip install msgpack-rpc-python
import msgpack
import sys
import inspect
import types
import re
import shutil
import numpy as np #pip install numpy
#==========================... | 31.491499 | 181 | 0.599362 | [
"MIT"
] | ybettan/AirSimTensorFlow | run_demo.py | 20,375 | Python |
#!/usr/bin/env python
# coding: utf-8
import logging.config
import os
# Конфигурация базы данных
DB_CONFIG = {
'username': 'root',
'password': os.environ.get('MYSQL_TRADING_PASS'),
'host': '127.0.0.1',
'dbname': 'trading_db',
}
# Конфигурация журналирования
LOGGING = {
'version': 1,
'format... | 25.637168 | 98 | 0.593027 | [
"Apache-2.0"
] | AsAsgard/trading_pr | request_handler/appconfig.py | 3,134 | Python |
#!/usr/bin/env python3
import random
import sys
"""
Markov chains name generator in Python
From http://roguebasin.roguelikedevelopment.org/index.php?title=Markov_chains_name_generator_in_Python .
"""
# from http://www.geocities.com/anvrill/names/cc_goth.html
PLACES = ['Adara', 'Adena', 'Adrianne', 'Alarice', 'Alvita... | 34.288889 | 125 | 0.515554 | [
"MIT"
] | doc22940/Bash-Utils | lib/markov_usernames.py | 3,086 | Python |
from django.urls import path
from django.contrib.auth import views as auth_views
from . import views
urlpatterns = [
path('security/', auth_views.PasswordChangeView.as_view(), name='security_settings'),
path('security/done/', auth_views.PasswordChangeDoneView.as_view(), name='password_change_done'),
path('... | 42 | 101 | 0.755411 | [
"MIT"
] | nathanielCherian/socSite | soc_site/usettings/urls.py | 462 | Python |
#!/usr/bin/python
#By Sun Jinyuan and Cui Yinglu, 2021
foldx_exe = "/user/sunjinyuan/soft/foldx"
def getparser():
parser = argparse.ArgumentParser(description=
'To run Foldx PositionScan with multiple threads, make sure' +
' that you have... | 36.489583 | 109 | 0.549814 | [
"MIT"
] | JinyuanSun/my_bio_script | RFACA/foldx/foldx_scan.py | 3,503 | Python |
#
# -------------------------------------------------------------------------
# Copyright (c) 2015-2017 AT&T Intellectual Property
#
# 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
#
# ... | 44.513986 | 120 | 0.562093 | [
"Apache-2.0"
] | aalsudais/optf-has | conductor/conductor/solver/optimizer/optimizer.py | 12,731 | Python |
#!/usr/bin/python3
import time
def count_5s(number):
counter = 0
while (number % 5 == 0):
counter += 1
number /= 5
return counter
def last_5_digits(number):
number = number % (10 ** 5)
return number
def factorial(number):
borrowed_2s = 0
product = 1
for i in range(1... | 19.36 | 79 | 0.528926 | [
"Unlicense"
] | COMU/kripton | factorial-trailing-digits/factorial_trailing_digits.py | 968 | Python |
#
# Copyright 2020 by 0x7c2, Simon Brecht.
# All rights reserved.
# This file is part of the Report/Analytic Tool - CPme,
# and is released under the "Apache License 2.0". Please see the LICENSE
# file that should have been included as part of this package.
#
from templates import check
import func
class check_perfor... | 28.386861 | 113 | 0.61404 | [
"Apache-2.0"
] | olejak/cpme2 | performance.py | 3,889 | Python |
# encoding: utf-8
# module renderdoc
# from P:\1-Scripts\_Python\Py-Autocomplete\renderdoc.pyd
# by generator 1.146
# no doc
# imports
import enum as __enum
from .SwigPyObject import SwigPyObject
class BlendStats(SwigPyObject):
""" Contains the statistics for blend state binds in a frame. """
def __eq__(sel... | 31.295775 | 100 | 0.626463 | [
"MIT"
] | Lex-DRL/renderdoc-py-stubs | _pycharm_skeletons/renderdoc/BlendStats.py | 2,222 | Python |
from __future__ import division
from __future__ import print_function
from models.pytorch.pna.layer import PNALayer
from multitask_benchmark.util.train import execute_train, build_arg_parser
# Training settings
parser = build_arg_parser()
parser.add_argument('--self_loop', action='store_true', default=False, help='Wh... | 60.72 | 119 | 0.452899 | [
"MIT"
] | KonstantinKlepikov/pna | multitask_benchmark/train/mpnn.py | 3,036 | Python |
import pytest
from spacy import displacy
from spacy.displacy.render import DependencyRenderer, EntityRenderer
from spacy.lang.fa import Persian
from spacy.tokens import Span, Doc
def test_displacy_parse_ents(en_vocab):
"""Test that named entities on a Doc are converted into displaCy's format."""
doc = Doc(en... | 38.1875 | 92 | 0.590653 | [
"MIT"
] | xettrisomeman/spaCy | spacy/tests/test_displacy.py | 5,520 | 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 ... | 49.263636 | 245 | 0.671342 | [
"MIT"
] | CharaD7/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/models/security_rule.py | 5,419 | Python |
# Copyright 2018, The TensorFlow 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 t... | 33.715278 | 80 | 0.72379 | [
"Apache-2.0"
] | Juspem1980/privacy | tensorflow_privacy/privacy/dp_query/gaussian_query.py | 4,855 | Python |
class NumArray:
# O(n) time | O(n) space - where n is the length of the input list
def __init__(self, nums: List[int]):
self.nums = []
currentSum = 0
for num in nums:
currentSum += num
self.nums.append(currentSum)
# O(1) time to look up the nums list
def s... | 35.214286 | 70 | 0.549696 | [
"MIT"
] | weilincheng/LeetCode-practice | dynamicProgramming/303_range_sum_query_immutable.py | 493 | Python |
# uncompyle6 version 3.2.0
# Python bytecode 2.4 (62061)
# Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)]
# Embedded file name: otp.launcher.DownloadWatcher
from direct.task import Task
from otp.otpbase import OTPLocalizer
from direct.gui.DirectGui import *
from p... | 99.604651 | 318 | 0.257063 | [
"BSD-3-Clause"
] | itsyaboyrocket/pirates | otp/launcher/DownloadWatcher.py | 4,283 | Python |
from ktrade.queue_messages.queue_message import QueueMessage
class BuyMessage(QueueMessage):
def __init__(self, ticker: str):
super().__init__(type='BUY')
self.ticker = ticker
| 26.714286 | 60 | 0.759358 | [
"MIT"
] | webclinic017/ktrade | ktrade/queue_messages/buy_message.py | 187 | Python |
from conans import ConanFile, CMake
class LibB(ConanFile):
name = "libB"
version = "0.0"
settings = "os", "arch", "compiler", "build_type"
options = {"shared": [True, False]}
default_options = {"shared": False}
generators = "cmake"
scm = {"type": "git",
"url": "auto",
... | 23.176471 | 57 | 0.568528 | [
"MIT"
] | demo-ci-conan/libB | conanfile.py | 788 | Python |
from django.urls import path, include
from .views import *
from django.contrib import admin
app_name = 'Blog'
urlpatterns = [
path('', Blog_index.as_view(), name='blog_index'),
path('', include('Usermanagement.urls', namespace='Usermanagement'), name='usermanagement'),
path('create_article/', article_cre... | 39.5625 | 100 | 0.71406 | [
"MIT"
] | Roy-Kid/my_blog | Blog/urls.py | 633 | Python |
import sys
sys.path.append('../')
from logparser import IPLoM, evaluator
import os
import pandas as pd
CT = [0.25, 0.3, 0.4, 0.4, 0.35, 0.58, 0.3, 0.3, 0.9, 0.78, 0.35, 0.3, 0.4]
lb = [0.3, 0.4, 0.01, 0.2, 0.25, 0.25, 0.3, 0.25, 0.25, 0.25, 0.3, 0.2, 0.7]
n_para = 13
benchmark_settings = {
'HDFS': {
'log_... | 30.222222 | 125 | 0.524118 | [
"MIT"
] | dhetong/LogSampleTest | benchmark/IPLoM_agreement.py | 6,800 | Python |
# Copyright 2018 The Oppia 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 applicable ... | 42.685196 | 80 | 0.661365 | [
"Apache-2.0"
] | AdityaDubey0/oppia | core/domain/suggestion_registry_test.py | 141,288 | Python |
'''
Given a string, write a function that uses recursion to output a
list of all the possible permutations of that string.
For example, given s='abc' the function should return ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
Note: If a character is repeated, treat each occurence as distinct,
for example an input of 'xxx' ... | 23 | 96 | 0.573203 | [
"MIT"
] | washimimizuku/python-data-structures-and-algorithms | udemy-data-structures-and-algorithms/15-recursion/15.8_string_permutation.py | 1,127 | Python |
#!/usr/bin/env python3
# Copyright (c) 2020 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 generate RPC."""
from test_framework.test_framework import MAGATestFramework
from test_framework.util ... | 31.945946 | 95 | 0.690355 | [
"MIT"
] | hhhogannwo/bitcoin | test/functional/rpc_generate.py | 1,182 | Python |
# Copyright 2021 Tomoki Hayashi
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""GAN-based TTS ESPnet model."""
from contextlib import contextmanager
from distutils.version import LooseVersion
from typing import Any
from typing import Dict
from typing import Optional
import torch
from typeguard import... | 35.363014 | 81 | 0.627929 | [
"Apache-2.0"
] | actboy/espnet | espnet2/gan_tts/espnet_model.py | 5,163 | Python |
import time
import pytest
from celery.result import GroupResult
from celery.schedules import crontab
from kombu.exceptions import EncodeError
from director import build_celery_schedule
from director.exceptions import WorkflowSyntaxError
from director.models.tasks import Task
from director.models.workflows import Work... | 36.959079 | 110 | 0.652135 | [
"BSD-3-Clause"
] | PaulinCharliquart/celery-director | tests/test_workflows.py | 14,451 | Python |
import logging
import time
from abc import abstractmethod
from enum import Enum
from typing import Dict, Callable, Any, List
from schema import Schema
import sqlalchemy
from sqlalchemy.engine import ResultProxy
from sqlalchemy.orm import Query
from sqlalchemy.schema import Table
from sqlalchemy.engine.base import Eng... | 37.602151 | 128 | 0.666285 | [
"MIT"
] | cliftbar/flask_app_template | flask_app/utilities/DataInterfaces/SqlInterface.py | 6,994 | Python |
INPUTPATH = "input.txt"
#INPUTPATH = "input-test.txt"
with open(INPUTPATH) as ifile:
raw = ifile.read()
from typing import Tuple
def line_to_pos(line: str) -> Tuple[int, ...]:
filtered = "".join(c for c in line if c.isdigit() or c in {"-", ","})
return tuple(map(int, filtered.split(",")))
starts = tuple(zip(*map(lin... | 29.884615 | 70 | 0.664093 | [
"Unlicense"
] | Floozutter/aoc-2019-python | day12/main.py | 1,554 | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import cplotting as cplot
S={2+2j, 3+2j, 1.75+1j, 2+1j, 2.25+1j, 2.5+1j, 2.75+1j, 3+1j, 3.25+1j}
cplot.plot({1+2j+z for z in S},4)
cplot.show()
| 19.3 | 70 | 0.590674 | [
"BSD-3-Clause"
] | RyodoTanaka/Cording_Matrix | python/chap_1/1.4.3.py | 193 | Python |
log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=10)
evaluation = dict(interval=100, metric='mAP')
optimizer = dict(
type='Adam',
lr=0.0015,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config... | 26.852792 | 76 | 0.561248 | [
"Apache-2.0"
] | RuisongZhou/mmpose | configs/bottom_up/hrnet/coco/hrnet_w32_coco_512x512.py | 5,290 | Python |
import streamlit as st
import warnings
try:
from streamlit_terran_timeline import terran_timeline, generate_timeline
except ImportError:
warnings.warn(
"Failed to load terran_timeline from streamlit_terran_timeline. "
"Please run 'pip install streamlit_terran_timeline' or "
"'pip insta... | 26.014493 | 81 | 0.71532 | [
"MIT"
] | cenkbircanoglu/streamlit-terran-timeline | streamlit_terran_timeline/examples/youtube.py | 1,795 | Python |
# from blazingsql import BlazingContext
from Configuration import ExecutionMode
from Configuration import Settings as Settings
# from dask.distributed import Client
from DataBase import createSchema as createSchema
# from EndToEndTests import countDistincTest
from EndToEndTests import (
GroupByWitoutAggregations,... | 37.28115 | 88 | 0.68592 | [
"Apache-2.0"
] | BroadBridgeNetworks/blazingsql | tests/BlazingSQLTest/EndToEndTests/allE2ETest.py | 11,669 | Python |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: geometry.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protob... | 46.721239 | 1,282 | 0.762572 | [
"Apache-2.0"
] | CryptoCopter/pygazebo | pygazebo/msg/geometry_pb2.py | 10,559 | Python |
from aws_cdk import (
core,
aws_iam as iam,
aws_kinesis as kinesis,
aws_kinesisfirehose as kinesisfirehose
)
class Lab07Stack(core.Stack):
def __init__(self, scope: core.Construct, id: str, **kwargs) -> None:
super().__init__(scope, id, **kwargs)
# The code that defines your st... | 49.82243 | 149 | 0.298068 | [
"Apache-2.0"
] | stevensu1977/aws-cdk-handson | Lab07/lab07/lab07_stack.py | 5,425 | Python |
"""Main app/routing file for TwitOff"""
from os import getenv
from flask import Flask, render_template, request
from twitoff.twitter import add_or_update_user
from twitoff.models import DB, User, MIGRATE
from twitoff.predict import predict_user
def create_app():
app = Flask(__name__)
app.config["SQLALCHEMY_D... | 33.519481 | 103 | 0.618752 | [
"MIT"
] | kvinne-anc/TwittOff | twitoff/app.py | 2,581 | Python |
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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.apa... | 31.088889 | 94 | 0.610674 | [
"Apache-2.0"
] | Grey-Peters/IanPeters | prototype/api/FlaskApp/FlaskApp/azure_components/azure/mgmt/common/filters.py | 4,199 | Python |
import os
import sys
from pathlib import Path
from typing import List, Optional, Tuple
import i18n
import requests
import yaml
from . import config, frozen_utils, os_utils, print_utils
# The URL to the docker-compose.yml
BRAINFRAME_DOCKER_COMPOSE_URL = "https://{subdomain}aotu.ai/releases/brainframe/{version}/docker... | 31.716129 | 109 | 0.672091 | [
"BSD-3-Clause"
] | aotuai/brainframe-cli | brainframe/cli/docker_compose.py | 4,916 | Python |
#!/usr/bin/env python3
def main():
pass
if __name__ == '__main__':
main()
| 8.6 | 26 | 0.569767 | [
"MIT"
] | reireias/dotfiles | .vim/template/python/base-atcoder.py | 86 | Python |
# author : 陈熙
# encoding:utf-8
from email.header import Header
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import smtplib
class SendEmail:
sender = 'atomuser@139.com'#'ccu_queryresul@139.com'
msg = MIMEMultipart('alternative')
msg['Subject'] = Header("长春大... | 27.157895 | 77 | 0.596899 | [
"MPL-2.0"
] | atomchan/CCUScore | ccuemail.py | 1,100 | Python |
# This file is part of datacube-ows, part of the Open Data Cube project.
# See https://opendatacube.org for more information.
#
# Copyright (c) 2017-2021 OWS Contributors
# SPDX-License-Identifier: Apache-2.0
"""Test update ranges on DB using Click testing
https://click.palletsprojects.com/en/7.x/testing/
"""
from data... | 32.476923 | 85 | 0.721933 | [
"Apache-2.0"
] | FlexiGroBots-H2020/datacube-ows | integration_tests/test_update_ranges.py | 2,111 | Python |
n = int(input('digite um numero para metros'))
print('o valor {} metros, vale {} em centimetros, e vale {} milimetros'.format(n, n*100, n*1000))
| 48.333333 | 97 | 0.675862 | [
"MIT"
] | KamiAono/CursoPython | Conversor_metros.py | 145 | Python |
#
# Copyright (c) 2021 Software AG, Darmstadt, Germany and/or its licensors
#
# SPDX-License-Identifier: Apache-2.0
#
# 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.apach... | 30.094972 | 118 | 0.622424 | [
"ECL-2.0",
"Apache-2.0"
] | SoftwareAG/cumulocity-remote-access-local-proxy | c8ylp/cli/core.py | 21,548 | Python |
import pandas as pd
import numpy as np
from numpy.linalg import inv
def get_ffme_returns():
"""
Load the Fama-French Dataset for the returns of the Top and Bottom Deciles by MarketCap
"""
me_m = pd.read_csv("data/Portfolios_Formed_on_ME_monthly_EW.csv",
header=0, index_col=0, na_... | 35.79645 | 161 | 0.647811 | [
"MIT"
] | jaimeaguilera/Investing-projects | kit.py | 30,248 | Python |
"""
_SubscriptionList_
Module with data structures to handle PhEDEx subscriptions
in bulk.
"""
import logging
from WMCore.WMException import WMException
PhEDEx_VALID_SUBSCRIPTION_PRIORITIES = ['low', 'normal', 'high', 'reserved']
class PhEDExSubscriptionException(WMException):
"""
_PhEDExSubscriptionExcept... | 38.821192 | 101 | 0.594336 | [
"Apache-2.0"
] | cbbrainerd/WMCore | src/python/WMCore/Services/PhEDEx/DataStructs/SubscriptionList.py | 11,724 | Python |
"""
Functions for signals and positions created within this package.
Copyright 2021 InferStat Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Un... | 39.464286 | 113 | 0.819005 | [
"Apache-2.0"
] | holderfolyf/infertrade | infertrade/algos/community/__init__.py | 1,105 | Python |
import urllib.request,json
from .models import Sources, Articles
from datetime import datetime
#Getting api key
api_key = None
#Getting the news base url
# NEWS_API_KEY = None
# NEWS_API_BASE_URL = None
ARTICLE = None
def configure_request(app):
global api_key,NEWS_API_BASE_URL,NEWS_API_KEY,ARTICLE
api_key = ... | 30.466019 | 79 | 0.658062 | [
"MIT"
] | ClarisseU/newsHighlight | app/requests.py | 3,138 | Python |
class Const:
"""
常量
"""
class ConstError(TypeError):pass
def __setattr__(self, name, value):
if name in self.__dict__:
raise self.ConstError("Can't rebind const (%s)" %name)
self.__dict__[name]=value
LAYOUT = Const()
"""
布局
"""
LAYOUT.SCREEN_WIDTH = 500
LAYOUT.SCREEN_HEIGHT = 600
LAYOUT.SIZE = ... | 20.088235 | 60 | 0.682284 | [
"Apache-2.0"
] | thales-ucas/wumpus | src/const.py | 1,502 | Python |
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
from pedrec.models.constants.skeleton_pedrec import SKELETON_PEDREC, SKELETON_PEDREC_JOINT_COLORS, SKELETON_PEDREC_LIMB_COLORS
from pedrec.visualizers.visualization_helper_3d import draw_origin_3d, draw_grid_3d
def add_skeleto... | 35.146341 | 168 | 0.704372 | [
"MIT"
] | noboevbo/PedRec | pedrec/visualizers/skeleton_3d_visualizer.py | 1,441 | Python |
from ctypes import (
Structure,
Union,
c_char,
c_double,
c_int,
c_long,
c_short,
c_ubyte,
c_uint,
c_ulong,
c_ushort,
)
from . import timespec
class c_gsfSeaBeamSpecific(Structure):
_fields_ = [("EclipseTime", c_ushort)]
class c_gsfEM100Specific(Structure):
_field... | 30.908791 | 76 | 0.598606 | [
"MIT"
] | UKHO/gsfpy | gsfpy3_09/gsfSensorSpecific.py | 28,127 | Python |
# -*- coding: utf-8 -*-
# Copyright (c) 2019, Aptitude technologie and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestPriceConfigurator(unittest.TestCase):
pass
| 20.727273 | 59 | 0.785088 | [
"MIT"
] | Aptitudetech/shei | shei/shei/doctype/price_configurator/test_price_configurator.py | 228 | Python |
n=input("My Name is Delight Kurian Chandy")
print(n)
| 13.5 | 43 | 0.722222 | [
"MIT"
] | Delightkc/fosslab | script.py | 54 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.