hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1e02bb19dd6a21bbd20f5f43f7edc062c870aab4 | 16,772 | py | Python | src/pykeen/losses.py | tgebhart/pykeen | 7f3cf8499a7ddbe6e3bbc3b8b3e3c2956c5dfae9 | [
"MIT"
] | 1 | 2021-03-24T13:25:54.000Z | 2021-03-24T13:25:54.000Z | src/pykeen/losses.py | tgebhart/pykeen | 7f3cf8499a7ddbe6e3bbc3b8b3e3c2956c5dfae9 | [
"MIT"
] | null | null | null | src/pykeen/losses.py | tgebhart/pykeen | 7f3cf8499a7ddbe6e3bbc3b8b3e3c2956c5dfae9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
r"""Loss functions integrated in PyKEEN.
Rather than re-using the built-in loss functions in PyTorch, we have elected to re-implement
some of the code from :mod:`pytorch.nn.modules.loss` in order to encode the three different
links of loss functions accepted by PyKEEN in a class hierarchy. Thi... | 37.521253 | 120 | 0.642261 |
9e42d3024db99fd754bad3e9dc081375d366d8ce | 389 | py | Python | projects/migrations/0005_project_is_active.py | JackPrajapati/ProjectManagement | 80a3bfd17c08cb4c2227655371df86b49b1cf442 | [
"MIT"
] | null | null | null | projects/migrations/0005_project_is_active.py | JackPrajapati/ProjectManagement | 80a3bfd17c08cb4c2227655371df86b49b1cf442 | [
"MIT"
] | null | null | null | projects/migrations/0005_project_is_active.py | JackPrajapati/ProjectManagement | 80a3bfd17c08cb4c2227655371df86b49b1cf442 | [
"MIT"
] | null | null | null | # Generated by Django 3.1 on 2020-09-14 15:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('projects', '0004_auto_20200914_1521'),
]
operations = [
migrations.AddField(
model_name='project',
name='is_active',
... | 20.473684 | 52 | 0.604113 |
44e71420043caef548c241525f798f826c418bb1 | 7,221 | py | Python | src/.history/DSP_main_20201014004631.py | hassan-alhujhoj/ENEL420-GA-DSP | e550300bc671950f27909b499d440446a325326d | [
"MIT"
] | null | null | null | src/.history/DSP_main_20201014004631.py | hassan-alhujhoj/ENEL420-GA-DSP | e550300bc671950f27909b499d440446a325326d | [
"MIT"
] | null | null | null | src/.history/DSP_main_20201014004631.py | hassan-alhujhoj/ENEL420-GA-DSP | e550300bc671950f27909b499d440446a325326d | [
"MIT"
] | null | null | null | """
Genetic Algorithms for Digital Signal Processing
Created on Mon Oct 05 20:01:05 2020
Last Edited on Mon Oct 12 2020 by Luke Trenberth
TODO tidy up this code and to finalise it. Add up the third FIR filter method in here too.
"""
import numpy as np
from scipy import signal
from scipy.fftpack import fft
imp... | 43.763636 | 149 | 0.62526 |
71f6d022e10157571fa248501cdded32d7f1620f | 13,416 | py | Python | django-backend/app/admin.py | isystematics/SoarCast | 6ba8d7db76e2ba1ad5fd1ab3636dd202b11450b0 | [
"Apache-2.0"
] | 2 | 2021-06-08T16:35:30.000Z | 2022-03-18T16:04:48.000Z | django-backend/app/admin.py | isystematics/SoarCast | 6ba8d7db76e2ba1ad5fd1ab3636dd202b11450b0 | [
"Apache-2.0"
] | 4 | 2022-02-22T18:43:07.000Z | 2022-02-22T18:45:25.000Z | django-backend/app/admin.py | isystematics/SoarCast | 6ba8d7db76e2ba1ad5fd1ab3636dd202b11450b0 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin, messages
from django.utils.safestring import mark_safe
from app.forms import GroupForm, FunctionForm, MapItemForm, RunnerForm, VariableForm, PlaybookMappingForm, \
ConditionVariableForm, ConditionForm, PlaybookItemForm, RedisSettingForm, MapForm, PlaybookForm
from app.utils import... | 33.125926 | 122 | 0.649374 |
fb8ddb9518753305f31e52a76de92781534ed13b | 7,286 | py | Python | nautobot_chatops/utils.py | tanvimoharir/nautobot-plugin-chatops | 8fe984b7918f02eb8015c4c0ae3df889688c7a12 | [
"Apache-2.0"
] | null | null | null | nautobot_chatops/utils.py | tanvimoharir/nautobot-plugin-chatops | 8fe984b7918f02eb8015c4c0ae3df889688c7a12 | [
"Apache-2.0"
] | null | null | null | nautobot_chatops/utils.py | tanvimoharir/nautobot-plugin-chatops | 8fe984b7918f02eb8015c4c0ae3df889688c7a12 | [
"Apache-2.0"
] | null | null | null | """Utility functions for API view implementations."""
from datetime import datetime, timezone
import logging
from django.db.models import Q
from django.http import HttpResponse
from django_rq import get_queue
from nautobot_chatops.choices import AccessGrantTypeChoices, CommandStatusChoices
from nautobot_chatops.mode... | 48.899329 | 117 | 0.704502 |
891bbb6c760e4a4ac8ba430b02633645f1307a91 | 7,189 | py | Python | cornflow/models/roles.py | pchtsp/corn | 2811ad400f3f3681a159984eabf4fee1fc99b433 | [
"MIT"
] | null | null | null | cornflow/models/roles.py | pchtsp/corn | 2811ad400f3f3681a159984eabf4fee1fc99b433 | [
"MIT"
] | null | null | null | cornflow/models/roles.py | pchtsp/corn | 2811ad400f3f3681a159984eabf4fee1fc99b433 | [
"MIT"
] | null | null | null | """
Models defined for the roles and the assignation of roles to users.
"""
# Import from internal modules
from .meta_model import TraceAttributes
from ..shared.const import ADMIN_ROLE, SERVICE_ROLE
from ..shared.utils import db
class RoleModel(TraceAttributes):
# TODO: Should have a user_id to store the user th... | 30.461864 | 107 | 0.620949 |
200691606c435ed1f51d1123ddeb567669f09d16 | 256 | py | Python | setup.py | andykee/loupe | 8b10781598973aac7c129e190209acad7e5a9559 | [
"BSD-3-Clause"
] | 1 | 2022-03-31T03:42:39.000Z | 2022-03-31T03:42:39.000Z | setup.py | andykee/loupe | 8b10781598973aac7c129e190209acad7e5a9559 | [
"BSD-3-Clause"
] | 3 | 2021-04-17T16:21:00.000Z | 2022-01-21T21:23:32.000Z | setup.py | andykee/loupe | 8b10781598973aac7c129e190209acad7e5a9559 | [
"BSD-3-Clause"
] | null | null | null | import re
from setuptools import setup
with open('loupe/__init__.py') as f:
version = re.search("__version__ = '(.*?)'", f.read()).group(1)
setup(
name='Loupe',
version=version,
install_requires=[
'numpy',
'scipy'
]
) | 17.066667 | 67 | 0.585938 |
7149de1bcd686981eeabcc4bc1aed54516338170 | 6,155 | py | Python | amstramdam/game/game.py | felix-martel/amstramdam | 7142c34bda5aecfb5f7059a576a0ea7015a1edbc | [
"CC0-1.0",
"CC-BY-4.0"
] | 3 | 2020-11-28T15:00:56.000Z | 2021-04-06T14:10:47.000Z | amstramdam/game/game.py | felix-martel/amstramdam | 7142c34bda5aecfb5f7059a576a0ea7015a1edbc | [
"CC0-1.0",
"CC-BY-4.0"
] | 9 | 2021-04-11T17:28:57.000Z | 2022-02-19T13:53:35.000Z | amstramdam/game/game.py | felix-martel/amstramdam | 7142c34bda5aecfb5f7059a576a0ea7015a1edbc | [
"CC0-1.0",
"CC-BY-4.0"
] | 2 | 2020-11-17T09:34:50.000Z | 2020-11-28T14:57:58.000Z | from typing import Iterable, Optional
import time
import pandas as pd
from collections import defaultdict
from .geo import Point, distance
from .types import (
Hint,
Player,
PlayerList,
Coordinates,
CoordinatesTuple,
Callback,
Answer,
Record,
RunResults,
GameRunParams,
)
Place... | 30.02439 | 84 | 0.581803 |
a2da2819fe4d48ea244f828d5443498515905b12 | 525 | py | Python | convert_ui_and_qrc_files.py | B0und/WaifuFileSort | 377c2c73a1dc0eaf6c6fd709b41c2b85e2658cfd | [
"MIT"
] | 1 | 2021-09-16T22:35:45.000Z | 2021-09-16T22:35:45.000Z | convert_ui_and_qrc_files.py | B0und/WaifuFileSort | 377c2c73a1dc0eaf6c6fd709b41c2b85e2658cfd | [
"MIT"
] | null | null | null | convert_ui_and_qrc_files.py | B0und/WaifuFileSort | 377c2c73a1dc0eaf6c6fd709b41c2b85e2658cfd | [
"MIT"
] | 1 | 2021-09-16T22:35:46.000Z | 2021-09-16T22:35:46.000Z | import os
from pathlib import Path
# convert interface
for path in Path('').rglob('*.ui'):
path_folder = path.parents[0]
path_filename = path.stem
res_path = Path(path_folder, path_filename + "_ui.py")
os.system(f"python -m PyQt5.uic.pyuic -x {path} -o {res_path}")
# convert icons
for path in Path('')... | 32.8125 | 67 | 0.67619 |
9dd104cc5162c85818bbc13e02143f830e4ed6be | 2,735 | py | Python | docs/conf.py | Brettanda/nextcord-ext-menus | 668ba0694adad02cb7673ecd15ba6d3d890ff835 | [
"MIT"
] | null | null | null | docs/conf.py | Brettanda/nextcord-ext-menus | 668ba0694adad02cb7673ecd15ba6d3d890ff835 | [
"MIT"
] | null | null | null | docs/conf.py | Brettanda/nextcord-ext-menus | 668ba0694adad02cb7673ecd15ba6d3d890ff835 | [
"MIT"
] | null | null | null | import re
import sys
import os
project = "nextcord-ext-menus"
copyright = "2021-present, Nextcord. 2020-2021, Danny (Rapptz)"
author = "Nextcord"
sys.path.insert(0, os.path.abspath(".."))
sys.path.append(os.path.abspath("extensions"))
_version_regex = r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]'
with open("../nextcor... | 27.35 | 100 | 0.639488 |
6e188cef4986416139ce9eb356944d4e31b86f73 | 12,651 | py | Python | matplotlib2tikz/save.py | boeddeker/matplotlib2tikz | d70dd35deb7b7a5844af50627a9d68b32e1681c1 | [
"MIT"
] | 1 | 2021-03-04T18:28:43.000Z | 2021-03-04T18:28:43.000Z | matplotlib2tikz/save.py | boeddeker/matplotlib2tikz | d70dd35deb7b7a5844af50627a9d68b32e1681c1 | [
"MIT"
] | null | null | null | matplotlib2tikz/save.py | boeddeker/matplotlib2tikz | d70dd35deb7b7a5844af50627a9d68b32e1681c1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
from . import axes
from . import legend
from . import line2d
from . import image as img
from . import quadmesh as qmsh
from . import path
from . import patch
from . import text as mytext
import os
import matplotlib as mpl
from matplotlib.collections import Collection
from .__about__ import __... | 38.806748 | 79 | 0.600822 |
c7cbca51608f0e7c88b6814d9344538984964bc3 | 5,160 | py | Python | ansible/modules/hashivault/hashivault_k8s_auth_config.py | metanovii/ansible-modules-hashivault | 34155c880adf444c1c3003af2a0496bb8d7e1350 | [
"MIT"
] | null | null | null | ansible/modules/hashivault/hashivault_k8s_auth_config.py | metanovii/ansible-modules-hashivault | 34155c880adf444c1c3003af2a0496bb8d7e1350 | [
"MIT"
] | null | null | null | ansible/modules/hashivault/hashivault_k8s_auth_config.py | metanovii/ansible-modules-hashivault | 34155c880adf444c1c3003af2a0496bb8d7e1350 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from ansible.module_utils.hashivault import hashivault_argspec
from ansible.module_utils.hashivault import hashivault_auth_client
from ansible.module_utils.hashivault import hashivault_init
from ansible.module_utils.hashivault import hashiwrapper
import json, sys
ANSIBLE_METADATA = {'status': ['s... | 35.102041 | 119 | 0.672868 |
d7517330aae7d0159378e48886784237d7ffaebf | 2,400 | py | Python | setup.py | netsyno/python-docx | f181a89f1c1651baba6a37399e6bba09769459ae | [
"MIT"
] | 3 | 2015-04-12T11:18:40.000Z | 2021-04-28T09:17:38.000Z | setup.py | netsyno/python-docx | f181a89f1c1651baba6a37399e6bba09769459ae | [
"MIT"
] | null | null | null | setup.py | netsyno/python-docx | f181a89f1c1651baba6a37399e6bba09769459ae | [
"MIT"
] | 2 | 2016-02-28T03:20:32.000Z | 2019-10-05T12:01:28.000Z | #!/usr/bin/env python
import os
import re
from setuptools import find_packages, setup
def text_of(relpath):
"""
Return string containing the contents of the file at *relpath* relative to
this file.
"""
thisdir = os.path.dirname(__file__)
file_path = os.path.join(thisdir, os.path.normpath(rel... | 29.268293 | 78 | 0.640417 |
db74f9575a9fbf297847d5f9d83f6ac8f69eeb00 | 1,413 | py | Python | Cluster runs output and postprocessing/out_parse_Total_walltime.py | vinayak-gholap1993/Dealii-Project | 57cd408b464bf390cd225be592db20430f79863b | [
"MIT"
] | null | null | null | Cluster runs output and postprocessing/out_parse_Total_walltime.py | vinayak-gholap1993/Dealii-Project | 57cd408b464bf390cd225be592db20430f79863b | [
"MIT"
] | null | null | null | Cluster runs output and postprocessing/out_parse_Total_walltime.py | vinayak-gholap1993/Dealii-Project | 57cd408b464bf390cd225be592db20430f79863b | [
"MIT"
] | 1 | 2020-11-27T11:49:39.000Z | 2020-11-27T11:49:39.000Z | #!/usr/bin/python
# a short script to extract from output total solution Wall Time
import argparse
import re
# define command line arguments
parser = argparse.ArgumentParser(description='a short script to extract from '
'output relevant data. '
... | 28.836735 | 78 | 0.55414 |
9a616312a33ebdc5da456ffb1c16e5f14f6abefc | 1,236 | py | Python | credentials.py | Emmanuel-otieno/Password_Locker | 0d38ad7a4ee7553683f57c00553e8d3aac78f63b | [
"MIT"
] | null | null | null | credentials.py | Emmanuel-otieno/Password_Locker | 0d38ad7a4ee7553683f57c00553e8d3aac78f63b | [
"MIT"
] | null | null | null | credentials.py | Emmanuel-otieno/Password_Locker | 0d38ad7a4ee7553683f57c00553e8d3aac78f63b | [
"MIT"
] | null | null | null | class Credentials:
"""
Class that generates new instances of users.
"""
credentials_list = []
def __init__(self,credentials_name,name,password,email):
self.credentials_name = credentials_name
self.name = name
self.password = password
self.email = email
def ... | 26.297872 | 63 | 0.605987 |
4e90154a94107a2b238196d52a70a303d281ae0c | 1,809 | py | Python | pyfo/distributions/distribution_wrapper.py | bradleygramhansen/pyfo | 559678080f27e7d9f3f194a0c28e9e8bfe71a7f3 | [
"MIT"
] | 3 | 2018-06-11T09:16:13.000Z | 2019-03-08T05:22:43.000Z | pyfo/distributions/distribution_wrapper.py | bradleygramhansen/pyfo | 559678080f27e7d9f3f194a0c28e9e8bfe71a7f3 | [
"MIT"
] | null | null | null | pyfo/distributions/distribution_wrapper.py | bradleygramhansen/pyfo | 559678080f27e7d9f3f194a0c28e9e8bfe71a7f3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Author: Bradley Gram-Hansen
Time created: 11:28
Date created: 24/01/2018
License: MIT
'''
import torch
from ..utils.core import VariableCast
class TorchDistribution():
"""
A very thin wrapper around torch distributions
"""
def __init__(self, torc... | 28.714286 | 92 | 0.545605 |
f893c1c16d626819e73b92220db6957473f7f530 | 18,448 | py | Python | keystone/assignment/V8_backends/sql.py | ISCAS-VDI/keystone | 11af181c06d78026c89a873f62931558e80f3192 | [
"Apache-2.0"
] | null | null | null | keystone/assignment/V8_backends/sql.py | ISCAS-VDI/keystone | 11af181c06d78026c89a873f62931558e80f3192 | [
"Apache-2.0"
] | null | null | null | keystone/assignment/V8_backends/sql.py | ISCAS-VDI/keystone | 11af181c06d78026c89a873f62931558e80f3192 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012-13 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 law or agreed to... | 40.724062 | 79 | 0.611503 |
57cb8ccc9c7982dfb13619f020cd9d225dd2832e | 2,232 | py | Python | fiche_produit/migrations/0010_auto_20211002_1551.py | amanmyrats/fiche-produit | 37bc109e63a7eaeab05078a268c798bb54136475 | [
"Unlicense"
] | null | null | null | fiche_produit/migrations/0010_auto_20211002_1551.py | amanmyrats/fiche-produit | 37bc109e63a7eaeab05078a268c798bb54136475 | [
"Unlicense"
] | null | null | null | fiche_produit/migrations/0010_auto_20211002_1551.py | amanmyrats/fiche-produit | 37bc109e63a7eaeab05078a268c798bb54136475 | [
"Unlicense"
] | null | null | null | # Generated by Django 3.2.6 on 2021-10-02 10:51
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('fiche_produit', '0009_auto_20211002_1538'),
]
operations = [
migrations.CreateModel(
name='Curr... | 45.55102 | 134 | 0.600806 |
392e430b9d3492aaff3268e9df22a4d8c4cf0e1d | 6,169 | py | Python | nova/tests/api/openstack/compute/plugins/v3/test_extended_availability_zone.py | osrg/nova | 14b6bc655145c832bd9c822e48f877818e0e53ff | [
"Apache-2.0"
] | null | null | null | nova/tests/api/openstack/compute/plugins/v3/test_extended_availability_zone.py | osrg/nova | 14b6bc655145c832bd9c822e48f877818e0e53ff | [
"Apache-2.0"
] | null | null | null | nova/tests/api/openstack/compute/plugins/v3/test_extended_availability_zone.py | osrg/nova | 14b6bc655145c832bd9c822e48f877818e0e53ff | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 OpenStack Foundation
# 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 requ... | 36.720238 | 78 | 0.669476 |
47241d763ba7dcff163d7f1ee226c70f2f14dfb6 | 13,858 | py | Python | coldsweat/models.py | jeroenh/coldsweat | 339f413ea6393c50c7b98b85a8c6fd74a4586567 | [
"MIT"
] | 106 | 2015-02-01T22:24:32.000Z | 2021-11-08T08:50:55.000Z | coldsweat/models.py | jeroenh/coldsweat | 339f413ea6393c50c7b98b85a8c6fd74a4586567 | [
"MIT"
] | 47 | 2015-02-19T13:50:45.000Z | 2019-09-02T19:58:20.000Z | coldsweat/models.py | jeroenh/coldsweat | 339f413ea6393c50c7b98b85a8c6fd74a4586567 | [
"MIT"
] | 23 | 2015-02-20T21:21:54.000Z | 2019-11-30T05:13:17.000Z | # -*- coding: utf-8 -*-
"""
Description: database models
Copyright (c) 2013—2016 Andrea Peltrin
Portions are copyright (c) 2013 Rui Carmo
License: MIT (see LICENSE for details)
"""
import urlparse
import pickle
from datetime import datetime
from peewee import *
from playhouse.migrate import *
from playhouse.signals i... | 30.524229 | 131 | 0.596406 |
8cc6ce7cf0c6da21b6f2d26da79b93a7e9d0d5a8 | 3,418 | py | Python | app.py | jeeyi/cds-demo | 44400cf876f5e2479827c6d908a3479971c04a95 | [
"Apache-2.0"
] | null | null | null | app.py | jeeyi/cds-demo | 44400cf876f5e2479827c6d908a3479971c04a95 | [
"Apache-2.0"
] | null | null | null | app.py | jeeyi/cds-demo | 44400cf876f5e2479827c6d908a3479971c04a95 | [
"Apache-2.0"
] | 1 | 2020-11-02T21:05:34.000Z | 2020-11-02T21:05:34.000Z | # ----------------------------------------------------------------------------#
# Imports
# ----------------------------------------------------------------------------#
from flask import Flask, render_template, request
# from flask.ext.sqlalchemy import SQLAlchemy
import logging
from logging import Formatter, FileHa... | 25.318519 | 81 | 0.545641 |
28e4a9a714cf4a6ffa62b02cce031ee2440d3f8d | 1,984 | py | Python | norminette/rules/check_preprocessor_indent.py | ggjulio/norminette | 7f94851a9dd31c093c85b12ffd1a620754b86a31 | [
"MIT"
] | 2 | 2021-04-14T12:12:56.000Z | 2021-11-05T10:43:37.000Z | norminette/rules/check_preprocessor_indent.py | ggjulio/norminette | 7f94851a9dd31c093c85b12ffd1a620754b86a31 | [
"MIT"
] | null | null | null | norminette/rules/check_preprocessor_indent.py | ggjulio/norminette | 7f94851a9dd31c093c85b12ffd1a620754b86a31 | [
"MIT"
] | null | null | null | from norminette.rules import Rule
ALLOWED_PREPROC = [
"DEFINE",
"IFNDEF",
"IFDEF",
"#IF",
"ELIF",
"#ELSE",
"ENDIF",
"INCLUDE",
"WARNING",
"UNDEF",
]
TOO_MUCH_INDENT = ["IFNDEF", "IFDEF", "ELIF", "#IF", "#ELSE"]
class CheckPreprocessorIndent(Rule):
def __init__(self):
... | 31.492063 | 100 | 0.590726 |
da0963907cb4634a30ecf1032b7103f2f717d8e3 | 2,608 | py | Python | tests/functional/pyocf/types/queue.py | mdnfiras/ocf | 2219719282a2044e881c366bd4d776923d46b395 | [
"BSD-3-Clause-Clear"
] | 2 | 2021-04-15T14:56:05.000Z | 2021-04-15T14:56:07.000Z | tests/functional/pyocf/types/queue.py | arutk/ocf | 53dc4020e3fb5b31846dfc39137e57ab8c8b6fe1 | [
"BSD-3-Clause-Clear"
] | 1 | 2021-01-21T12:27:17.000Z | 2021-01-21T12:27:17.000Z | tests/functional/pyocf/types/queue.py | arutk/ocf | 53dc4020e3fb5b31846dfc39137e57ab8c8b6fe1 | [
"BSD-3-Clause-Clear"
] | null | null | null | #
# Copyright(c) 2019 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause-Clear
#
from ctypes import c_void_p, CFUNCTYPE, Structure, byref
from threading import Thread, Condition, Event
import weakref
from ..ocf import OcfLib
from .shared import OcfError
class QueueOps(Structure):
KICK = CFUNCTYPE(None, c... | 24.603774 | 82 | 0.620782 |
0640a5f4a7907462156347d4b0ac6e1d24961c6f | 2,168 | py | Python | tests/test_numbers.py | massanchik/monero-python | 5699c26f6ba0a64f50ac065ebe0419daf01fd993 | [
"BSD-3-Clause"
] | 130 | 2019-03-22T01:50:38.000Z | 2022-03-30T11:34:12.000Z | tests/test_numbers.py | massanchik/monero-python | 5699c26f6ba0a64f50ac065ebe0419daf01fd993 | [
"BSD-3-Clause"
] | 64 | 2019-03-12T10:32:36.000Z | 2022-03-31T12:38:20.000Z | tests/test_numbers.py | massanchik/monero-python | 5699c26f6ba0a64f50ac065ebe0419daf01fd993 | [
"BSD-3-Clause"
] | 55 | 2019-03-22T01:50:50.000Z | 2022-03-28T02:38:04.000Z | from decimal import Decimal
import sys
import unittest
from monero.numbers import to_atomic, from_atomic, as_monero, PaymentID
class NumbersTestCase(unittest.TestCase):
def test_simple_numbers(self):
self.assertEqual(to_atomic(Decimal('0')), 0)
self.assertEqual(from_atomic(0), Decimal('0'))
... | 42.509804 | 97 | 0.682196 |
1f3892a017b3dcb6d4e5a0caf7f6a032d3da476e | 16,857 | py | Python | influxdb/client.py | ranman/influxdb-python | d1f1cabef95be9e1f17766b66dadf9f1ed9c58be | [
"MIT"
] | null | null | null | influxdb/client.py | ranman/influxdb-python | d1f1cabef95be9e1f17766b66dadf9f1ed9c58be | [
"MIT"
] | null | null | null | influxdb/client.py | ranman/influxdb-python | d1f1cabef95be9e1f17766b66dadf9f1ed9c58be | [
"MIT"
] | 1 | 2020-12-18T14:26:53.000Z | 2020-12-18T14:26:53.000Z | # -*- coding: utf-8 -*-
"""
python client for influxdb
"""
import json
import socket
import requests
session = requests.Session()
class InfluxDBClientError(Exception):
"Raised when an error occures in the Request"
def __init__(self, message, code):
self.message = message
self.code = code
cla... | 26.013889 | 79 | 0.532954 |
39f2f564fc8fccd943ea9c7d92ade4fa206b836b | 579 | py | Python | docker/centos6/wsgi.py | propyless/panopuppet | 6beea45ad25ea1e2ed7dbd5b60210880cd8aab2a | [
"Apache-2.0"
] | 60 | 2015-03-26T14:24:47.000Z | 2016-08-09T17:48:00.000Z | docker/centos6/wsgi.py | propyless/panopuppet | 6beea45ad25ea1e2ed7dbd5b60210880cd8aab2a | [
"Apache-2.0"
] | 108 | 2015-04-17T12:05:46.000Z | 2016-08-23T14:42:19.000Z | docker/centos7/wsgi.py | propyless/panopuppet | 6beea45ad25ea1e2ed7dbd5b60210880cd8aab2a | [
"Apache-2.0"
] | 27 | 2015-03-30T13:23:03.000Z | 2016-10-25T20:18:27.000Z | """
WSGI config for puppet 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/1.7/howto/deployment/wsgi/
"""
import os
"""
If you have another location for the config, uncomment the line below and insert a st... | 28.95 | 114 | 0.773748 |
84333b42b1d83227213b39519a97c2632e20680e | 4,681 | py | Python | app/model.py | S3Infosoft/mvr-payments | 292da7fa9039de459c87d00cec9c3ce8f96a1934 | [
"MIT"
] | null | null | null | app/model.py | S3Infosoft/mvr-payments | 292da7fa9039de459c87d00cec9c3ce8f96a1934 | [
"MIT"
] | 4 | 2019-06-07T07:24:33.000Z | 2019-06-16T09:13:26.000Z | app/model.py | S3Infosoft/mvr-payments | 292da7fa9039de459c87d00cec9c3ce8f96a1934 | [
"MIT"
] | null | null | null | from flask_sqlalchemy import SQLAlchemy
import hashlib
from app.init import app
database = SQLAlchemy(app)
class guest(database.Model):
__tablename__ = 'guest'
email = database.Column('email',database.String,primary_key = True)
name = database.Column('name',database.String)
phoneno = database.Column(... | 32.061644 | 85 | 0.613971 |
bd40ba8f257825d74788648c12ab0a578d8eb0c6 | 771 | py | Python | setup.py | pjdelport/python-ssmi | 6b0554b0e56d4f092631c39d2deb117f35d8b090 | [
"BSD-3-Clause"
] | null | null | null | setup.py | pjdelport/python-ssmi | 6b0554b0e56d4f092631c39d2deb117f35d8b090 | [
"BSD-3-Clause"
] | null | null | null | setup.py | pjdelport/python-ssmi | 6b0554b0e56d4f092631c39d2deb117f35d8b090 | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup, find_packages
setup(
name="python-ssmi",
version="0.0.5",
url='http://github.com/praekelt/python-ssmi',
license='BSD',
description="Python module implementing SSMI for USSD and SMS.",
author='Praekelt Foundation',
author_email='dev@praekeltfoundation.org',
... | 32.125 | 71 | 0.63035 |
0345143afbccdacad9520e4aa093af3bbeab5a4c | 2,137 | py | Python | Sphinx/conf.py | harishbalakrishnan3/Visual-Categorization | 28c5fc4695fca931bb2a49697cf1776dae1e8259 | [
"MIT"
] | null | null | null | Sphinx/conf.py | harishbalakrishnan3/Visual-Categorization | 28c5fc4695fca931bb2a49697cf1776dae1e8259 | [
"MIT"
] | null | null | null | Sphinx/conf.py | harishbalakrishnan3/Visual-Categorization | 28c5fc4695fca931bb2a49697cf1776dae1e8259 | [
"MIT"
] | 1 | 2021-03-15T14:00:27.000Z | 2021-03-15T14:00:27.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or module... | 33.390625 | 84 | 0.671502 |
c31562e71e09ccf96126df3f1277d42c13141600 | 1,672 | py | Python | scripts/render_class_view.py | Gopalbhavesh/3D-IWGAN | cde32240b1064d9f87f04de2af49936ec83be14d | [
"MIT"
] | 192 | 2017-09-11T06:39:33.000Z | 2022-03-31T20:04:42.000Z | scripts/render_class_view.py | Gopalbhavesh/3D-IWGAN | cde32240b1064d9f87f04de2af49936ec83be14d | [
"MIT"
] | 28 | 2017-09-05T02:59:11.000Z | 2021-02-28T01:09:17.000Z | scripts/render_class_view.py | Gopalbhavesh/3D-IWGAN | cde32240b1064d9f87f04de2af49936ec83be14d | [
"MIT"
] | 56 | 2017-11-26T05:52:44.000Z | 2022-03-25T10:59:01.000Z | #!/usr/bin/python
import os.path as osp
import sys
import argparse
import os, tempfile, glob, shutil
BASE_DIR = osp.dirname(__file__)
sys.path.append(osp.join(BASE_DIR,'../'))
from global_variables import *
parser = argparse.ArgumentParser(description='Render Model Images of a certain class and view')
parser.add_ar... | 37.155556 | 194 | 0.719498 |
4f780b26748d3d14409285105a1dc80ae0eaa03b | 2,315 | py | Python | mmnist/flags.py | thomassutter/MoPoE | 477a441ecb6c735a0b8af4d643fe3ac04c58171f | [
"MIT"
] | 3 | 2021-05-06T18:29:09.000Z | 2022-01-13T03:23:25.000Z | mmnist/flags.py | thomassutter/MoPoE | 477a441ecb6c735a0b8af4d643fe3ac04c58171f | [
"MIT"
] | 1 | 2022-02-02T07:49:59.000Z | 2022-02-16T08:16:20.000Z | mmnist/flags.py | thomassutter/MoPoE | 477a441ecb6c735a0b8af4d643fe3ac04c58171f | [
"MIT"
] | 2 | 2021-05-13T02:20:42.000Z | 2022-03-30T04:05:43.000Z | from utils.BaseFlags import parser as parser
parser.add_argument('--dataset', type=str, default='MMNIST', help="name of the dataset")
parser.add_argument('--style_dim', type=int, default=0, help="style dimensionality") # TODO: use modality-specific style dimensions?
parser.add_argument('--num_classes', type=int, def... | 72.34375 | 150 | 0.766739 |
5e2b71bd2c7d14c2495692a8ea361dd87abca069 | 627 | py | Python | files/create-demo-iol-lic.py | khalidkhan82/gns3-gcp | fdd41a39c4122ed0acfe0d8902dfa538af19bf51 | [
"MIT"
] | null | null | null | files/create-demo-iol-lic.py | khalidkhan82/gns3-gcp | fdd41a39c4122ed0acfe0d8902dfa538af19bf51 | [
"MIT"
] | null | null | null | files/create-demo-iol-lic.py | khalidkhan82/gns3-gcp | fdd41a39c4122ed0acfe0d8902dfa538af19bf51 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import socket
import hashlib
import struct
hostid = os.popen('hostid').read().strip()
hostname = socket.gethostname()
ioukey = int(hostid,16)
for x in hostname:
ioukey = ioukey + ord(x)
iouPad1 = b'\x4B\x58\x21\x81\x56\x7B\x0D\xF3\x21\x43\x9B\x7E\xAC\x1D\xE6\x8A'
iouPad2 = b'\x80... | 26.125 | 77 | 0.666667 |
14aef05047e9f91f0dbbb1d841dc146ad5ef28b6 | 9,538 | py | Python | jarvis/Database.py | open-jarvis/pip | 06345491b101e6a224f635115926baa650f99002 | [
"MIT"
] | null | null | null | jarvis/Database.py | open-jarvis/pip | 06345491b101e6a224f635115926baa650f99002 | [
"MIT"
] | null | null | null | jarvis/Database.py | open-jarvis/pip | 06345491b101e6a224f635115926baa650f99002 | [
"MIT"
] | null | null | null | #
# Copyright (c) 2020 by Philipp Scheer. All Rights Reserved.
#
import types
import couchdb2
import requests
import traceback
class Database:
"""
A Database class which handles DB connections and exceptions
"""
Exception = (requests.ConnectionError, Exception)
"""
An exception or a list of ... | 34.18638 | 178 | 0.588803 |
e0bb6700fb61ab4d8ae3350733fac226ab728bda | 1,219 | py | Python | tabs.py | meghana-kantharaj/Natural_scene_classification | 6bd0ef50befd296909d56f79c719325bf1696708 | [
"MIT"
] | null | null | null | tabs.py | meghana-kantharaj/Natural_scene_classification | 6bd0ef50befd296909d56f79c719325bf1696708 | [
"MIT"
] | null | null | null | tabs.py | meghana-kantharaj/Natural_scene_classification | 6bd0ef50befd296909d56f79c719325bf1696708 | [
"MIT"
] | 1 | 2018-04-04T14:08:01.000Z | 2018-04-04T14:08:01.000Z | matrix=[
[' ','coast','forest','mountain','tallbuilding'],
['coast',2923,138,562,634],
['forest',84,3119,323,313],
['mountain',1139,918,1472,934],
['tallBuilding',591,1069,238,2363]
]
summ=0
for i in range(1,5):
for j in range(1,5):
summ= summ+matrix[i][j]
print(summ)
tp=[]
tp.append(matrix[1][1]/(matrix[1]... | 43.535714 | 131 | 0.61854 |
ec27c9883ce78f4c6ec0c16b9e63f6176990edd3 | 942 | py | Python | pinax/stripe/migrations/0002_auto_20180806_1900.py | bonidjukic/pinax-stripe | 161ac480ef8622bdb2b4da49192738f320830e48 | [
"MIT"
] | null | null | null | pinax/stripe/migrations/0002_auto_20180806_1900.py | bonidjukic/pinax-stripe | 161ac480ef8622bdb2b4da49192738f320830e48 | [
"MIT"
] | null | null | null | pinax/stripe/migrations/0002_auto_20180806_1900.py | bonidjukic/pinax-stripe | 161ac480ef8622bdb2b4da49192738f320830e48 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2018-08-06 19:00
from __future__ import unicode_literals
from django.conf import settings
from django.db import connection, migrations, models
def migrate_customers(apps, schema_editor):
cursor = connection.cursor()
if "payments_customer" in connection.... | 29.4375 | 87 | 0.663482 |
a47009f8b005796015284b02c92d23f0387aceba | 114,455 | py | Python | sdk/python/pulumi_azure_native/recoveryservices/v20161201/_inputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/recoveryservices/v20161201/_inputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/recoveryservices/v20161201/_inputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # 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
fro... | 44.517697 | 164 | 0.675628 |
c3d10f04bb44d9d6eaeb0a2873eab22ccc0d584e | 467 | py | Python | env/lib/python3.8/site-packages/plotly/validators/treemap/textfont/_familysrc.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | env/lib/python3.8/site-packages/plotly/validators/treemap/textfont/_familysrc.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | env/lib/python3.8/site-packages/plotly/validators/treemap/textfont/_familysrc.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class FamilysrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="familysrc", parent_name="treemap.textfont", **kwargs
):
super(FamilysrcValidator, self).__init__(
plotly_name=plotly_name,
parent_na... | 31.133333 | 79 | 0.640257 |
95d43aaba2095e1a4f4f1e85e282d5682df5be76 | 4,079 | py | Python | tf_ops/grouping/tf_grouping.py | warlock8hz/pointnet2 | 7e456909379c6d19946bf49b3f54346ec96e0fe5 | [
"MIT"
] | null | null | null | tf_ops/grouping/tf_grouping.py | warlock8hz/pointnet2 | 7e456909379c6d19946bf49b3f54346ec96e0fe5 | [
"MIT"
] | null | null | null | tf_ops/grouping/tf_grouping.py | warlock8hz/pointnet2 | 7e456909379c6d19946bf49b3f54346ec96e0fe5 | [
"MIT"
] | null | null | null | #import tensorflow as tf
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
from tensorflow.python.framework import ops
import sys
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
grouping_module=tf.load_op_library(os.path.join(BASE_DIR, 'tf_grouping_so.so'))
def query_b... | 37.768519 | 95 | 0.640108 |
e3480fddb5d7bd811df64afc4a00c8ef6ec3fc5b | 26,146 | py | Python | python/powermeter_api/api_client.py | thracesystems/powermeter-api | 7bdab034ff916ee49e986de88f157bd044e981c1 | [
"Apache-2.0"
] | null | null | null | python/powermeter_api/api_client.py | thracesystems/powermeter-api | 7bdab034ff916ee49e986de88f157bd044e981c1 | [
"Apache-2.0"
] | null | null | null | python/powermeter_api/api_client.py | thracesystems/powermeter-api | 7bdab034ff916ee49e986de88f157bd044e981c1 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
PowerMeter API
API # noqa: E501
The version of the OpenAPI document: 2021.4.1
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import atexit
import datetime
from dateutil.parser import parse
import json
import mimetypes
from multiprocessing... | 39.1994 | 96 | 0.551557 |
7978b0a7cd7a66a971738ca6d124e54c2dc42799 | 7,373 | py | Python | apps/life_sci/examples/property_prediction/utils.py | ydwu4/dgl-hack | b0fee8b9723c71f45bcf00301653fc71bfa82bc1 | [
"Apache-2.0"
] | 2 | 2021-12-09T12:36:13.000Z | 2022-03-01T21:22:36.000Z | apps/life_sci/examples/property_prediction/utils.py | ydwu4/dgl-hack | b0fee8b9723c71f45bcf00301653fc71bfa82bc1 | [
"Apache-2.0"
] | null | null | null | apps/life_sci/examples/property_prediction/utils.py | ydwu4/dgl-hack | b0fee8b9723c71f45bcf00301653fc71bfa82bc1 | [
"Apache-2.0"
] | 2 | 2020-12-07T09:34:01.000Z | 2020-12-13T06:18:58.000Z | import dgl
import numpy as np
import random
import torch
from dgllife.utils.featurizers import one_hot_encoding
from dgllife.utils.splitters import RandomSplitter
def set_random_seed(seed=0):
"""Set random seed.
Parameters
----------
seed : int
Random seed to use
"""
random.seed(seed)
... | 37.237374 | 95 | 0.582666 |
17b83495c8239aae5adb857728ab661761df0eb6 | 991 | py | Python | lib/SystemCatalog.py | jmartin-r7/geppetto | 51534440dfbc90b3e3fda2650652f5b43039fda9 | [
"BSD-3-Clause"
] | 12 | 2018-11-17T21:17:41.000Z | 2021-12-28T18:29:10.000Z | lib/SystemCatalog.py | jmartin-r7/geppetto | 51534440dfbc90b3e3fda2650652f5b43039fda9 | [
"BSD-3-Clause"
] | 5 | 2019-03-05T17:52:24.000Z | 2022-01-07T14:27:33.000Z | lib/SystemCatalog.py | jmartin-r7/geppetto | 51534440dfbc90b3e3fda2650652f5b43039fda9 | [
"BSD-3-Clause"
] | 16 | 2018-10-29T22:09:44.000Z | 2021-12-08T15:17:31.000Z | import json
class SystemCatalog:
local_catalog = {}
def __init__(self, catalog_file):
with open(catalog_file) as catalog_source:
self.local_catalog = json.load(catalog_source)
def findByOS(self, os_name):
return self.findByAttrEqual('OS', os_name)
def findByCPE(self, cpe... | 31.967742 | 105 | 0.667003 |
20e44b3930a27500b2223393c923bae05ff1f3f6 | 5,477 | py | Python | core/doctype/communication/communication.py | Tejal011089/tru_lib_back | 6579deac057357b61728a42fd71c29a9b41222d3 | [
"MIT"
] | 6 | 2015-08-24T23:10:57.000Z | 2019-11-10T06:57:23.000Z | core/doctype/communication/communication.py | Tejal011089/tru_lib_back | 6579deac057357b61728a42fd71c29a9b41222d3 | [
"MIT"
] | null | null | null | core/doctype/communication/communication.py | Tejal011089/tru_lib_back | 6579deac057357b61728a42fd71c29a9b41222d3 | [
"MIT"
] | 5 | 2015-01-05T06:59:45.000Z | 2020-11-07T15:15:07.000Z | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import scrub_urls
class DocType():
def __init__(self, doc, doclist=[]):
self.doc = doc
self.doclist = doclist
def get_parent_bean(... | 32.60119 | 104 | 0.712251 |
9694785ef3a6f1c08b8abb1a96a0ad11cbb6dc11 | 6,413 | py | Python | strinks/api/styles.py | Zeletochoy/strinks | 80c29fe326d097d0a787443aa72609ed0395784c | [
"Beerware"
] | 1 | 2020-10-09T11:55:58.000Z | 2020-10-09T11:55:58.000Z | strinks/api/styles.py | Zeletochoy/strinks | 80c29fe326d097d0a787443aa72609ed0395784c | [
"Beerware"
] | 1 | 2021-11-09T09:17:53.000Z | 2021-11-15T13:16:42.000Z | strinks/api/styles.py | Zeletochoy/strinks | 80c29fe326d097d0a787443aa72609ed0395784c | [
"Beerware"
] | null | null | null | BROWN = (
"Brown Ale - American",
"Brown Ale - Belgian",
"Brown Ale - English",
"Brown Ale - Imperial / Double",
"Brown Ale - Other",
)
BARLEYWINE = (
"Barleywine - American",
"Barleywine - English",
"Barleywine - Other",
)
BELGIAN = (
"Belgian Blonde",
"Belgian Dubbel",
"B... | 21.376667 | 83 | 0.556214 |
872f5ef6a3f9291f2fd5d68688fbea03ba066c27 | 692 | py | Python | Flask-URL-Shortener-master/Flask-URL-Shortener-master/settings.py | ashi14/AcadviewProject | 6084a38e88236623de9850594cfbecccefeb1581 | [
"MIT"
] | null | null | null | Flask-URL-Shortener-master/Flask-URL-Shortener-master/settings.py | ashi14/AcadviewProject | 6084a38e88236623de9850594cfbecccefeb1581 | [
"MIT"
] | null | null | null | Flask-URL-Shortener-master/Flask-URL-Shortener-master/settings.py | ashi14/AcadviewProject | 6084a38e88236623de9850594cfbecccefeb1581 | [
"MIT"
] | null | null | null | import os
DB_USERNAME = '<db user>'
DB_PASSWORD = '<db pwd>'
DB_DATABASE_NAME = 'shortener'
DB_HOST = os.getenv('IP', '127.0.0.1')
APPLICATION_DIR = os.path.dirname(os.path.realpath(__file__))
SQLALCHEMY_TRACK_MODIFICATIONS = True
DEBUG = True
SECRET_KEY = '<$üP3rPazzWø£D>'
SQLALCHEMY_DATABASE_URI = "mysql+pymysql://%... | 38.444444 | 111 | 0.748555 |
9a431dfeea15347dddc919f78f5f9668c26c6593 | 30,542 | py | Python | src/nonlocal_smms/materials.py | cgubbin/Nonlocal_SMMs | 80ec58f6ec4140a23f2ee710212d0718e2ca1037 | [
"MIT"
] | 1 | 2021-05-05T02:50:23.000Z | 2021-05-05T02:50:23.000Z | src/nonlocal_smms/materials.py | cgubbin/Nonlocal_SMMs | 80ec58f6ec4140a23f2ee710212d0718e2ca1037 | [
"MIT"
] | null | null | null | src/nonlocal_smms/materials.py | cgubbin/Nonlocal_SMMs | 80ec58f6ec4140a23f2ee710212d0718e2ca1037 | [
"MIT"
] | null | null | null | """Contains the media class, which holds the properties of a given material in bulk"""
__all__ = ["Media"]
from typing import Any, Tuple
from itertools import product
import numpy as np
speed_of_light = 299792458
class Media:
"""A class to describe the optical properties of a bulk medium."""
material: s... | 37.940373 | 93 | 0.503307 |
19a7b07c151f10ff322d986afa825ac1c7093ca3 | 155,433 | py | Python | lib/sqlalchemy/orm/query.py | jampp/sqlalchemy | 08430e689f1a0190f671636016b12ff2ca08531f | [
"MIT"
] | 1 | 2018-04-02T18:41:52.000Z | 2018-04-02T18:41:52.000Z | lib/sqlalchemy/orm/query.py | jampp/sqlalchemy | 08430e689f1a0190f671636016b12ff2ca08531f | [
"MIT"
] | null | null | null | lib/sqlalchemy/orm/query.py | jampp/sqlalchemy | 08430e689f1a0190f671636016b12ff2ca08531f | [
"MIT"
] | 3 | 2017-09-26T13:59:24.000Z | 2020-12-04T17:51:54.000Z | # orm/query.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""The Query class and support.
Defines the :class:`.Query` class, the central
constru... | 36.919952 | 102 | 0.59423 |
ca33277089068e27f33dda82ac12a5e17932995c | 232 | py | Python | dsp_fpga/myMatplotlibSettings.py | chipmuenk/python_snippets | 20ea4ad1436cfaa7debcbc9c87cdef375cea996b | [
"MIT"
] | 1 | 2021-03-04T06:53:32.000Z | 2021-03-04T06:53:32.000Z | dsp_fpga/myMatplotlibSettings.py | chipmuenk/python_snippets | 20ea4ad1436cfaa7debcbc9c87cdef375cea996b | [
"MIT"
] | null | null | null | dsp_fpga/myMatplotlibSettings.py | chipmuenk/python_snippets | 20ea4ad1436cfaa7debcbc9c87cdef375cea996b | [
"MIT"
] | 1 | 2020-06-28T10:57:56.000Z | 2020-06-28T10:57:56.000Z | lines.linewidth : 2.0 # line width in points
lines.color : red
#font.family : serif #(was: sans-serif)
font.size : 18.0 # was: 12.0
axes.grid : True # display grid or not: was: False | 33.142857 | 62 | 0.543103 |
fbf6b0bd2c724adc358e7921c81eda98aaa05475 | 507 | py | Python | cohesity_app_sdk/models/sysprep_operation_enum.py | cohesity/app-sdk-python | 6832ed5797b77bf542c9e31226b175281e378f08 | [
"MIT"
] | null | null | null | cohesity_app_sdk/models/sysprep_operation_enum.py | cohesity/app-sdk-python | 6832ed5797b77bf542c9e31226b175281e378f08 | [
"MIT"
] | 2 | 2019-04-12T14:11:49.000Z | 2021-07-22T20:45:23.000Z | cohesity_app_sdk/models/sysprep_operation_enum.py | cohesity/app-sdk-python | 6832ed5797b77bf542c9e31226b175281e378f08 | [
"MIT"
] | 2 | 2019-03-13T01:08:35.000Z | 2019-06-14T18:26:21.000Z | # -*- coding: utf-8 -*-
# Copyright 2019 Cohesity Inc.
class SysprepOperationEnum(object):
"""Implementation of the 'SysprepOperation' enum.
TODO: type enum description here.
Attributes:
KADDUSERSSHKEY: TODO: type description here.
KADDSWAPMOUNTPOINT: TODO: type description here.
... | 22.043478 | 56 | 0.698225 |
97e181c9c8f9ddb09c443f55f5ac35d6d2701d08 | 6,366 | py | Python | regionmask/defined_regions/natural_earth.py | jbusecke/regionmask | 902e2738232ba5ba42cbd8d7867798d21b3b96c0 | [
"MIT"
] | null | null | null | regionmask/defined_regions/natural_earth.py | jbusecke/regionmask | 902e2738232ba5ba42cbd8d7867798d21b3b96c0 | [
"MIT"
] | null | null | null | regionmask/defined_regions/natural_earth.py | jbusecke/regionmask | 902e2738232ba5ba42cbd8d7867798d21b3b96c0 | [
"MIT"
] | null | null | null | import numpy as np
import six
from ..core.regions import Regions
def _maybe_get_column(df, colname):
"""return column of the df or not"""
if isinstance(colname, six.string_types):
# getattr also works for index (df['index'] does not)
# try lower and upper, github #25
if hasattr(df, c... | 29.201835 | 88 | 0.584983 |
deb1e3d57cf48b5197ce1414ef58fb5f8c11af5e | 7,788 | py | Python | v1-src/data_upload.py | askjit/iot-inspector-client | 09fa908ba1d1fcbcbb74a88a3eed950ec9634ce7 | [
"MIT"
] | 1 | 2021-01-29T20:08:19.000Z | 2021-01-29T20:08:19.000Z | v1-src/data_upload.py | askjit/iot-inspector-client | 09fa908ba1d1fcbcbb74a88a3eed950ec9634ce7 | [
"MIT"
] | null | null | null | v1-src/data_upload.py | askjit/iot-inspector-client | 09fa908ba1d1fcbcbb74a88a3eed950ec9634ce7 | [
"MIT"
] | null | null | null | """
Anonymizes and uploads DNS and flow data to cloud.
"""
import time
import datetime
import threading
import utils
import requests
import json
import server_config
from host_state import HostState
UPLOAD_INTERVAL = 5
class DataUploader(object):
def __init__(self, host_state):
assert isinstance(host... | 29.612167 | 78 | 0.574474 |
367ad08d5af6e697201cf0d80989c95196464aaf | 1,636 | py | Python | src/ralph/dnsedit/views.py | quamilek/ralph | bf7231ea096924332b874718b33cd1f43f9c783b | [
"Apache-2.0"
] | null | null | null | src/ralph/dnsedit/views.py | quamilek/ralph | bf7231ea096924332b874718b33cd1f43f9c783b | [
"Apache-2.0"
] | null | null | null | src/ralph/dnsedit/views.py | quamilek/ralph | bf7231ea096924332b874718b33cd1f43f9c783b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
from django.http import HttpResponse, HttpResponseForbidden
from lck.django.common import remote_addr
from django.shortcuts impor... | 29.745455 | 67 | 0.722494 |
91a2e33b80eabbb7ab7ccd98f223bba69fe010db | 421 | py | Python | dbag/dbag_metric_types.py | PolicyStat/dbag | 8541d692f52e23242ac7f5669903569f5927eece | [
"MIT"
] | 1 | 2019-09-15T16:47:47.000Z | 2019-09-15T16:47:47.000Z | dbag/dbag_metric_types.py | PolicyStat/dbag | 8541d692f52e23242ac7f5669903569f5927eece | [
"MIT"
] | 4 | 2015-12-18T18:45:18.000Z | 2019-07-18T18:58:52.000Z | dbag/dbag_metric_types.py | PolicyStat/dbag | 8541d692f52e23242ac7f5669903569f5927eece | [
"MIT"
] | null | null | null | from django.conf import settings
from dbag import dbag_manager
from dbag.metric_types import QueryMetric
class UserMetric(QueryMetric):
query_model = settings.AUTH_USER_MODEL
dbag_manager.register_metric_type('users_metric', UserMetric)
class ActiveUsersCount(UserMetric):
default_query_filter = {'key': 'i... | 24.764706 | 73 | 0.814727 |
f2482aed20b8a1b6b57ab4fc09b0a360e2625bc5 | 9,104 | py | Python | src/tensorpro_interfaces/TanwayUserMenu.py | tanwayRD/tensorpro_view | 29152f28c216bad3f47082eb16ea67f78ee2bfd6 | [
"BSD-3-Clause"
] | 3 | 2020-08-24T07:43:31.000Z | 2021-03-25T07:15:53.000Z | src/tensorpro_interfaces/TanwayUserMenu.py | tanwayRD/tensorpro_view | 29152f28c216bad3f47082eb16ea67f78ee2bfd6 | [
"BSD-3-Clause"
] | null | null | null | src/tensorpro_interfaces/TanwayUserMenu.py | tanwayRD/tensorpro_view | 29152f28c216bad3f47082eb16ea67f78ee2bfd6 | [
"BSD-3-Clause"
] | 2 | 2020-06-10T06:08:15.000Z | 2020-09-02T03:05:29.000Z | #-*- coding:utf-8 -*-
#!/usr/bin/env python
# Copyright (C) 2020 Tanway Technology Co., Ltd
# License: BSD 3-Clause License
#
## Version: V1.2
## Author: Elodie Shan
## Editor: LF Shen
## Updated Date: 2019-11-26
## Function: Check connnection state and set IP for Tensor-Pro Lidar
from python_qt_binding... | 38.576271 | 203 | 0.582272 |
41b25962bd26ee43f5d571e0c4b1645b6ba265bc | 390 | py | Python | class/staticmethod_classmethod.py | dineshkumar2509/learning-python | e8af11ff0b396da4c3f2cfe21d14131bae4b2adb | [
"MIT"
] | 86 | 2015-06-13T16:53:55.000Z | 2022-03-24T20:56:42.000Z | class/staticmethod_classmethod.py | pei-zheng-yi/learning-python | 55e350dfe44cf04f7d4408e76e72d2f467bd42ce | [
"MIT"
] | 9 | 2015-05-27T07:52:44.000Z | 2022-03-29T21:52:40.000Z | class/staticmethod_classmethod.py | pei-zheng-yi/learning-python | 55e350dfe44cf04f7d4408e76e72d2f467bd42ce | [
"MIT"
] | 124 | 2015-12-10T01:17:18.000Z | 2021-11-08T04:03:38.000Z |
#!/usr/bin/env python
# http://blog.csdn.net/handsomekang/article/details/9615239
class A(object):
bar = 1
def foo(self):
print 'foo'
@staticmethod
def static_foo():
print 'static_foo'
print A.bar
@classmethod
def class_foo(cls):
print 'class_foo'
prin... | 16.25 | 59 | 0.584615 |
1f65ae90f558087a01751de4dc70cc9d101f7878 | 2,627 | py | Python | examples/under-construction/walker.py | XCaellaX/osim-rl | 6ec6f2c7e98ab510f8b37db4fb573ade69d13c0b | [
"MIT"
] | 867 | 2017-01-21T20:53:36.000Z | 2022-03-20T09:47:08.000Z | examples/under-construction/walker.py | XCaellaX/osim-rl | 6ec6f2c7e98ab510f8b37db4fb573ade69d13c0b | [
"MIT"
] | 197 | 2017-01-22T21:27:36.000Z | 2022-01-10T16:18:35.000Z | examples/under-construction/walker.py | XCaellaX/osim-rl | 6ec6f2c7e98ab510f8b37db4fb573ade69d13c0b | [
"MIT"
] | 277 | 2017-02-01T18:42:18.000Z | 2022-03-23T11:30:31.000Z | import os
from osim.env import OsimEnv
## Define an environment where we teach an agent to stand still
# We use a walker model and define the objective to keep the center of mass still
class StandingEnv(OsimEnv):
model_path = os.path.join(os.path.dirname(__file__), '../osim/models/SoccerKickingModel.osim')
... | 37.528571 | 139 | 0.61515 |
59625308da3db243b98a852cb17a62f10360f812 | 2,139 | py | Python | data/create_tfrecord.py | goodhamgupta/aon | 5988f6500171d7d0c953dd9591f1f55a91355545 | [
"MIT"
] | 1 | 2020-10-20T02:36:06.000Z | 2020-10-20T02:36:06.000Z | data/create_tfrecord.py | goodhamgupta/aon | 5988f6500171d7d0c953dd9591f1f55a91355545 | [
"MIT"
] | 1 | 2019-03-29T07:31:55.000Z | 2019-03-31T10:04:03.000Z | data/create_tfrecord.py | goodhamgupta/aon | 5988f6500171d7d0c953dd9591f1f55a91355545 | [
"MIT"
] | null | null | null | import tensorflow as tf
import standard_fields as fields
import cv2
import dataset_util
import skimage
flags = tf.app.flags
flags.DEFINE_string(
'output_path',
'/Users/shubham/shubham/amrita_research/AON/data/train.tfrecord',
'tfrecord filename'
)
flags.DEFINE_string(
'tags_file_path',
... | 31.455882 | 78 | 0.550257 |
558e7e9acaa4bfdb64471afdf7ae4e37174c5d78 | 1,300 | py | Python | DiglettBot.py | prodigion/DiglettBot | a6c4e814511c28a84c6f05cc86ed2241821db2a3 | [
"MIT"
] | 1 | 2019-10-18T04:16:09.000Z | 2019-10-18T04:16:09.000Z | DiglettBot.py | prodigion/DiglettBot | a6c4e814511c28a84c6f05cc86ed2241821db2a3 | [
"MIT"
] | null | null | null | DiglettBot.py | prodigion/DiglettBot | a6c4e814511c28a84c6f05cc86ed2241821db2a3 | [
"MIT"
] | 4 | 2019-04-28T04:28:52.000Z | 2020-02-07T21:02:19.000Z | from discord import Intents
from discord.ext import commands
def get_prefix(bot, message):
"""A callable Prefix for our bot. This could be edited to allow per server prefixes."""
prefixes = ['!']
# Check to see if we are outside of a guild. e.g DM's etc.
if not message.guild:
# Only allow ? ... | 32.5 | 122 | 0.642308 |
a7563213d8a0d4a5c97918d890f867f69c064b44 | 2,704 | py | Python | cpmpy/remarkable_sequence.py | hakank/hakank | 313e5c0552569863047f6ce9ae48ea0f6ec0c32b | [
"MIT"
] | 279 | 2015-01-10T09:55:35.000Z | 2022-03-28T02:34:03.000Z | cpmpy/remarkable_sequence.py | hakank/hakank | 313e5c0552569863047f6ce9ae48ea0f6ec0c32b | [
"MIT"
] | 10 | 2017-10-05T15:48:50.000Z | 2021-09-20T12:06:52.000Z | cpmpy/remarkable_sequence.py | hakank/hakank | 313e5c0552569863047f6ce9ae48ea0f6ec0c32b | [
"MIT"
] | 83 | 2015-01-20T03:44:00.000Z | 2022-03-13T23:53:06.000Z | """
Remarkable sequence in cpmpy.
Problem statement in the Alma-0 example program remarkable.a0
'''
This problem is taken from
@book{CC88,
author = 'H. Coelho and J. C. Cotta',
title = 'Prolog by Example',
publisher = 'Springer-Verlag',
address = 'Berlin',
year = 1988}
(page 193)
Call a... | 26.509804 | 100 | 0.660873 |
ee97bd6f4a9f19e7831f30a3ca41c9595530627a | 5,249 | py | Python | xarm_planner/launch/xarm7_planner_realmove.launch.py | lukicdarkoo/xarm_ros2 | d968f636972d6953fcc0e8d8bc0003d8d3fff589 | [
"BSD-3-Clause"
] | 15 | 2021-06-16T08:59:38.000Z | 2022-03-20T23:25:10.000Z | xarm_planner/launch/xarm7_planner_realmove.launch.py | lukicdarkoo/xarm_ros2 | d968f636972d6953fcc0e8d8bc0003d8d3fff589 | [
"BSD-3-Clause"
] | 6 | 2021-08-24T06:43:29.000Z | 2022-03-21T04:25:40.000Z | xarm_planner/launch/xarm7_planner_realmove.launch.py | lukicdarkoo/xarm_ros2 | d968f636972d6953fcc0e8d8bc0003d8d3fff589 | [
"BSD-3-Clause"
] | 8 | 2021-06-16T08:59:44.000Z | 2022-03-15T22:13:33.000Z | #!/usr/bin/env python3
# Software License Agreement (BSD License)
#
# Copyright (c) 2021, UFACTORY, Inc.
# All rights reserved.
#
# Author: Vinman <vinman.wen@ufactory.cc> <vinman.cub@gmail.com>
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sour... | 47.288288 | 147 | 0.706611 |
e380691658c04697af742a51fa88bbc8d5f60367 | 4,164 | py | Python | daq/container_gateway.py | grafnu/daq-staging | 47c1015dbfd1a5bbcaa373f6b6d5cf2e53402b4f | [
"Apache-2.0"
] | 41 | 2018-06-11T06:34:37.000Z | 2022-01-14T18:07:49.000Z | daq/container_gateway.py | faucetsdn/daq | 2aea73dc6cbcd7844e26ce39bc04b35ff2e4be30 | [
"Apache-2.0"
] | 843 | 2018-09-03T05:28:16.000Z | 2022-03-22T20:11:20.000Z | daq/container_gateway.py | grafnu/daq-staging | 47c1015dbfd1a5bbcaa373f6b6d5cf2e53402b4f | [
"Apache-2.0"
] | 33 | 2018-05-22T15:33:57.000Z | 2022-02-15T21:55:56.000Z | """Gateway module for device testing"""
import os
from clib import docker_host
import dhcp_monitor
import logger
import tcpdump_helper
from base_gateway import BaseGateway
LOGGER = logger.get_logger('gateway')
class ContainerGateway(BaseGateway):
"""Gateway collection class for managing testing services"""
... | 39.283019 | 92 | 0.634246 |
1e43d056ebcb26cef99d8d6fd58931fa372235c7 | 242 | py | Python | sololearn/SnowballingNumbers/SnowballingNumbers.py | SneakyWizards/HackerRankSolutions | daf494e7775bb0de5afcfdcfd45aa73e6a950e0e | [
"RSA-MD"
] | 3 | 2020-01-08T18:33:11.000Z | 2022-02-08T00:38:26.000Z | sololearn/SnowballingNumbers/SnowballingNumbers.py | SneakyWizards/HackerRankSolutions | daf494e7775bb0de5afcfdcfd45aa73e6a950e0e | [
"RSA-MD"
] | null | null | null | sololearn/SnowballingNumbers/SnowballingNumbers.py | SneakyWizards/HackerRankSolutions | daf494e7775bb0de5afcfdcfd45aa73e6a950e0e | [
"RSA-MD"
] | 4 | 2020-08-08T22:02:23.000Z | 2022-02-07T17:40:15.000Z | #!/usr/bin/python
n = int(input())
arr = list()
for i in range(n):
arr.append(int(input()))
sum = arr[0]
for i in range(1, n):
if arr[i] > sum:
sum += arr[i]
else:
print("false")
exit(0)
print("true")
| 12.736842 | 28 | 0.5 |
dba230bca22171c21d0bdeadb4afeddb10533d27 | 712 | py | Python | tests/test_filters.py | ButterflyBug/Affordable-leggins | 0031fb06796e47c6fbf7b38fd226d0365c2ca98f | [
"MIT"
] | 3 | 2019-10-17T09:52:46.000Z | 2020-12-28T10:41:34.000Z | tests/test_filters.py | ButterflyBug/Affordable-leggins | 0031fb06796e47c6fbf7b38fd226d0365c2ca98f | [
"MIT"
] | 2 | 2019-10-29T21:09:44.000Z | 2021-06-10T18:11:50.000Z | tests/test_filters.py | ButterflyBug/Affordable-leggins | 0031fb06796e47c6fbf7b38fd226d0365c2ca98f | [
"MIT"
] | null | null | null | from affordable_leggins.filters import filter_size
from fixtures import (
leggin_with_size_xs,
leggin_with_size_s,
leggin_with_size_m,
leggins,
)
def test_filter_size(leggins, leggin_with_size_s):
assert leggin_with_size_s in filter_size(leggins, "S")
def test_filter_other_size(leggins, leggin_w... | 25.428571 | 73 | 0.782303 |
65aa08872e07131070ef846d96f23f6e6e8b165c | 1,566 | py | Python | models/test_model.py | JianJuly/Ea-GANs | 70baa89ca7acf205049a611e24c7011439c37200 | [
"MIT"
] | 12 | 2020-01-14T08:47:00.000Z | 2022-03-09T10:02:52.000Z | models/test_model.py | JianJuly/Ea-GANs | 70baa89ca7acf205049a611e24c7011439c37200 | [
"MIT"
] | 2 | 2020-04-25T09:09:03.000Z | 2021-09-15T12:11:31.000Z | models/test_model.py | JianJuly/Ea-GANs | 70baa89ca7acf205049a611e24c7011439c37200 | [
"MIT"
] | 10 | 2019-11-26T12:13:02.000Z | 2021-12-21T12:45:34.000Z | from torch.autograd import Variable
from collections import OrderedDict
import util.util as util
from .base_model import BaseModel
from . import networks
class TestModel(BaseModel):
def name(self):
return 'TestModel'
def initialize(self, opt):
assert(not opt.isTrain)
BaseModel.initial... | 34.043478 | 91 | 0.592593 |
ab19146d56721f3b1b4ed39d78cdb183ac57c50d | 598 | py | Python | pip_audit/_dependency_source/__init__.py | westonsteimel/pip-audit | 3b29e66418de9236c92b3ffaa254ae9def2bdcbf | [
"Apache-2.0"
] | 447 | 2021-09-02T17:06:18.000Z | 2022-03-28T20:58:22.000Z | pip_audit/_dependency_source/__init__.py | westonsteimel/pip-audit | 3b29e66418de9236c92b3ffaa254ae9def2bdcbf | [
"Apache-2.0"
] | 177 | 2021-09-02T16:45:42.000Z | 2022-03-29T14:19:11.000Z | pip_audit/_dependency_source/__init__.py | westonsteimel/pip-audit | 3b29e66418de9236c92b3ffaa254ae9def2bdcbf | [
"Apache-2.0"
] | 25 | 2021-09-13T16:04:23.000Z | 2022-03-21T17:47:28.000Z | """
Dependency source interfaces and implementations for `pip-audit`.
"""
from .interface import (
DependencyFixError,
DependencyResolver,
DependencyResolverError,
DependencySource,
DependencySourceError,
)
from .pip import PipSource, PipSourceError
from .requirement import RequirementSource
from .... | 22.148148 | 65 | 0.740803 |
66d49d6fb364e0f784d2c7b0f4b486a63eb6e321 | 771 | py | Python | src/collect_drugs/spiders/drugs.py | ianshan0915/ade-extraction | c18b157c90d2ea3903a0340eb2b600990411f21c | [
"MIT"
] | 1 | 2019-05-28T10:23:19.000Z | 2019-05-28T10:23:19.000Z | src/collect_drugs/spiders/drugs.py | ianshan0915/ade-extraction | c18b157c90d2ea3903a0340eb2b600990411f21c | [
"MIT"
] | null | null | null | src/collect_drugs/spiders/drugs.py | ianshan0915/ade-extraction | c18b157c90d2ea3903a0340eb2b600990411f21c | [
"MIT"
] | null | null | null | import json
import scrapy
class ScrpayDrugs(scrapy.Spider):
name = 'scrapy-drugs'
# prepare urls
substances = json.load(open('/Users/ianshen/Documents/github/ade-extraction/data/substances.json','r'))
urls = [ item['url_link'] for item in substances]
start_urls = urls[:10]
def parse(self, response):
... | 32.125 | 105 | 0.648508 |
94e71126279df3d05965a039b9cad74247c5e71c | 2,160 | py | Python | moto/cloudtrail/exceptions.py | symroe/moto | 4e106995af6f2820273528fca8a4e9ee288690a5 | [
"Apache-2.0"
] | 5,460 | 2015-01-01T01:11:17.000Z | 2022-03-31T23:45:38.000Z | moto/cloudtrail/exceptions.py | symroe/moto | 4e106995af6f2820273528fca8a4e9ee288690a5 | [
"Apache-2.0"
] | 4,475 | 2015-01-05T19:37:30.000Z | 2022-03-31T13:55:12.000Z | moto/cloudtrail/exceptions.py | symroe/moto | 4e106995af6f2820273528fca8a4e9ee288690a5 | [
"Apache-2.0"
] | 1,831 | 2015-01-14T00:00:44.000Z | 2022-03-31T20:30:04.000Z | """Exceptions raised by the cloudtrail service."""
from moto.core import ACCOUNT_ID
from moto.core.exceptions import JsonRESTError
class InvalidParameterCombinationException(JsonRESTError):
code = 400
def __init__(self, message):
super().__init__("InvalidParameterCombinationException", message)
cla... | 29.589041 | 142 | 0.713889 |
13ac670e34a6c1c995be6a29d118646b069c0547 | 10,727 | py | Python | openff/evaluator/storage/data.py | jaketanderson/openff-evaluator | 68541612fb0dacacc909d02f273c66ae830051d5 | [
"MIT"
] | 14 | 2019-02-01T18:56:58.000Z | 2019-12-10T18:01:38.000Z | openff/evaluator/storage/data.py | jaketanderson/openff-evaluator | 68541612fb0dacacc909d02f273c66ae830051d5 | [
"MIT"
] | 168 | 2019-01-31T19:54:11.000Z | 2020-02-05T21:47:00.000Z | openff/evaluator/storage/data.py | jaketanderson/openff-evaluator | 68541612fb0dacacc909d02f273c66ae830051d5 | [
"MIT"
] | 4 | 2019-05-01T17:45:24.000Z | 2019-11-11T19:34:28.000Z | """
A collection of classes representing data stored by a storage backend.
"""
import abc
from typing import Optional
from openff.evaluator.attributes import AttributeClass
from openff.evaluator.datasets import PropertyPhase
from openff.evaluator.forcefield import ForceFieldSource
from openff.evaluator.storage.attribu... | 30.474432 | 89 | 0.655169 |
42f96b259aa38876833b2616aaf01503dd69daa5 | 7,768 | py | Python | Machine Learning Explainability/02.Permutation_Importance.py | BEPb/Python-100-days | 06993bb5806a207abc7e376454548b9847f4f825 | [
"MIT"
] | 16 | 2021-05-09T19:04:00.000Z | 2022-03-24T13:14:28.000Z | Machine Learning Explainability/02.Permutation_Importance.py | Jumanazarov-Shukrullo/Python-100-days | 8f846962cd45342aa2490ec2e86df358ae0ef281 | [
"MIT"
] | null | null | null | Machine Learning Explainability/02.Permutation_Importance.py | Jumanazarov-Shukrullo/Python-100-days | 8f846962cd45342aa2490ec2e86df358ae0ef281 | [
"MIT"
] | 3 | 2022-03-01T01:56:43.000Z | 2022-03-20T19:19:49.000Z | # Permutation Importance
# Загрузите данные
# Разделите данные на обучение и проверку
# Создайте модель, предсказывающую стоимость такси.
# Распечатайте несколько строк для просмотра
# Loading data, dividing, modeling and EDA below
import pandas as pd
from sklearn.ensemble import RandomForestRegressor
from sklearn.lin... | 49.477707 | 218 | 0.777291 |
5d47904ba264379fb9b58d87924ceace115164e3 | 2,141 | py | Python | cursos/migrations/0002_alter_aulas_options_alter_cursos_options_and_more.py | ShadowsS01/Cursos-Django | 40ca002d7de34d2d4e192819801e99b62938f1f2 | [
"MIT"
] | null | null | null | cursos/migrations/0002_alter_aulas_options_alter_cursos_options_and_more.py | ShadowsS01/Cursos-Django | 40ca002d7de34d2d4e192819801e99b62938f1f2 | [
"MIT"
] | null | null | null | cursos/migrations/0002_alter_aulas_options_alter_cursos_options_and_more.py | ShadowsS01/Cursos-Django | 40ca002d7de34d2d4e192819801e99b62938f1f2 | [
"MIT"
] | null | null | null | # Generated by Django 4.0.1 on 2022-01-18 17:35
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('usuarios', '0001_initial'),
('cursos', '0001_initial'),
]
operations = [
migrations... | 38.927273 | 150 | 0.566091 |
e04354cd3f5e0653198ef34828930c3377d6dd8e | 8,547 | py | Python | src/bnn_priors/bnn_priors/mcmc/verlet_sgld.py | activatedgeek/uncertainty-da-bayesian-classification | a270fb095f4790dea15327145897d09d0ba9c80b | [
"Apache-2.0"
] | 31 | 2021-02-16T09:35:03.000Z | 2022-03-31T17:18:54.000Z | src/bnn_priors/bnn_priors/mcmc/verlet_sgld.py | activatedgeek/understanding-bayesian-classification | a270fb095f4790dea15327145897d09d0ba9c80b | [
"Apache-2.0"
] | 1 | 2021-05-10T15:25:48.000Z | 2021-05-10T15:25:48.000Z | src/bnn_priors/bnn_priors/mcmc/verlet_sgld.py | activatedgeek/understanding-bayesian-classification | a270fb095f4790dea15327145897d09d0ba9c80b | [
"Apache-2.0"
] | 4 | 2021-02-21T03:38:00.000Z | 2021-12-24T15:13:29.000Z | import torch
import math
from typing import Sequence, Optional, Callable, Tuple, Dict, Union
import typing
from .sgld import SGLD, dot
class VerletSGLD(SGLD):
"""SGLD with momentum, preconditioning and diagnostics from Wenzel et al. 2020.
Uses Verlet integration instead of Euler symplectic integration.
T... | 43.166667 | 85 | 0.583831 |
8245dcfa91f7008c7b17b8eec7a41320c49731c8 | 6,581 | py | Python | test/functional/mempool_persist.py | sirlanceoflompoc/karmacoin | 3a75016399f75c27f97856f842915b5c7c4e8fb6 | [
"MIT"
] | null | null | null | test/functional/mempool_persist.py | sirlanceoflompoc/karmacoin | 3a75016399f75c27f97856f842915b5c7c4e8fb6 | [
"MIT"
] | null | null | null | test/functional/mempool_persist.py | sirlanceoflompoc/karmacoin | 3a75016399f75c27f97856f842915b5c7c4e8fb6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Karmacoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mempool persistence.
By default, karmacoind will dump mempool on shutdown and
then reload it on... | 48.036496 | 207 | 0.699286 |
8a422712b22c8beae5a525dff013f6dec348d706 | 15,530 | py | Python | zeeguu_api/api/teacher_dashboard.py | alinbalutoiu/Zeeguu-API | e6f26d0bff8e19307f1378c677c97b6bb46f3d75 | [
"MIT"
] | null | null | null | zeeguu_api/api/teacher_dashboard.py | alinbalutoiu/Zeeguu-API | e6f26d0bff8e19307f1378c677c97b6bb46f3d75 | [
"MIT"
] | null | null | null | zeeguu_api/api/teacher_dashboard.py | alinbalutoiu/Zeeguu-API | e6f26d0bff8e19307f1378c677c97b6bb46f3d75 | [
"MIT"
] | null | null | null | import json
from datetime import datetime, timedelta
import flask
from flask import request, jsonify
import sqlalchemy
from sqlalchemy.orm.exc import NoResultFound
import uuid
from .utils.json_result import json_result
from .utils.route_wrappers import with_session
from . import api
import zeeguu_core
from zeeguu_... | 29.865385 | 119 | 0.652093 |
9f8f1f255a069c6c0d7fa4eac627f02c17445737 | 11,090 | py | Python | Cogs/DisplayName.py | skylarr1227/CorpBot.py | a6b4de2ff127320085411dd478e923c02d5e9f57 | [
"MIT"
] | null | null | null | Cogs/DisplayName.py | skylarr1227/CorpBot.py | a6b4de2ff127320085411dd478e923c02d5e9f57 | [
"MIT"
] | null | null | null | Cogs/DisplayName.py | skylarr1227/CorpBot.py | a6b4de2ff127320085411dd478e923c02d5e9f57 | [
"MIT"
] | null | null | null | import asyncio
import discord
import re
from discord.ext import commands
from Cogs import Nullify
# Stupid global vars because I didn't plan this
# out correctly... sigh...
bot = None
def setup(bot_start):
# This module isn't actually a cog - but it is a place
# we can start small fires and watch... | 34.984227 | 126 | 0.528224 |
0cca126f7f1bbe2afd3fff6e37bdc717c55ae82a | 262 | py | Python | python/p2.py | nhutnamhcmus/project-Euler | a39b55fa558a0058fd196a5b8062b87875b415dd | [
"MIT"
] | null | null | null | python/p2.py | nhutnamhcmus/project-Euler | a39b55fa558a0058fd196a5b8062b87875b415dd | [
"MIT"
] | null | null | null | python/p2.py | nhutnamhcmus/project-Euler | a39b55fa558a0058fd196a5b8062b87875b415dd | [
"MIT"
] | null | null | null | # Solution to Project Euler problem 2
# Copyright (c) Nhut-Nam Le. All rights reserved.
def solution(n):
x, y = (1, 2)
s = 0
while x < n + 1:
if x % 2 == 0:
s += x
x, y = (y, x + y)
return s
print(solution(4000000))
| 18.714286 | 49 | 0.5 |
415f7213604881d4f63229910a0cb21476e053b9 | 957 | py | Python | src/matrix/checker.py | mkanin/MatricesMultiplication | 820d2f8204db20bab75e7c8cb5d5ed249316e2a1 | [
"MIT"
] | null | null | null | src/matrix/checker.py | mkanin/MatricesMultiplication | 820d2f8204db20bab75e7c8cb5d5ed249316e2a1 | [
"MIT"
] | null | null | null | src/matrix/checker.py | mkanin/MatricesMultiplication | 820d2f8204db20bab75e7c8cb5d5ed249316e2a1 | [
"MIT"
] | null | null | null | # Copyright (c) 2018 Mikhail Kanin
import math
class MatrixChecker:
def test_size(self, matrix):
n_rows = matrix.shape()[0]
n_columns = matrix.shape()[1]
if n_rows == 0 or n_columns == 0:
raise ValueError("Matrix %s has empty rows or columns." % (matrix._label,))
... | 39.875 | 125 | 0.61651 |
15fdef209c8086ff8c9a6c3b50250310e93f69e4 | 6,320 | py | Python | install/app_store/tk-multi-publish/v0.10.9/hooks/secondary_publish_tk-3dsmax.py | JoanAzpeitia/lp_sg | e0ee79555e419dd2ae3a5f31e5515b3f40b22a62 | [
"MIT"
] | null | null | null | install/app_store/tk-multi-publish/v0.10.9/hooks/secondary_publish_tk-3dsmax.py | JoanAzpeitia/lp_sg | e0ee79555e419dd2ae3a5f31e5515b3f40b22a62 | [
"MIT"
] | null | null | null | install/app_store/tk-multi-publish/v0.10.9/hooks/secondary_publish_tk-3dsmax.py | JoanAzpeitia/lp_sg | e0ee79555e419dd2ae3a5f31e5515b3f40b22a62 | [
"MIT"
] | 1 | 2020-02-15T10:42:56.000Z | 2020-02-15T10:42:56.000Z | # Copyright (c) 2013 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to t... | 47.164179 | 112 | 0.386551 |
c22697fd7787ea1d9bc30c3272c5ba045125680d | 4,672 | py | Python | jsonlogging/values.py | ucamhal/jsonlogging | 7606abb00c3cdc9536c8947d5ab1e210716e8d47 | [
"BSD-2-Clause"
] | 1 | 2017-03-19T12:06:58.000Z | 2017-03-19T12:06:58.000Z | jsonlogging/values.py | ucamhal/jsonlogging | 7606abb00c3cdc9536c8947d5ab1e210716e8d47 | [
"BSD-2-Clause"
] | null | null | null | jsonlogging/values.py | ucamhal/jsonlogging | 7606abb00c3cdc9536c8947d5ab1e210716e8d47 | [
"BSD-2-Clause"
] | null | null | null | """
This module contains a number of Value implementations. These Value classes
have a single method: render(record) which pull out and return a value
from a logging.LogRecord instance.
"""
import datetime
import traceback
from collections import OrderedDict
class OrderedObjectValue(object):
"""
A Value impl... | 30.141935 | 79 | 0.675086 |
0bcdd811907f151d5b858efd0c9238195d82c079 | 3,922 | py | Python | isi_sdk_8_0_1/test/test_namespace_api.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_0_1/test/test_namespace_api.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_0_1/test/test_namespace_api.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 4
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_0_1
from i... | 19.320197 | 79 | 0.613208 |
c0a5768647aa2b8c98b8600843876e94c59d6ee0 | 3,103 | py | Python | examples/llvm_autotuning/info.py | bcui19/CompilerGym | b3d23cf23c4242df8cf8f54f55db79ef3091eabf | [
"MIT"
] | null | null | null | examples/llvm_autotuning/info.py | bcui19/CompilerGym | b3d23cf23c4242df8cf8f54f55db79ef3091eabf | [
"MIT"
] | null | null | null | examples/llvm_autotuning/info.py | bcui19/CompilerGym | b3d23cf23c4242df8cf8f54f55db79ef3091eabf | [
"MIT"
] | 1 | 2022-02-16T04:02:46.000Z | 2022-02-16T04:02:46.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import sys
from pathlib import Path
from typing import List
import pandas as pd
from llvm_autotuning.experiment import Experiment
from pydanti... | 30.126214 | 86 | 0.595875 |
be2847316efc41cd7c193d356970d10e9ae6259f | 852 | py | Python | scripts/create-compose-file.py | pcrespov/osparcli | d12739dada3b89545b7ef2507d8d5b0de0855f30 | [
"MIT"
] | null | null | null | scripts/create-compose-file.py | pcrespov/osparcli | d12739dada3b89545b7ef2507d8d5b0de0855f30 | [
"MIT"
] | null | null | null | scripts/create-compose-file.py | pcrespov/osparcli | d12739dada3b89545b7ef2507d8d5b0de0855f30 | [
"MIT"
] | null | null | null | import os
import sys
from pathlib import Path
import yaml
CURRENT_DIR = Path(sys.argv[0] if __name__ == "__main__" else __file__).resolve().parent
service_to_path = {
path.stem: path for path in (CURRENT_DIR / ".." / "services").glob("*.py")
}
service_names = sorted(service_to_path.keys())
compose = {
"ver... | 23.666667 | 88 | 0.552817 |
603c1f566bd512d6543bd338284e08bcb04998be | 13,886 | py | Python | mediation_service/tests/test_prepare_ssp_response.py | NHSDigital/gp-connect-access-record-fhir-api | f47efb2bf90674760961edb7c6fd650dc3efd40b | [
"MIT"
] | null | null | null | mediation_service/tests/test_prepare_ssp_response.py | NHSDigital/gp-connect-access-record-fhir-api | f47efb2bf90674760961edb7c6fd650dc3efd40b | [
"MIT"
] | 68 | 2022-01-17T13:39:05.000Z | 2022-03-31T15:40:33.000Z | mediation_service/tests/test_prepare_ssp_response.py | NHSDigital/gp-connect-access-record-fhir-api | f47efb2bf90674760961edb7c6fd650dc3efd40b | [
"MIT"
] | null | null | null | from copy import deepcopy
from mediation_service.mediation.prepare_ssp_response import (
ALLERGIES_AND_ADVERSE_REACTION_LIST_CODE,
ENDED_ALLERGIES_LIST_CODE,
prepare_ssp_response,
_extract_resolved_allergies,
_select_lists_with_code,
)
import re
def test_list_selection():
fhir_res = {
... | 31.703196 | 139 | 0.422152 |
241a264f23287712700304bbcafc4841ae4a2729 | 2,294 | py | Python | toontown/coghq/LaserGameAvoid.py | SuperM0use24/TT-CL-Edition | fdad8394f0656ae122b687d603f72afafd220c65 | [
"MIT"
] | null | null | null | toontown/coghq/LaserGameAvoid.py | SuperM0use24/TT-CL-Edition | fdad8394f0656ae122b687d603f72afafd220c65 | [
"MIT"
] | 1 | 2021-06-08T17:16:48.000Z | 2021-06-08T17:16:48.000Z | toontown/coghq/LaserGameAvoid.py | SuperM0use24/TT-CL-Edition | fdad8394f0656ae122b687d603f72afafd220c65 | [
"MIT"
] | 3 | 2021-06-03T05:36:36.000Z | 2021-06-22T15:07:31.000Z | from toontown.coghq import LaserGameBase
from direct.distributed import ClockDelta
from direct.task import Task
import random
class LaserGameAvoid(LaserGameBase.LaserGameBase):
def __init__(self, funcSuccess, funcFail, funcSendGrid, funcSetGrid):
LaserGameBase.LaserGameBase.__init__(self, funcSuccess, fun... | 31.861111 | 100 | 0.547951 |
344e211b0142b3bb2bac7c7307e12c5ef4fd19a6 | 611 | py | Python | setup.py | aboomer07/densecrf_np | 1f1436f419e9f25a511c3a98378a46ebfb9073b6 | [
"MIT"
] | null | null | null | setup.py | aboomer07/densecrf_np | 1f1436f419e9f25a511c3a98378a46ebfb9073b6 | [
"MIT"
] | null | null | null | setup.py | aboomer07/densecrf_np | 1f1436f419e9f25a511c3a98378a46ebfb9073b6 | [
"MIT"
] | null | null | null | from distutils.extension import Extension
from Cython.Build import cythonize
import numpy as np
from setuptools import find_packages, setup
setup(
name='densecrf_np',
version="0.0.1",
author="Sadeep Jayasumana",
author_email="sadeep@apache.org",
url='https://github.com/aboomer07/densecrf_np',
p... | 26.565217 | 57 | 0.669394 |
eca46df59b3c9ccfd3d33164af7aee4533f5d534 | 3,222 | py | Python | todo-api/app.py | Evalle/study-rest | 375ddc35bff400274abdf01632a0c8625c5cafeb | [
"Apache-2.0"
] | null | null | null | todo-api/app.py | Evalle/study-rest | 375ddc35bff400274abdf01632a0c8625c5cafeb | [
"Apache-2.0"
] | null | null | null | todo-api/app.py | Evalle/study-rest | 375ddc35bff400274abdf01632a0c8625c5cafeb | [
"Apache-2.0"
] | null | null | null | #!flask/bin/python
from flask import Flask, jsonify, abort, make_response, request, url_for
from flask.ext.httpauth import HTTPBasicAuth
app = Flask(__name__)
auth = HTTPBasicAuth()
# authentication
@auth.get_password
def get_password(username):
if username == 'evgeny':
return 'python'
return None
... | 27.538462 | 78 | 0.619181 |
30b4a12cceaa98f845df6942f71a48cbb4edfc38 | 76 | py | Python | lang/Python/closures-value-capture-3.py | ethansaxenian/RosettaDecode | 8ea1a42a5f792280b50193ad47545d14ee371fb7 | [
"MIT"
] | null | null | null | lang/Python/closures-value-capture-3.py | ethansaxenian/RosettaDecode | 8ea1a42a5f792280b50193ad47545d14ee371fb7 | [
"MIT"
] | null | null | null | lang/Python/closures-value-capture-3.py | ethansaxenian/RosettaDecode | 8ea1a42a5f792280b50193ad47545d14ee371fb7 | [
"MIT"
] | null | null | null | funcs = [lambda i=i: i * i for i in range(10)]
print(funcs[3]()) # prints 9
| 25.333333 | 46 | 0.605263 |
7a5a379ab20c98abd585c6c100075d375cbce9a8 | 9,177 | py | Python | eval_attacks.py | dreamflake/ODI | d58001b96821c8a74d6ebb5402bd2be2b524890a | [
"MIT"
] | 1 | 2022-03-29T08:33:43.000Z | 2022-03-29T08:33:43.000Z | eval_attacks.py | dreamflake/ODI | d58001b96821c8a74d6ebb5402bd2be2b524890a | [
"MIT"
] | null | null | null | eval_attacks.py | dreamflake/ODI | d58001b96821c8a74d6ebb5402bd2be2b524890a | [
"MIT"
] | 1 | 2022-03-20T04:52:33.000Z | 2022-03-20T04:52:33.000Z | # Code for "Improving the Transferability of Targeted Adversarial Examples through Object-Based Diverse Input"
# in submission to CVPR 2022
# Anonymous CVPR submission
import torch
#from torchvision import transforms
from PIL import Image
import csv
import numpy as np
import os
import traceback
from attacks import *... | 44.985294 | 211 | 0.627547 |
40ea8a55277377338ab135cdfe685a8d68de9f9e | 602 | py | Python | programming/python/machine-learning/ch03/calculate_numpy.py | yukihirai0505/tutorial-program | f1eccbfdc39c8f0d028f1638d4d18edbb94194a4 | [
"MIT"
] | 1 | 2018-12-13T23:07:17.000Z | 2018-12-13T23:07:17.000Z | programming/python/machine-learning/ch03/calculate_numpy.py | yukihirai0505/tutorial-program | f1eccbfdc39c8f0d028f1638d4d18edbb94194a4 | [
"MIT"
] | 7 | 2017-08-06T09:13:18.000Z | 2019-07-08T05:32:32.000Z | programming/python/machine-learning/ch03/calculate_numpy.py | yukihirai0505/tutorial-program | f1eccbfdc39c8f0d028f1638d4d18edbb94194a4 | [
"MIT"
] | null | null | null | import numpy as np
A = np.array([1, 2, 3, 4])
print(A)
# 1 array -> vector
print(np.ndim(A))
print(A.shape)
print(A.shape[0])
# 2 array -> matrix
B = np.array([[1, 2], [3, 4], [5, 6]])
print(B)
print(np.ndim(B))
print(B.shape)
# calculate multiply
C = np.array([[1, 2], [3, 4]])
print(C.shape)
D = np.array([[5, 6], ... | 17.2 | 38 | 0.548173 |
a64b295e8ba73c17c10a30022e2dd9f11cd80a24 | 2,026 | py | Python | test/functional/p2p_invalid_locator.py | BitcoinReload/BitcoinReload | c927ca366ba769e33903b8e4f90d364c74e5e590 | [
"MIT"
] | 1 | 2022-03-23T00:32:26.000Z | 2022-03-23T00:32:26.000Z | test/functional/p2p_invalid_locator.py | BitcoinReload/BitcoinReload | c927ca366ba769e33903b8e4f90d364c74e5e590 | [
"MIT"
] | null | null | null | test/functional/p2p_invalid_locator.py | BitcoinReload/BitcoinReload | c927ca366ba769e33903b8e4f90d364c74e5e590 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-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 node responses to invalid locators.
"""
from test_framework.messages import msg_getheaders, msg_g... | 46.045455 | 135 | 0.697927 |
0eb921aa5219fece6cf213df00f96f1d9ee4d74d | 855 | py | Python | prova2.py | Laura32855/logicaprogramacao | a295b4a34b0dc866dd1801bca36400181db1092c | [
"MIT"
] | null | null | null | prova2.py | Laura32855/logicaprogramacao | a295b4a34b0dc866dd1801bca36400181db1092c | [
"MIT"
] | null | null | null | prova2.py | Laura32855/logicaprogramacao | a295b4a34b0dc866dd1801bca36400181db1092c | [
"MIT"
] | null | null | null | #inicio
def exercicio1():
print('Coloque três notas: ')
nota_1 = float(input())
nota_2 = float(input())
nota_3 = float(input())
return (f'Media do aluno é: {(nota_1 + nota_2 + nota_3) / 3}')
#fim
#inicio
def exercio2():
num_elementos = int(input('Coloque tamanho da lista: '))
lista = []
for ... | 19 | 64 | 0.62924 |
3ab237831e2b9c512e47cda8c4c83e92eb7a4434 | 1,458 | py | Python | nipype/interfaces/slicer/filtering/tests/test_auto_VotingBinaryHoleFillingImageFilter.py | PAmcconnell/nipype | 39fbd5411a844ce7c023964d3295eb7643b95af5 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/slicer/filtering/tests/test_auto_VotingBinaryHoleFillingImageFilter.py | PAmcconnell/nipype | 39fbd5411a844ce7c023964d3295eb7643b95af5 | [
"Apache-2.0"
] | 2 | 2018-04-26T12:09:32.000Z | 2018-04-27T06:36:49.000Z | nipype/interfaces/slicer/filtering/tests/test_auto_VotingBinaryHoleFillingImageFilter.py | PAmcconnell/nipype | 39fbd5411a844ce7c023964d3295eb7643b95af5 | [
"Apache-2.0"
] | 1 | 2019-11-14T14:16:57.000Z | 2019-11-14T14:16:57.000Z | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ..votingbinaryholefillingimagefilter import VotingBinaryHoleFillingImageFilter
def test_VotingBinaryHoleFillingImageFilter_inputs():
input_map = dict(
args=dict(argstr='%s', ),
background=dict(argstr='--background %d', ),
environ=d... | 32.4 | 83 | 0.602881 |
ee89499d9e101089e3fe74a035db4ef0297f2fd3 | 653 | py | Python | setup.py | elemental-lf/chowder | 188a23b68b23388bdb9e027b832709a4f2999f7e | [
"MIT"
] | null | null | null | setup.py | elemental-lf/chowder | 188a23b68b23388bdb9e027b832709a4f2999f7e | [
"MIT"
] | null | null | null | setup.py | elemental-lf/chowder | 188a23b68b23388bdb9e027b832709a4f2999f7e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('requirements.txt', 'r', encoding='utf-8') as f:
requirements = [line.rstrip() for line in f]
setup(
name='chowder',
version='0.1.0',
description='All-in-one Docker image of C... | 27.208333 | 91 | 0.672282 |
2c008f6c16add27a3f1f7a7810a60575514609fc | 4,206 | py | Python | tests/test_gui.py | Bystroushaak/bottle-gui | 5135a87e7f0be8e36c1fc8663f46d1dbe6e89a2a | [
"MIT"
] | 3 | 2015-01-03T22:10:33.000Z | 2015-01-04T16:48:45.000Z | tests/test_gui.py | Bystroushaak/bottle-gui | 5135a87e7f0be8e36c1fc8663f46d1dbe6e89a2a | [
"MIT"
] | 4 | 2015-01-03T18:44:34.000Z | 2020-09-26T08:02:18.000Z | tests/test_gui.py | Bystroushaak/bottle-gui | 5135a87e7f0be8e36c1fc8663f46d1dbe6e89a2a | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
# This work is licensed under a Creative Commons 3.0 Unported License
# (http://creativecommons.org/licenses/by/3.0/).
#
# Imports ====================================================================
import sys
import time
import random
... | 27.135484 | 79 | 0.498811 |
b293333b7080d62af4fdeb6472c3bde17a8045c5 | 2,805 | py | Python | huaweicloud-sdk-bss/huaweicloudsdkbss/v2/model/show_refund_order_details_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | 1 | 2021-11-03T07:54:50.000Z | 2021-11-03T07:54:50.000Z | huaweicloud-sdk-bss/huaweicloudsdkbss/v2/model/show_refund_order_details_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-bss/huaweicloudsdkbss/v2/model/show_refund_order_details_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import pprint
import re
import six
class ShowRefundOrderDetailsRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
an... | 25.5 | 80 | 0.547237 |
c1d926339a3576431c13fb985f8649bb717b98c8 | 1,022 | py | Python | _1327/information_pages/models.py | karyon/1327 | c5c5b0fe2111f43e7fe6934e8661f5fef2998bef | [
"MIT"
] | null | null | null | _1327/information_pages/models.py | karyon/1327 | c5c5b0fe2111f43e7fe6934e8661f5fef2998bef | [
"MIT"
] | null | null | null | _1327/information_pages/models.py | karyon/1327 | c5c5b0fe2111f43e7fe6934e8661f5fef2998bef | [
"MIT"
] | null | null | null | from django.db import models
from django.db.models.signals import pre_save
from django.dispatch import receiver
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext_lazy as _
from _1327.main.models import UserProfile
class Document(models.Model):
author = models.ForeignK... | 29.2 | 79 | 0.750489 |
af9b746640efae8cb4e3fe16481ba0fe43f231ed | 5,794 | py | Python | plugins/module_utils/network/os10.py | pprakashsamy/dellemc_networking.os10 | c4e667851d189c04fd3e4faf33da45b7485f3929 | [
"Apache-2.0"
] | null | null | null | plugins/module_utils/network/os10.py | pprakashsamy/dellemc_networking.os10 | c4e667851d189c04fd3e4faf33da45b7485f3929 | [
"Apache-2.0"
] | null | null | null | plugins/module_utils/network/os10.py | pprakashsamy/dellemc_networking.os10 | c4e667851d189c04fd3e4faf33da45b7485f3929 | [
"Apache-2.0"
] | null | null | null | #
# (c) 2020 Peter Sprygada, <psprygada@ansible.com>
# (c) 2020 Red Hat, Inc
#
# Copyright (c) 2020 Dell Inc.
#
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamica... | 37.869281 | 120 | 0.699862 |
0eab05c93fbae42b5d6adf17d073eff78656ac87 | 6,320 | py | Python | SCons/Node/Python.py | ravenAtSafe/scons | ebe6e9b1b2fedbe3dd44c07aa2b6739d4079879e | [
"MIT"
] | null | null | null | SCons/Node/Python.py | ravenAtSafe/scons | ebe6e9b1b2fedbe3dd44c07aa2b6739d4079879e | [
"MIT"
] | 1 | 2020-11-09T00:19:51.000Z | 2020-11-09T00:19:51.000Z | SCons/Node/Python.py | ravenAtSafe/scons | ebe6e9b1b2fedbe3dd44c07aa2b6739d4079879e | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright The SCons Foundation
#
# 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, merge, ... | 31.287129 | 77 | 0.646203 |
2cbacfe67070b797fa6fbbd7db27d8b233864d9c | 10,390 | py | Python | library/azure_rm_virtualmachinescalesetinstance.py | portos060474/azure_modules | 008332fb07f79507cf00ac71f8249bc668bd7c7e | [
"MIT"
] | 31 | 2018-01-24T08:39:30.000Z | 2021-12-19T00:01:04.000Z | library/azure_rm_virtualmachinescalesetinstance.py | portos060474/azure_modules | 008332fb07f79507cf00ac71f8249bc668bd7c7e | [
"MIT"
] | 17 | 2018-02-01T12:35:57.000Z | 2020-04-22T20:47:52.000Z | library/azure_rm_virtualmachinescalesetinstance.py | portos060474/azure_modules | 008332fb07f79507cf00ac71f8249bc668bd7c7e | [
"MIT"
] | 39 | 2018-02-01T11:56:03.000Z | 2021-12-19T18:34:49.000Z | #!/usr/bin/python
#
# Copyright (c) 2019 Zim Kalinowski, (@zikalino)
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | 38.339483 | 154 | 0.543022 |
5a971a635784d5537ce0e2407f1540f2a2842955 | 89 | py | Python | jam/__init__.py | Ghostik2005/jam-py | 4835daae466e82d2304529cc6f5ab7397b102332 | [
"BSD-3-Clause"
] | 1 | 2021-07-07T09:31:44.000Z | 2021-07-07T09:31:44.000Z | jam/__init__.py | platipusica/SambaShares | c4f3647c6fba925977f36089f69deb674befe82c | [
"BSD-3-Clause"
] | null | null | null | jam/__init__.py | platipusica/SambaShares | c4f3647c6fba925977f36089f69deb674befe82c | [
"BSD-3-Clause"
] | null | null | null | VERSION = (5, 4, 27)
def version():
global VERSION
return '%s.%s.%s' % VERSION
| 12.714286 | 31 | 0.561798 |
637d6d525b4c14e7f52dccb50213e30f7bfaaa2d | 4,699 | py | Python | venv/lib/python2.7/site-packages/django/core/management/commands/flush.py | harshmalik/django-crm | 01a4a2f837bb11eb9c600e78e3a00461d89c8775 | [
"MIT"
] | 1 | 2017-11-02T14:27:45.000Z | 2017-11-02T14:27:45.000Z | env/lib/python2.7/site-packages/django/core/management/commands/flush.py | luiscarlosgph/nas | e5acee61e8bbf12c34785fe971ce7df8dee775d4 | [
"MIT"
] | null | null | null | env/lib/python2.7/site-packages/django/core/management/commands/flush.py | luiscarlosgph/nas | e5acee61e8bbf12c34785fe971ce7df8dee775d4 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import sys
from importlib import import_module
from optparse import make_option
from django.apps import apps
from django.db import connections, router, transaction, DEFAULT_DB_ALIAS
from django.core.management import call_command
from django.core.management.base import NoArgsCo... | 46.524752 | 127 | 0.643541 |
029aa1faf395c30dd61aed33daa1b2c6cc63f311 | 5,286 | py | Python | Operating and Distributed Systems (Python)/Banking System with RPC (distributed and replicated)/ClientLibs/BankScripter.py | PFigs/portfolio | 26d3d005b62af50a5f708930105fe506ec186d24 | [
"MIT"
] | null | null | null | Operating and Distributed Systems (Python)/Banking System with RPC (distributed and replicated)/ClientLibs/BankScripter.py | PFigs/portfolio | 26d3d005b62af50a5f708930105fe506ec186d24 | [
"MIT"
] | null | null | null | Operating and Distributed Systems (Python)/Banking System with RPC (distributed and replicated)/ClientLibs/BankScripter.py | PFigs/portfolio | 26d3d005b62af50a5f708930105fe506ec186d24 | [
"MIT"
] | 1 | 2018-09-07T09:27:18.000Z | 2018-09-07T09:27:18.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Instituto Superior Técnico 2010/2011
# Operating and Distributed Systems
#
# Code written by:
# Filipe Funenga filipe.funenga@ist.utl.pt (57977)
# Martim Camacho martim.camacho@ist.utl.pt (56755)
# Pedro Silva pedro.silva@ist.utl.pt (58035)
#
# Credits:
#... | 26.168317 | 114 | 0.653046 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.